I have working localhost on my Fedora 15. Directory tree look like this
/var/www/html/default
/var/www/html/projects
/projects/foo
/projects/bar
/var/www/html/devel
/devel/foo
/devel/bar
For each project is created vhost conf which points to:
localhost > /var/www/html/default
devel > /var/www/html/projects
foo.devel > /var/www/html/projects/foo
dev > /var/www/html/devel
foo.dev > /var/www/html/devel/foo
What I need is to make it a little bit automated. So when i make folder 'bar' in the 'projects' directory, it will be accessible like 'bar.devel'. How to do this? mod_vhost_alias and mod_rewrite are loaded so I will try both version.
Thank You!
// edit have played little bit with mod_vhost_alias
<VirtualHost *:80>
UseCanonicalName Off
ServerAlias *.devel
VirtualDocumentRoot /var/www/html/projects/%1
</VirtualHost>
looks pretty nice.. but still is needed to make a record in /etc/hosts for each project
127.0.0.1 foo.devel
127.0.0.1 bar.devel
127.0.0.1 *.develbut it redirects me to www.foo.devel instead of foo.devel. So i need internal DNS server.. hmmm.. – 5ulo Jul 28 '11 at 12:43