We start this step by going into the configuration files directory:
Since Apache came with a default VirtualHost file, let’s use that as a base. (
gci.conf is used here to match our subdomain name):
sudo cp 000-default.conf gci.conf
Now edit the configuration file:
sudo nano gci.conf
We should have our email in
ServerAdmin so users can reach you in case Apache experiences any error:
We also want the
DocumentRoot directive to point to the directory our site files are hosted on:
The default file doesn’t come with a
ServerName directive so we’ll have to add and define it by adding this line below the last directive:
This ensures people reach the right site instead of the default one when they type in gci.example.com.
Now that we’re done configuring our site, let’s save and activate it in the next step!