Apache2 Configuration

The apache configuration is saved in the directory /etc/apache2 in the following files and directories:

File apache2.conf:
Main configuration of apache2, it have the necesary configuration to run apache.
We dont need to edit this file.
File ports.conf
What port apache listen, we need two, port 80 for HTTP and port 443 for HTTPS, we will edit the file, and leave like this:
Listen 80,443
Directory conf.d:
Directory for especial configuration, we dont need it.
Directories mods-available and mods-enabled:
This directory have all the modules we can use of apache2, to enable a module is neccesary link it to the directory mods-enabled.
Directories sites-available and sites-enabled:
In sites available we must configure the sites we can use.
For example we are going to create a no secure gosa site gosa, we can use it to redirect the request to the secure server.

Gosa Configuration (sites-available/gosa) can be like this:
NameVirtual *
<VirtualHost *>
ServerName gosa.chaosdimension.org
Redirect /gosa https://gosa.chaosdimension.org/gosa
CustomLog /var/log/apache/gosa.log combined
ErrorLog /var/log/apache/gosa.log
</VirtualHost>

And when is saved, can be enabled making this:

#>ln -s /etc/apache2/sites-available/gosa.conf /etc/apache2/sites-enabled/gosa.conf

Directory ssl:
Directory for Secure Socket Layer configuration, this will see in the next section.


Subsections
aescanero AT gmail.com