apache2 - localhost not going to desired VirtualHost -


i have several virtalhosts set on computer. i'd visit site i'm working on different pc using comp's ip address, every config i've tried keeps taking me different virtual host (in fact first virtualhost set on comp). how set apache virtualhost configs ensure ip address takes me site want to.

/etc/apache2/sites-available/site-i-want-to-show-up-with-ip-address.conf contains:

<virtualhost *:80> serveradmin webmaster@localhost  serveralias currentsite.com  documentroot /path/to/root/of/site-i-want-to-show-up servername localhost  scriptalias /awstats/ /usr/lib/cgi-bin/  customlog /var/log/apache2/current-site-access.log combined </virtualhost> 

and /etc/apache2/sites-available/site-that-keeps-showing-up.conf contains:

<virtualhost *:80>     serveradmin webmaster@localhost     serveralias theothersite.com     documentroot /path/to/it     <directory />         options followsymlinks         allowoverride none     </directory>  </virtualhost> 

i'd appreciate anyone's help.

also, don't know configuring web servers, , used tutorials above code.

apache 2.x virtual hosts

1) need prior virtualhosts sections:

# ensure apache listens on port 80 listen 80  # listen virtual host requests on ip addresses namevirtualhost *:80 

2) each section needs documentroot , servername item:

<virtualhost 172.20.30.50> documentroot /www/example1 servername www.example1.com  # other directives here ...  </virtualhost> 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -