Configuring hosts for apache on slicehost

  • Go to the place where the domain is registered (eg: hostmonster) and have it point to the ns1.slicehost.com, ns2.slicehost.com and ns3.slicehost.com
  • Create an apache virtual host file in /etc/apache2/sites-available/example1.com. Example:
  • # Place any notes or comments you have here
    # It will make any customization easier to understand in the weeks to come
    
    # domain: nycsubwayexplorer
    # public: /home/nick/www.nycsubwayexplorer.com/public_html
    
      # Admin email, Server Name (domain name) and any aliases
      ServerAdmin nick@porcaro.org
      ServerName  www.nycsubwayexplorer.com
      ServerAlias nycsubwayexplorer.com
      ServerAlias nycsubwayexplorer.org
      ServerAlias nycsubwayexplorer.net
    
      # Index file and Document Root (where the public files are located)
      DirectoryIndex index.php
      DocumentRoot /home/nick/www.nycsubwayexplorer.com/public_html
    
           Options -Indexes
           AllowOverride All
           Order allow,deny
           allow from all
           AddHandler mod_python .py
           PythonHandler mod_python.publisher
           PythonDebug On
    
      # Custom log file locations
      LogLevel warn
      ErrorLog  /home/nick/log/www.nycsubwayexplorer.com/error.log
      CustomLog /home/nick/log/www.nycsubwayexplorer.com/access.log combined
  • Create a link in sites-enable:
  • nick(nickporcaro): pwd
    /etc/apache2
    nick(nickporcaro): ls -l sites-enabled/*
    lrwxrwxrwx 1 root root 40 Nov  6 04:57 sites-enabled/nycsubwayexplorer.com -> ../sites-available/nycsubwayexplorer.com
  • Go to the DNS tab of the slice manager – pick duplicate on an entry on the right and then rename it to either the original (nycsubwayexplorer.com in the example above) or an alias (nycsubwayexplorer.net in the example above)