The following commands are tested on RedHat and CentOS.
# vi /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
ServerAdmin root@server.example.com
ServerAlias server2.example.com
DocumentRoot /home
ServerName storage.estuate
ErrorLog logs/deepak.example.com.log
CustomLog logs/deepak.example.com.access_log
</VirtualHost>
Here "*" signifies your apache server will listen to any IP you have used for web server configuration on your machine. You should make an habbit of using proper IP or name instead of "*".
ServerAdmin ==> sets the contact address that the server includes in any error messages it returns to the client.If the httpd doesn't recognize the supplied argument as an URL, it assumes, that it's an email-address and prepends it with mailto: in hyperlink targets. However, it's recommended to actually use an email address.
ServerAlias ==> This directive sets the alternate names for a host.
ServerName ==> This directive sets the request scheme, hostname and port that the server uses to identify itself. This is used when creating redirection URLs.
DocumentRoot ==> This directive specifies the root directory of the files you want to be visible on your web server
Adding some more features to your virtual hosts
# vi /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
ServerAdmin root@server.example.com
ServerAlias server2.example.com
DocumentRoot /home
ServerName storage.estuate
<Directory /home/deepak/mypage.html>
AllowOverride None
Order Deny,Allow
Deny from All
</Directory>
</VirtualHost>
AllowOverride None will disable the access to .htaccess file
<Directory /home/deepak/mypage.html>
Order Deny,Allow
Allow from all
</Directory>
You can check one example of virtual hosting with all the above directives used in the following post
yum configuration using apache server
Follow the below links for more tutorials
How does a DNS query works when you type a URL on your browser?
How to create password less ssh connection for multiple non-root users
How to create user without useradd command in Linux
How to unlink/delete a symbolic in Linux
How to give normal user root privileges using sudo in Linux/Unix
How to do Ethernet/NIC bonding/teaming in Red Hat Linux
How to install/uninstall/upgrade rpm package with/without dependencies