Apache httpd VirtualHost config - multiple sites

Posted by DaFoot on Server Fault See other posts from Server Fault or by DaFoot
Published on 2012-06-21T19:49:56Z Indexed on 2012/06/21 21:17 UTC
Read the original article Hit count: 160

Filed under:
|
|

[Advised to post here from StackExchange]

I have a site to work on, because of the way the URLs are built the application seems to have been created on the assumption that it will be at the server root (only app).

On my dev server I have other projects and up to now a simple symlink has been working for me, but that's not the case now because this new app wants to sit at the route and process all URLs arriving on :80.

Hopefully this snippet from httpd.conf will help explain what I'm trying to acheive:

# default for any not matched elsewhere
<VirtualHost *:80>
  ServerName localhost
  DocumentRoot /var/www/html/newproject
</VirtualHost>
# now try to pick out specific URLs
<VirtualHost localhost/webdev>
  DocumentRoot /var/www/html/existingProject
  ServerName localhost/project
</VirtualHost>

Also need to be able to get same affect from wherever I'm accessing the httpd instance from. Hope that makes sense.

© Server Fault or respective owner

Related posts about apache2

Related posts about virtualhost