Apache configuration file description

Source: Internet
Author: User
Apache configuration file description-Linux Enterprise Application-Linux server application information. For details, refer to the following section. In Debian, after the installation is complete, the configuration file provided by the software package is located in the/etc/apache2 directory:

Tony @ tonybox:/etc/apache2 $ ls-l
Total 72
-Rw-r -- 1 root 12482 apache2.conf
Drwxr-xr-x 2 root 4096 conf. d
-Rw-r -- 1 root 748 envvars
-Rw-r -- 1 root 268 httpd. conf
-Rw-r -- 1 root 12441 magic
Drwxr-xr-x 2 root 4096 mod-available
Drwxr-xr-x 2 root 4096 mod-enabled
-Rw-r -- 1 root 10 ports. conf
-Rw-r -- 1 root 2266 README
Drwxr-xr-x 2 root 4096 sites-available
Drwxr-xr-x 2 root 4096 sites-enabled
Drwxr-xr-x 2 root 4096 ssl

Where

Apache2.conf

For the main configuration file of The apache2 server, view this configuration file, you will find the following content

# Include module configuration:
Include/etc/apache2/mod-enabled/*. load
Include/etc/apache2/mod-enabled/*. conf

# Include all the user invocations:
Include/etc/apache2/httpd. conf

# Include ports listing
Include/etc/apache2/ports. conf

# Include generic snippets of statements
Include/etc/apache2/conf. d/[^. #] *

It can be seen that apache2 separates the configuration files based on different configuration functions, which is more conducive to management.

Conf. d

Is an additional part of the configuration file. By default, only charset fragments are provided,

Tony @ tonybox:/etc/apache2/conf. d $ cat charset
Adddefacharcharset UTF-8

If necessary, we can change the default encoding to GB2312, that is, the file content is: AddDefaultCharset GB2312

Httpd. conf

Is an empty file

Magic

The file contains data about the mod_mime_magic module, which generally does not need to be modified.

Ports. conf

The configuration file set for the server listening IP address and port,

Tony @ tonybox:/etc/apache2 $ cat ports. conf
Listen 80

Mod-available

The directory contains some. conf and. load file, which can be used in the system to load configuration files of various modules, while the directory of the mod-enabled is a symbolic connection to these configuration files, as shown in the configuration file apache2.conf, the system loads the module through the directory named "mod-enabled". That is to say, the system only loads the module by creating the configuration file in the directory named "mod-available" with symbolic connections. The system also provides two Commands: a2enmod and a2dismod to maintain these symbolic connections. These two commands are provided by the apache2-common package. Various commands are also very simple: a2enmod [module] Or a2dismod [module]

Sites-available

The configuration file of the configured site is in the directory, and the sites-enabled directory is a symbolic connection pointing to these configuration files, the system uses these symbolic connections to connect with a digital prefix, such as 000-default, in the sites-enabled directory of the site. The smaller the number, higher startup priority. the system provides two commands, a2ensite and a2dissite, to maintain these symbolic connections. These two commands are provided by the apache2-common package.

/Var/www

By default, the web page file to be published should be placed in the/var/www directory. This default value can be modified in the same way as the DocumnetRoot option in the main configuration file.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.