Is it possible to setup multiple Virtual Hosts with one ip/domain?
We have a single domain (example.com) pointing to our server at ip (123.123.555.555). At location 123.123.555.555 we require the following folder structure:
# production level
/htdocs/www/prod/proj1/
/htdocs/www/prod/proj2/
# dev level
/htdocs/www/dev/proj3/
/htdocs/www/dev/proj4
Where ideally we would like example.com to resolve to /htdocs/www/prod/ and example.com/dev to resolve to /htdocs/www/dev/.
Simple enough no?
Caveats:
devandprodneed different setup directory/apache rules (allow deny from, etc)prodneeds to resolve withoutprodin the url.example.com/proj1would gotoexample.com/prod/proj1
Attempts so far..
I've tried setting up with the same virtual host, but giving a directory an alias of / sends it into a fit, claiming that it will be overwritten later. It makes sense because / matches / but also /dev
I've also tried setting up multiple virtual hosts with apache2' sites-available/sites-enabled but it seems I can't distinguish it based on the ip/domain. Normally I would attempt something like <Directory 'sub.domain.com'> and <Directory 'sub2.domain.com'>