Apache Virtual Host Configuration

1and1 uses the Apache web server, and it is assumed that most development sites created to work on the acl main page will want to use it locally as well for maximum environment duplication. The best procedure for creating a development site probably involves setting up a virual host in the local Apache instance to serve the site from the local machine as though it were a standalone website. This page documents how to do that.

Unfortunately, Apache configurations can vary widely by platform, so there is only so much help this document can provide. The basics, however, are as follows:

  1. Include a virtual host configuration setting similar to the following in a relevant config file:
    
        <VirtualHost *:80>
          ServerName acl.dev
          DocumentRoot /absolute/path/to/development/site
    
          <Directory /absolute/path/to/development/site>
            DirectoryIndex index.php
            AllowOverride all
            Order allow,deny
            Allow from all
          </Directory>
        </VirtualHost>
    
        
  2. You may need to list acl.dev in your hosts file as a local route. Again, the location of this file will vary with platform, but it's usually in /etc/hosts. Edit this to add the following line:
    • 127.0.0.1 acl.dev
  3. Restart Apache:
    • sudo apachectl restart (note - this command can also vary by platform - be sure to check what your platform's version of apachectl is)

The current site was developed on a MacBook Pro running OSX 10.7.5. For that setup - and, presumably, most Mac setups, the relevant configuration file is /etc/apache2/extra/httpd-vhosts.conf. Simply paste the virtual host setup code above into that file and change /absolute/path/to/development/site to match the location of your development site in your local filesystem, restart Apache, point your browser to http://acl.dev and everything should work (you may get permissions errors if you haven't carefully followed these instructions, however). On other systems - particularly on Windows - the location may vary. Regardless of the system, the central httpd.conf file can always read and implement virtual host settings, so when in doubt put it in there.