Howto:Configure a apache virtual host

From gsiwiki
Jump to: navigation, search

Activating a virtual host steps to accomplish:

  • Copy the /etc/apache2/sites-available/default or /etc/apache2/sites-available/default-ssl to add a virtual host definition in /etc/apache2/sites-available/ - name it like the URL of the virtual host. Example:
  • Edit it to your needs. Especially the following values:
    • <VirtualHost>
    • ServerAdmin
    • DocumentRoot /var/www/yoursite
    • <Directory /var/www/yoursite/>
  • enable your virtual host definition:
   $ sudo a2ensite
  • test the config
   $ sudo apache2ctl configtest
  • if the config test didn't fail then restart apache
   $ sudo apache2ctl restart