The Apache configuration on Ubuntu Linux is stored in the /etc/apache2
directory. This directory contains a number of files and subdirectories that control the behavior of the Apache web server.
Here are some of the main configuration files and directories in the /etc/apache2
directory:
apache2.conf
: This is the main configuration file for the Apache web server. It sets global configuration options, such as the server's root directory and the number of worker processes.
ports.conf
: This file defines the port numbers that the Apache web server listens on. By default, Apache listens on port 80 for HTTP traffic and port 443 for HTTPS traffic.
sites-available
: This directory contains configuration files for individual websites or virtual hosts. To enable a website, a configuration file must be created in this directory and then symlinked to the sites-enabled
directory.
sites-enabled
: This directory contains symlinks to the configuration files in the sites-available
directory. Websites that are enabled (i.e. available to users) have a symlink in this directory.
mods-available
: This directory contains configuration files for Apache modules. To enable a module, a configuration file must be created in this directory and then symlinked to the mods-enabled
directory.
mods-enabled
: This directory contains symlinks to the configuration files in the mods-available
directory. Modules that are enabled have a symlink in this directory.
To configure the Apache web server on Ubuntu Linux, you can edit the relevant configuration files in the /etc/apache2
directory. It is important to be careful when editing these files, as a syntax error or incorrect configuration can cause the web server to fail. It is always a good idea to make a backup of the configuration files before making any changes.