* add virtual hosting to the Qube3
* Retain the main site's functionality
* Retain the Users personal website directory functionality for the main site
* Include the virtual hosts in Qube's backup
* Map the virtual hosts to Qube users, for easy FTP access to the various sites.
* Map de /login directory for the admin interface
The modifications shown below all go into the file /etc/httpd/conf/httpd.conf
#
# enable vhosts. this line is missing in the sample httpd.conf on the Qube, causing vhosts not to work at all
# if you simply uncomment the lines
#
NameVirtualHost *
#
# first we set up the old mainsite of the Qube. This is the domain name you used before moving
# on to virtual hosts. The AliasMatch line makes the mappings for your user directory's so previous
# sites like www.yourdomain.com/~username will still work.
#
<Virtualhost *>
Servername www.depopo.net
Documentroot /home/groups/home/web
Aliasmatch ^/~([^/]+)(/(.*))? /home/users/$1/web/$3
#
# next, setup a rewriterul for the /login url to point to the admin interface
# note that this mapping is INSIDE the virtual host definition
#
RewriteEngine on
RewriteCond %{HTTP_HOST} ^([^:]+)
RewriteRule ^/login/?$ http://%1:444/login.php [L,R]
RewriteCond %{HTTP_HOST} ^([^:]+)
RewriteRule ^/admin/?$ http://%1:444/login.php [L,R]
# end of admin interface mapping
</Virtualhost>
#
# Now we are going to create a virtual host which points to the home directory of users1
# the host will be reachable from the internet with www.seconddomain.com(change to your domain name)
# You can simply ftp into the qube with user1's account to upload the files. Also, since the user directory's are in
# in the Qube's backup you will have that covered too.
#
<Virtualhost *>
Servername www.seconddomain.com
Documentroot /home/users/users1/web
</Virtualhost>
# maps to directory of user2
<Virtualhost *>
Servername forums.somedomain.com
Documentroot /home/users/user2/web
</Virtualhost>
#
# and so on, and so on
#
updated 9 aug 2004, mapping for /admin, thanks to daw50n for pointing out the omission