Monday, 15 February 2010

php - With multiple websites hosted at same ip in Apache, how do I set which one is the default? -


I have many virtualhosts in Apache, listening to all port 80s, my server name is set to different web addresses. When I go directly to the IP address, Apache sends me one of those websites as the default. I want to change the virtual location that places the requests at the IP address. How do i do this
  & lt ;! - It is currently the default (probably because it is in alphabetical order) - & gt; & Lt; VirtualHost *: 80 & gt; ServerAdmin Webmaster @ Localhost Server's name mywebsite.com DocumentRoot / var / www / testother ... & lt; / VirtualHost & gt; & Lt ;! - I think this should be the default - & gt; & Lt; VirtualHost *: 80 & gt; ServerAdmin Webmaster @ Localhost Server's name myotherwebsite.com DocumentRoot / var / www / test ... & lt; / VirtualHost & gt;    

From my own Apache configuration file:

   

Note that this is outside the DocumentRoot one VirtualHost block. I think you have something similar but if not, you can set it this way. These orders may be so messy

No comments:

Post a Comment