Apache2 configuration
Sep 6, 2018 · 2 min read
(reference : https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-16-04)
Content
/var/www/html: The actual web content, which by default only consists of the default Apache page you saw earlier, is served out of the/var/www/htmldirectory. This can be changed by altering Apache configuration files.
Server Configuration
/etc/apache2: The Apache configuration directory. All of the Apache configuration files reside here./etc/apache2/apache2.conf: The main Apache configuration file. This can be modified to make changes to the Apache global configuration. This file is responsible for loading many of the other files in the configuration directory./etc/apache2/ports.conf: This file specifies the ports that Apache will listen on. By default, Apache listens on port 80 and additionally listens on port 443 when a module providing SSL capabilities is enabled./etc/apache2/sites-available/: The directory where per-site "Virtual Hosts" can be stored. Apache will not use the configuration files found in this directory unless they are linked to thesites-enableddirectory (see below). Typically, all server block configuration is done in this directory, and then enabled by linking to the other directory with thea2ensitecommand./etc/apache2/sites-enabled/: The directory where enabled per-site "Virtual Hosts" are stored. Typically, these are created by linking to configuration files found in thesites-availabledirectory with thea2ensite. Apache reads the configuration files and links found in this directory when it starts or reloads to compile a complete configuration./etc/apache2/conf-available/,/etc/apache2/conf-enabled/: These directories have the same relationship as thesites-availableandsites-enableddirectories, but are used to store configuration fragments that do not belong in a Virtual Host. Files in theconf-availabledirectory can be enabled with thea2enconfcommand and disabled with thea2disconfcommand./etc/apache2/mods-available/,/etc/apache2/mods-enabled/: These directories contain the available and enabled modules, respectively. Files in ending in.loadcontain fragments to load specific modules, while files ending in.confcontain the configuration for those modules. Modules can be enabled and disabled using thea2enmodanda2dismodcommand.
Server Logs
/var/log/apache2/access.log: By default, every request to your web server is recorded in this log file unless Apache is configured to do otherwise./var/log/apache2/error.log: By default, all errors are recorded in this file. TheLogLeveldirective in the Apache configuration specifies how much detail the error logs will contain.
