Turnkeylinux — Configuring Apache Virtualhosts

CIIAG
ciiag
Published in
1 min readMay 9, 2015

In this tutorial we will look at how to configure the following sub domain manage.intaff.gov.ck using apache virtualhosts. In this tutorial we will assume the the following have already been setup:

  • Installed the turnkeylinux LAMP appliance
  • registered the domain manage.intaff.gov.ck

So first SSH into the site, go to:

cd /etc/apache2/sites-available

Then create a new file called manage.intaff.gov.ck:

touch manage.intaff.gov.ck

Add the following to the file:

<VirtualHost *:80>     DocumentRoot /var/www/welfare/manage     ServerName manage.intaff.gov.ck      <Directory /var/www/welfare/manage>         Options Indexes FollowSymLinks MultiViews +Includes         AllowOverride None         Order allow,deny         allow from all     </Directory> </VirtualHost>

Then enable the virtualhost use the a2ensite command and then restart the Apache web server, see below:

a2ensite manage.intaff.gov.ckservice apache2 restart

To disable a virtual domain use the a2dissite command and then restart the Apache web server, see below:

a2dissite manage.intaff.gov.ckservice apache2 restart

--

--

CIIAG
ciiag
Editor for

ICT focused NGO based in the Cook Islands