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: public.gsinet.ch.
  • Edit it to your needs. Especially the following values:
    • <VirtualHost public.gsinet.ch:443>
    • ServerAdmin hostmaster@gsinet.ch
    • DocumentRoot /var/www/yoursite
    • <Directory /var/www/yoursite/>
  • enable your virtual host definition:
   $ sudo a2ensite public.gsinet.ch
  • test the config
   $ sudo apache2ctl configtest
  • if the config test didn't fail then restart apache
   $ sudo apache2ctl restart