A set of scripts to do one-stroke virtual host setup with apache2 package in Debian/Ubuntu.
Author: Timothy Chien [:timdream] <timdream@gmail.com>
License: GPLv2.
Make a virtual host. Upon execution, mkvhost.sh
will:
- create vhost directories and all configration files.
- Set up two virtual hosts config named
shortname
andshortname-redirect
(whereshortname
is the name you specified). The later one is good for blind redirection, e.g.www.domain.tld
->domain.tld
. - Set up logrotate, awstat and their corntab.
All configration files are contained in the specified directory and symbolic linked to proper places.
Remove symbolic links of the vhost configration files created by mkvhost.sh
.
To permentently delete the entire virtual host, do rm -R ./your-vhost/
.
Recreate symbolic links.
Experimental: Setup LAMP enviroment on a bare Ubuntu system.
- The Debian
apache2
package changed default virtual host setting from<VirtualHost *>
to<VirtualHost *:80>
after version 2.2.9-8. If you are still running apache2 below that version (you really shouldn't), you should modifymkvhost.sh
accordingly BEFORE creating virtual hosts.