Introductionvirtualhost.sh makes the following changes to /etc/apache2/httpd.conf: - It will optionally change the DocumentRoot to point at $DOC_ROOT_PREFIX (defined in the script itself or in ~/.virtualhost.sh.conf). By default this is your ~/Sites folder.
- It also adds the following lines to the end of /etc/apache2/httpd.conf:
NameVirtualHost *:80
Include /etc/apache2/virtualhosts Lastly, it adds a line in /etc/hosts to point your virtual host name to your local IP. eg. 127.0.0.1 patrickgibson 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 computerIf 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.
|
Just what I needed. Great work! Thanks!