Thursday, 23 May 2013

How to Host a Website for Free on Google Drive..

There are so many free hosting services which allow you to host your files free of cost into the cloud. But what if Google itself provide you such service. Yes Google is providing free webhosting service using Google drive. You can host a website for free on Google Drive. You can host any type of file like HTML, JAVASCRIPT files and CSS style sheets to your drive and share your web URL with others.

What is Google Drive?

Google Drive is a free of cost service which allow you to store your files as well as synchronize you files into the cloud. Google drive provide each user his free 5 GB of cloud storage which is available for each user for his file uploading, sharing and collaborate editing.If you are new to Google Drive do check Getting Started Guide with Google Drive.

What can you do using Google Drive hosting?

Using Google drive hosting you can host your HTML files, JavaScript files and CSS files. You can also put media files like images on cloud and use them in your webpage.
While designing or coding your HTML, any one can put relative path of their image files or CSS style sheets. I.e. if you put your image file in same folder as your HTML file than you can use image in code such as:
Background-image: URL (background.png);

What you can’t do using Google Drive hosting :

Server pages like PHP, JSP are not yet supported. So you can’t do server side scripting as we can do in normal hosting.
Also you can’t do custom domain mapping in Google drive as Google don’t support this service till now. Also you won’t get any option in setting to set subdomain and DNS configuration.
SQL database is also not available. So if you planning to launch a website having user registration and login properties than you need to change your decision or you have to use Google forms and excel spread sheets as your data source.

Quick Video Tutorial on How to Host a Website for Free on Google Drive:

Step Wise Explanation to host a website on Google Drive

So now you are aware that what is Google Drive and what are its limitations if are going for hosting website on Google Drive. Let’s now go for step wise explanation of hosting a website using Google Drive hosting for free.
  • Create your file folder containing all your HTML files and related CSS, JavaScript and media files.
  • Sign in to your Google Drive Account here  https://drive.google.com
  • You can find upload button there for uploading file and folders to your Google Drive.
  • Click that and upload complete folder at once (you can go for file option also and upload each file separately). After clicking upload button a file window will be pop up where you can select your folder containing your files from your desktop.
  • After the folder is selected, on clicking ok a new dialogue box appear asking you about uploading setting. Make sure here the both check boxes should be unchecked. If you check the first check box than your HTML file will converted to Google Drive format and it won’t work as Webpage.
  • Click on start upload and wait for uploading files and folders
  • Make folder and all files available to public by right clicking the folder and navigate to share option. This step is important as if you don’t make your files public your files will not be available for preview that means no one other than you can see your files.
  • Save the changes and click done button.
  • Now open your folder and open your HTML file in Google Drive (You can double click your file and can locate open button on the right down corner of your screen).
  • File will be open in new tab where easily you can find a preview button. Click on preview button, your webpage will be open.
  • You can share this link among others now. Congratulation you just hosted a website using Google Drive for free.
Click Here for a Sample Page on Google Drive

Some Check List to avoid Errors

  • Make sure you don’t forget to uncheck upload option check boxes. Which will ask you to convert your file in Google Drive file format. No need to convert file in Google Drive file format.
  • Don’t forget to make your folder and files public by clicking on share button.
  • Don’t upload files with same name in a same folder. If you create two files with same name “Hello.html” in same folder, none of them will open or work.
  • Only 5 GB of data is allowed by Google as a free web space. So try to use that in optimized way. Also make sure that your web folder doesn’t exceed this limit of 5 GB. Beyond that limit you have to pay to Google for extra space.
So this is how you can host a website on Google drive for free. Try it and make your own website today.

Monday, 13 May 2013

How to Configure NFS Server in Linux

NFS, or Network File System, is a server-client protocol for sharing files between computers on a common network. NFS enables you to mount a file system on a remote computer as if it were local to your own system. You can then directly access any of the files on that remote file system. The server and client do not have to use the same operating system. The client system just needs to be running an NFS client compatible with the NFS server.

For example NFS server could be a Linux system and Unix could be a client. But it can’t be a window system because window is not NFS compatible. The NFS server exports one or more directories to the client systems, and the client systems mount one or more of the shared directories to local directories called mount points. After the share is mounted, all I/O operations are written back to the server, and all clients notice the change as if it occurred on the local filesystem.

A manual refresh is not needed because the client accesses the remote filesystem as if it were local.because access is granted by IP address, a username and password are not required. However, there are security risks to consider because the NFS server knows nothing about the users on the client system.

Exam question 1 Some users home directory is shared from your system. Using showmount -e localhost command, the shared directory is not shown. Make access the shared users home directory

Exam question 2 The System you are using is for NFS (Network File Services). Some important data are shared from your system. Make automatically start the nfs and portmap services at boot time

Exam question 3 Share /data directory using NFS only to 192.168.0.0/24 members. These hosts should get read and write access on shared directory.

Configure NFS Server

In this example we will configure a nfs server and will mount shared directory from client side.
For this example we are using two systems one linux server one linux clients . To complete these per quest of nfs server Follow this link

Network configuration in Linux
  • A linux server with ip address 192.168.0.254 and hostname Server
  • A linux client with ip address 192.168.0.1 and hostname Client1
  • Updated /etc/hosts file on both linux system
  • Running portmap and xinetd services
  • Firewall should be off on server
We suggest you to review that article before start configuration of nfs server. Once you have completed the necessary steps follow this guide.Three rpm are required to configure nfs server. nfs, portmap, xinetd check them if not found then install
rpm
Now check nfs, portmap, xinetd service in system service it should be on
 
#setup                        
Select  System service        
from list                     
[*]portmap [*]xinetd [*]nfs   
 
Now restart xinetd and portmap service
service restart
To keep on these services after reboot on then via chkconfig command
chkconfig
After reboot verify their status. It must be in running condition
service status
now create a /data directory and grant full permission to it
mkdir
now open /etc/exports file
vi exports
share data folder for the network of 192.168.0.254/24 with read and write access
editing in exports
save file with :wq and exit
now restart the nfs service and also on it with chkconfig
service nfs restart
also restart nfs daemons with expotfs
exportfs
verify with showmount command that you have successfully shared data folder
showmount

Configure Client System

ping form nfs server and check the share folder
showmount
now mount this share folder on mnt mount point. To test this share folder change directory to mnt and create a test file
mount server directory
After use you should always unmount from mnt mount point
unmount
In this way you can use shared folder. But this share folder will be available till system is up. It will not be available after reboot. To keep it available after reboot make its entry in fstab
create a mount point, by making a directory
mkdir
now open /etc/fstab file
vi fstab
make entry for nfs shared directory and define /temp to mount point
file fstab
save the with :wq and exit reboot the system with reboot -f command
 #reboot -f 
after reboot check /temp directory it should show all the shared data
cd temp

Network configuration in Linux

In this article we will discuss all those necessary steps which you need to perform before solving networking related questions in RHCE exam. Don't skip this tutorial, giving few minutes to this could save you from huge problems in exam. All steps are given in a sequences don't skip them .

Check LAN card driver is installed or not.

LAN driver is the top most part for network. To check it run setup command

setup commands

Select network configuration from list



If you see LAN card here mean you have LAN driver

select lan card

if you don't see here anything and Linux drop you back on list manu means you don't have LAN driver. Install is first.

Check proper IP configuration

All systems on RHCE exam should have an properly configured IP address. During this entire practical we are using three systems. There description is given below Check these systems for properly configured IP address.
Node Operating system Name IP
PC1Linux RHELServer192.168.0.254
PC2Linux RHELClient1192.168.0.1
PC3Windows XPClient2192.168.0.2

Change Host Name

If you have skipped hostname during installation then it would be localhost.localdomain. You can change hostname with hostname command but this change would be temporary. To change hostname permanently do editing in /etc/sysconfig/network.
set computer name as shown in table.

#vi /etc/sysconfig/network
sysconfig

On server system set it to Server and in client system set it Client1

network

Check /etc/hosts files for name resolution

Several Linux server depend name resolution. This file should have entry of all network systems. It will save you from naming related problem. In our network it should look like this on both Linux system Server and Client1

hosts files

Check Firewall Status

Firewall is the necessary security part of Linux system which is connected to Internet. But in exam we are not going to use Internet so it’s good practice to disable it.

To disable firewall run setup commands

setup

Now select firewall configuration from list and click on run tool

select firewall configurations

Select disable and click on ok and quit to return on command prompt.

diable firewall

System reboot require to take effect so reboot system with reboot -f commands

reboot

Check portmap and xinetd package status

Almost every Linux server needs these two rpm to function properly. First check that these rpm are install or not. If no rpm is install then install them via rpm commands.

rpm status

If you have rpm then check there status via setup commands

setup

Now select system service from menu

select system service
put a star in front the portmap service
select portmap

Now put star in front the xinetd service

xinetd

Click on ok and select quit to come back on command prompt
Now restart these two service.

service restart

To keep on these services after reboot on then via chkconfig command

chkconfig

After reboot verify their status. It must be in running condition

service status

Once you have successfully completed these steps you are ready to configure the Linux server .

How to Configure DHCP Server in Linux

DHCP, or Dynamic Host Configuration Protocol, allows an administrator to configure network settings for all clients on a central server.
The DHCP clients request an IP address and other network settings from the DHCP server on the network. The DHCP server in turn leases the client an IP address within a given range or leases the client an IP address based on the MAC address of the client's network interface card (NIC). The information includes its IP address, along with the network's name server, gateway, and proxy addresses,including the netmask.
Nothing has to be configured manually on the local system, except to specify the DHCP server it should get its network configuration from. If an IP address is assigned according to the MAC address of the client's NIC, the same IP address can be leased to the client every time the client requests one. DHCP makes network administration easier and less prone to error.
Exam Question Configure the DHCP server by matching the following conditions:
  • Subnet and netmask should be 192.168.0.0 255.255.255.0
  • Gateway Should be 192.168.0.254
  • DNS Sever Should be 192.168.0.254
  • Domain Name should be example.com
  • Range from 192.168.0.10-50
Exam Question You have DHCP server, which assigns the IP, gateway and DNS server ip to Clients. There is one DNS servers having MAC address (00:50:FC:98:8D:00 in your LAN, But it always required fixed IP address (192.168.0.10). Configure the DHCP server to assign the fixed IP address to DNS server.

Configure dhcp server

In this example we will configure a dhcp server and will lease ip address to clients.
For this example we are using three systems one linux server one linux clients and one window clients.
dhcp rpm is required to configure dhcp server. check it if not found then install
rpm
Now check dhcpd service in system service it should be on
#setup
Select  System service
from list [*]dhcpd

To assign IP to dhcp server

DHCP server have a static a ip address. First configure the ip address 192.168.0.254 with netmask of 255.255.255.0 on server.
Run setup command form root user
 #setup 
setup
this will launch a new window select network configuration
network configurations
now a new window will show you all available LAN card select your LAN card ( if you don't see any LAN card here mean you don't have install driver)
select lan devices in setup
assign IP in this box and click ok
assign ip address
click on ok, quit and again quit to come back on root prompt.
restart the network service so new ip address can take place on LAN card
 #service network restart 
main configuration file of dhcp server is dhcpd.conf. This file located on /etc directory. If this file is not present there or you have corrupted this file, then copy new file first, if ask for overwrite press y
cp dhcpd sample file
now open /etc/dhcpd.conf
vi dhcpd
default entry in this file look like this
dhcpd.conf
make these change in this file to configure dhcp server
remove this line # - - - default gateway            
set option routers to 192.168.0.254                 
set option subnet-mask to 255.255.255.0             
option nis domain to example.com                    
option domain-name to example.com                   
option domain-name-servers to 192.168.0.254         
range dynamic-bootp to 192.168.0.10 192.168.0.50;   
After change this file should look like this
dhcpd.conf

How to Assign Fix IP Address to Any Host

locate this paragraph and change hardware Ethernet to client's mac address and fixed -address to ip address which you want to provide that host

dhcpd.conf

after making necessary change save file and exit
now create a blank file use to store the allocated ip address information

touch

Now restart dhcpd service and on it with chkconfig commands

service dhcpd restart

Linux Client Configuration

Client configuration is very easy and straightforward. All you need to do is set ip address to dynamic in the properties of lan card. In linux

#setup                                          
select  network configuration from menu list    
Select  lan card and enter on ok                
Select  USE DHCP and enter on ok                
Now click on  quit                              
and  quit to come back on root prompt            
 
Now restart the network service to obtain ip from dhcp server

service network restart

Window Client configuration

To configure windows system as dhcp clients open lan card properties and select tcp/ip and click on properties and set obtain ip address automatically

lan card porperties

Go on command prompt and check new ip address

ipconfig

Check lease on DHCP server

 you can check allocated address on server.

 cat
cat lease