A small script that will add a virtual host for apache which will setup automatic subdomains for a specified directory Just for personal use but someone might get some use out of this... Don't expect any support if this messes up your virtual hosts
cd /dir/to/where/I/want/it
git clone git://github.com/Datanizze/catchall.git
cd catchall
./doit.sh /path/to/my/public_html
If your public_html path is /home/user/public_html/ and you have a domain example.com.
If you then create a directory test in public_html (/home/user/public_html/test) then you will be able to access that directory directly through http://test.example.com
If you want a standard www.example.com then just create a folder called www.
If you want access to just example.com then create a folder named example (where example is the same name as your domain).
If you want to link example.com and www.example.com create a symlink instead ln -s /home/user/public_html/www /home/user/public_html/example
.
Above Paths are just examples, use your brain...
This needs to be run as root, of course.
Tested on debian squeeze & wheezy. (pre 2.4 commit) Tested on debian wheezy & jessie (post 2.4 commit)
Assumes apache to be in /etc/apache2/
Free for all and no responsibility on me!