LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to host multiple websites on different ip and different ports On Apache webserver (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-host-multiple-websites-on-different-ip-and-different-ports-on-apache-webserver-4175540191/)

naveenjoshi19 04-20-2015 03:40 AM

How to host multiple websites on different ip and different ports On Apache webserver
 
How to host multiple websites on different ip and different ports On Apache webserver in Centos 5.4.
First I made two domain on two IP :192.168.1.104 and second virtual ip 192.168.1.105.
Open the httpd.conf file and assisn two ports and two ports
vi /etc/httpd/conf/httpd.conf
NameVirtualHost 192.168.1.104:8139
NameVirtualHost 192.168.1.105:8080
<VirtualHost 192.168.1.104:8139>
DocumnetRoot /home/xyz/
serverName xyz.in
</VirtualHost>

<VirtualHost 192.168.1.105:8080>
DocumnetRoot /home/abc/
serverName abc.in
</VirtualHost>

service httpd restart
service dns restart
First One I am getting the website opened but not the second one
Please help me .I can host the website on same ip and different port but unable to host the website on different ip and different port.
DNS is working fine

bathory 04-20-2015 05:09 AM

Hi,

You need to use 2 Listen directives to define the IP/port pair. The "Listen" directive is needed if you want to use more than 1 vhost for each IP/port
Have a look at this example.

Regards


All times are GMT -5. The time now is 09:15 AM.