print Creating a Scorpio development environment

Configuring Apache

We will now turn our attention to the Apache server. We need to create a vhosts.conf entry so that the websites folder and our sites can be accessed. This is a very basic setup and does not look at any advanced Apache configuration directives.

First we need to create the vhosts.conf file, or update an existing one:

nano /etc/httpd/conf.d/vhosts.conf

The following should be entered as the basic configuration:

# default virtual host
NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot /var/www/html
</VirtualHost>

# scorpio site definitions
<Directory "/home/sites/scorpio/websites/base">
    Options +MultiViews +FollowSymLinks +ExecCGI
    AllowOverride All
</Directory>
<VirtualHost *:80>
    DocumentRoot /home/sites/scorpio/websites/base
    ServerName site.local 
    ServerAlias *.site.local
</VirtualHost>

Save the changes (Ctrl+O, Ctrl+X) and first test the config file to make sure there are no errors in it:

service httpd configtest

Finally, either start, restart or perform a graceful restart of the apache service:

service httpd graceful

A graceful restart will restart the server without taking it offline.