Forum Moderators: phranque

Message Too Old, No Replies

How do I install Virtual host in apache

I am not able to find the module

         

AjiNIMC

3:26 pm on Jun 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

When I do like this the domain1.com's document root is taken and if I reverse the order then order 2 will be taken for document root.

Even how do I install the required modules, please guide.

<VirtualHost 192.168.1.170:80>
DocumentRoot /aji/public_html
ServerName domain1.com
ServerAlias www.domain1.com
</VirtualHost>
<VirtualHost 192.168.1.170:80>
DocumentRoot /aji2/public_html
ServerName domain2.com
ServerAlias www.domain2.com
</VirtualHost>

Thanks,
AjiNIMC

jdMorgan

4:04 pm on Jun 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



By specifying an IP address, you are telling the server to use IP-based vHosts, and not name-based vHosts. So, the server accepts the first vHost container it finds for that IP address, and won't use the second one.

See the "Virtual Hosts" documentation for whichever version of Apache server [httpd.apache.org] you are running, and note the difference in the examples of these two different configuration options.

Jim

AjiNIMC

6:26 pm on Jun 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have seen that with similar entries also it works. We are using 2.2.6 but their is a module that is missing mod_vhost_alias, how do I install it?

Thanks,
Aji

coopster

8:15 pm on Jun 13, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You don't need mod_vhost_alias, that is entirely different from what you are doing here. Virtual hosting is already available. It is part of Apache core. You need to make sure you are listening on that address and/or port though for name-based virtual hosts:
NameVirtualHost 192.168.1.170:80

Once you have that directive set up correctly and restart Apache your virtual host containers there will work as is.

AjiNIMC

5:59 am on Jun 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Coopster, it did work out well :), Amazing