Apache: Difference between revisions

From Piszczynski
piszczynski>Aleks
piszczynski>Aleks
Line 1: Line 1:


== Apache web server details ==
== Apache web server details ==
 
[https://www.digitalocean.com/community/tutorials/how-to-configure-the-apache-web-server-on-an-ubuntu-or-debian-vps Ref]
main directory: /etc/apache2
main directory: /etc/apache2



Revision as of 00:17, 7 November 2023

Apache web server details

Ref main directory: /etc/apache2

There are a number of plaintext files and some subdirectories within this directory. Here are some useful locations to be familiar with:

  • apache2.conf:

This is the main configuration file for the server. Almost all configuration can be done from within this file, although it is recommended to use separate, designated files for simplicity. This file will configure defaults and be the central point of access for the server to read configuration details.

  • ports.conf:

This file is used to specify the ports that virtual hosts should listen on. Be sure to check that this file is correct if you are configuring SSL.

  • sites-available/ and sites-enabled/:

The sites-available directory contains virtual host file configurations. Configurations within this folder will establish which content gets served for which requests. This is enabled through linking to the sites-enabled directory, which stores activated virtual host configuration files. When Apache starts or reloads, it reads the configuration files and links from within the sites-enabled directory as it compiles a full configuration.

  • conf-available/ and conf-enabled/:

These directories house configuration fragments that are unattached to the virtual host configurations files.

  • mods-enabled/ and mods-available/:

These directories define modules that can be optionally loaded. The directories contain two components: files ending in .load, which contain fragments that load particular modules, and files ending in .conf, which store the configurations of these modules. Apache configuration does not take place in a single monolithic file, but instead happens through a modular design where new files can be added and modified as needed.

Apache2.conf file

  • /etc/apache2/apache2.conf

The main configuration details for your Apache server are held in the /etc/apache2/apache2.conf file. This file is divided into three main sections:

  • Configuration for the global Apache server process
  • Configuration for the default server
  • Configuration of virtual hosts.

Virtual Host File

  • /etc/apache2/sites-available/000-default.conf

Contains the configuration for the virtual hosts and what ports they will respond to. The default is set to respond on port 80 on any interface