My favorites | Sign in
Project Logo
                
Search
for
Updated Oct 23, 2009 by patrickg.com
Labels: Featured
HowItWorks  
Find out what files are modified and/or used

Introduction

virtualhost.sh makes the following changes to /etc/apache2/httpd.conf:

Each virtual host's configuration file is stored in /etc/apache2/virtualhosts with a filename corresponding to the name of the virtual host.

Moving to a new computer

If you wanted to move everything over to a new computer, you could simply create a tarball:

cd /
sudo tar czvf virtualhosts.tgz /etc/apache2/virtualhosts /etc/apache2/httpd.conf /etc/hosts

Copy this tarball to your new computer. For this example, we'll assume it is placed on your Desktop. To extract it:

cd /
sudo tar xzvf ~/Desktop/virtualhosts.tgz
sudo apachectl restart
sudo dscacheutil -flushcache

The last two lines restart Apache and flush your computer's DNS cache.


Comment by clif...@labrums.org, Oct 23, 2009

Just what I needed. Great work! Thanks!


Sign in to add a comment
Hosted by Google Code