how to create virtual IP Address through real IP address and host multiple Website


hello guys today we will learn how to create virtual IP Address through real IP address and host multiple website on singles system. It’s a very simple process in RedHat Linux Server. Before we will install some necessary package for hosting Virtual IP address. if we want that   all type package install easily in your linux machine  so we have to need YUM server we can configure YUM Server very easily you just lick on my link and look  how to configure YUM server. After YUM server configure you just follow my simple Step

Step 1  here i agree that you have YUM server in our Linux machine then we will continue

[root@localhost ~]# ifconfig
eth2      Link encap:Ethernet  HWaddr 08:00:27:35:57:7A
          inet addr:192.168.56.103  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe35:577a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1933 errors:0 dropped:0 overruns:0 frame:0
          TX packets:632 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:183768 (179.4 KiB)  TX bytes:107123 (104.6 KiB)
          Base address:0xd248 Memory:f0840000-f0860000

 Step2  then we will virtual IP address Here kind this

[root@localhost ~]# ifconfig eth1:0 192.168.56.108

Step3  then we will install php package through yum server

[root@localhost ~]# yum install php* -y

Step4 then we will going following directory /var/www/html/ and here create any folder for our website hosting for example here i create two folder for my two web pages one is php folder two is html folder. And both folder in we will create html file 

[root@localhost ~]# cd /var/www/html/
[root@localhost html]# mk dir php
[root@localhost html]# mkdir html

Step5 here php and html folder in we will create any html files or our past our website content

[root@localhost php]# vim php.php
<?echo
echo "hello this is php demo ";
echo "hello this is php website host demo";
?>
~
~
~
:wq
[root@localhost ~]# cd /var/www/html/html
[root@localhost html]# vim html.html
<html>
<head>this is demo</head>
<title>Demo</title>
<body>
<h1> this is dual webhosting deno in linux machine </h1>
<h2>this dual  webhosting Demo with Virtual IP Address</h2>
</body>
</html>
~
~
~
:wq

Step5 then we will go Apache Configuration File and do something  below configuration

#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
<VirtualHost 192.168.56.103:80>
DocumentRoot /var/www/html/php/
DirectoryIndex php.php
</VirtualHost>
<VirtualHost 192.168.56.108:80>
DocumentRoot /var/www/html/html/
DirectoryIndex html.html
</virtualHost>
"/etc/httpd/conf/httpd.conf" 1000L, 33934C

here we will configure document root  Directory index with real and virtual ip Address

Step 6 then we will restart serves below commands 

[root@localhost ~]# service httpd restart

Step 7 now we will off our Linux machine firewall and selinux through below commands  

[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0

Step 8 then we will going to any browser in put our IP address and Virtual ip address. now we will look that our website is looking here

how to create virtual ip address

if you have any problem in this process so please comment here i will solve your problem

Thank you

by Vishnu sharma

 

Advertisements

One thought on “how to create virtual IP Address through real IP address and host multiple Website

  1. Frank

    I’ve ben suring oonline moire thn 2 hours today, yyet I nevdr
    found aany interestig articlke liuke yours.
    It iis prettyy worrh enough for me. Personally, if aall webb
    owners andd blogbgers masde good contennt ass yoou did, thhe
    wweb will bee much mre ueeful han ever before.

    Like

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s