Detailed description of the main directory and configuration file of the Apache service

Source: Internet
Author: User
Tags builtin egrep
Details of the main directory and configuration file of the Apache service 19:05:14 tags: httpd configuration file DETAILS Apache configuration file httpd configuration file Apache file directory original works, can be reproduced, during reprinting, you must mark the original source, author information, and statement in the form of a hyperlink. Otherwise, legal liability will be held. Http://731434.blog.51cto.com/721434/1351637

Detailed description of the main directory and configuration file of the Apache service

1. Notes of Apache configuration files

/Application/Apache/CONF/httpd. conf # Main Apache configuration file

As the installation directory I developed is/application, my configuration file is in/application/Apache/CONF/httpd. conf. If rpm and Yum are installed, your directory is in/etc/httpd by default. conf

 

[[Email protected] conf] # egrep-V "^. * # | ^ $" httpd. conf | NL # Remove comments and space lines

1 serverroot "/application/apache2.2.22" # Apache root directory, which can only be accessed by root

2 listen 80 # default listening port 80 of the Apache service if you want to listen to multiple ports at the same time, you can add the following line: Listen 81

3 <ifmodule! Mpm_netware_module>

4 <ifmodule! Mpm_winnt_module>

5 user daemon # Apache user. The default value is daemon.

6. Group daemon # Apache user. The default value is daemon.

7 </ifmodule>

8 </ifmodule>

9 serveradmin [email protected] # System Administrator email address. If any problem occurs, it will be displayed on the homepage.

10 DocumentRoot "/application/apache2.2.22/htdocs" # default Apache Web site directory path. Do not add a slash at the end

11 <directory/> #11-16 Behavior restrictions on the root directory

12 options followsymlinks # followsymlinks indicates that symbolic links are allowed. The default value is disabled.

13 AllowOverride none # indicates that you are prohibited from modifying the directory configuration file (. htaccess ).

14 order deny and allow # Give priority to deny requests. If no explicit description is provided, all requests are rejected. That is, access requests that are not explicitly rejected are allowed (from the back to the back ).

15 deny from all # explicitly deny all access

16 </directory>

17 <directory "/application/apache2.2.22/htdocs"> #17-22 behavior default configuration of the Apache default site directory (if the configured site does not exist, error 403 is displayed)

18 options indexes followsymlinks # followsymlinks do not use the symbolic link indexes to allow users to browse directories.

Options-indexes followsymlinks or options followsymlinks indicates canceling directory browsing.

19 AllowOverride none # indicates that you are prohibited from modifying the directory configuration file (. htaccess ).

20 order allow, deny # priority should be given to allow. If it is not explicitly stated that the request is allowed, the rejection is not explicitly allowed.

21 allow from all # Allow all access

22 </directory>

23 <ifmodule dir_module>

24 directoryindex index.html # configure the default Apache homepage file. If the file is not configured in the VM, apply the configuration here. Multiple files are separated by spaces.

25 </ifmodule>

26 <filesmatch "^ \. ht"> # prevent important hidden files such as. htaccess and. htpasswd from being viewed by web users

27 order allow, deny

28 deny from all

29 satisfy all

30 </filesmatch>

31 errorlog "logs/error_log" # The Error Log Path logs is the relative path of the Apache service installation directory

32 loglevel warn

33 <ifmodule log_config_module>

34 logformat "% H % L % u % t \" % R \ "%> S % B \" % {Referer} I \ "\" % {User-Agent} I \ "" combined # access log format

35 logformat "% H % L % u % t \" % R \ "%> S % B" common # access common log format

36 <ifmodule logio_module>

37 logformat "% H % L % u % t \" % R \ "%> S % B \" % {Referer} I \ "\" % {User-Agent} I \ "% I % O" combinedio

38 </ifmodule>

39 customlog "logs/access_log" common # default site access log Configuration

40 </ifmodule>

41 <ifmodule alias_module> #41-51 CGI configuration. you can comment out and delete the configuration without special requirements. At present, the configuration has been eliminated.

42 ScriptAlias/cgi-bin/"/application/apache2.2.22/cgi-bin /"

43 </ifmodule>

44 <ifmodule cgid_module>

45 </ifmodule>

46 <directory "/application/apache2.2.22/cgi-bin">

47 AllowOverride none

48 options none

49 order allow, deny

50 allow from all

51 </directory>

52 defaulttype text/plain # default MIME type provided by the server when the mime ulttype definition cannot determine the MIME type. if the service mainly contains text or HTML documents, "text/plain" is the best choice

53 <ifmodule mime_module>

54 typesconfig CONF/mime. Types

55 addtype application/X-compress. Z # addencoding allows you to extract information using maxaic/X 2.1 + in information transmission (not all browsers supported)

56 addtype application/X-gzip. GZ. tgz

57 </ifmodule>

58 <ifmodule ssl_module>

59 sslrandomseed startup builtin

60 sslrandomseed connect builtin

61 </ifmodule>

 

Ii. Apache Extension Configuration File

/Application/Apache/CONF/extra # Apache Extension Configuration File

[[Email protected] extra] # ll

Total 56

-RW-r -- 1 Root 2859 Jan 10 httpd-autoindex.conf

-RW-r -- 1 Root 1753 Jan 10 httpd-dav.conf

-RW-r -- 1 Root 2344 Jan 10 httpd-default.conf

-RW-r -- 1 Root 1103 Jan 10 httpd-info.conf

-RW-r -- 1 Root 5078 Jan 10 httpd-languages.conf

-RW-r -- 1 Root 932 Jan 10 httpd-manual.conf

-RW-r -- 1 Root 3789 Jan 10 httpd-mpm.conf

-RW-r -- 1 Root 2207 Jan 10 httpd-multilang-errordoc.conf

-RW-r -- 1 Root 11185 Jan 10 httpd-ssl.conf

-RW-r -- 1 Root 817 Jan 10 httpd-userdir.conf

-RW-r -- 1 Root 1507 Jan 10 httpd-vhosts.conf # VM configuration file

 

3. httpd-vhosts.conf virtual host configuration file comment

[[Email protected] extra] # egrep-V "^. * # | ^$" httpd-vhosts.conf | NL

1 namevirtualhost *: 80 # name-based virtual host configuration (*: 80 indicates listening to all IP addresses of the local host)

2 <virtualhost *: 80> # define a virtual host

3 serveradmin [email protected] # configure the Administrator email address

4 DocumentRoot "/application/apache2.2.22/docs/dummy-host.example.com" # Program site directory

5 servername dummy-host.example.com # Domain Name Service, need Apache mode_alias module support

6 serveralias www.dummy-host.example.com # virtual host alias

7 errorlog "logs/dummy-host.example.com-error_log" # Error Log Path

8 customlog "logs/dummy-host.example.com-access_log" common # access log configuration (we use the combined format to replace the common format in the production environment)

9 </virtualhost>

10 <virtualhost *: 80>

11 serveradmin [email protected]

12 DocumentRoot "/application/apache2.2.22/docs/dummy-host2.example.com"

13 servername dummy-host2.example.com

14 errorlog "log/dummy-host2.example.com-error_log"

15 customlog "logs/dummy-host2.example.com-access_log" common

16 </virtualhost>

 

4. directory where the apache service stores the site

/Application/Apache/htdocs # path for storing web pages by default. Enter the IP address to this directory to see it's wroks! This is the Directory

[[Email protected] htdocs] # less index.html

<HTML> <body>

 

 

V. Description of APACHE service directory structure

[[Email protected] htdocs] # ls/application/Apache/

Bin build cgi-bin conf error htdocs icons include lib logs man manual modules

Bin Startup File directory description

| -- Bin # command directory of the Apache service

| -- AB # HTTP Service Performance Testing Tool

| -- Apachectl # Apache startup command

| -- Apr-1-config

| -- Apu-1-config

| -- Apxs # tools used to compile and install the extension module for HTTP service, used in DSO module Compilation

| -- Checkgid

| -- Dbmmanage

| -- Envvars

| -- Envvars-STD

| -- Htcacheclean # disk buffer cleanup control command

| -- Htdbm

| -- Htdigest

| -- Htpasswd # create and update Basic Authentication Files

| -- Httpd # httpd is an Apache control command program

| -- Httxt2dbm

| -- Logresolve

| -- Rotatelogs # daily polling Command provided by Apache (many cronolog production environments are used ).

 

Conf configuration file directory

[[Email protected] htdocs] # ls/application/Apache/CONF/

Extra httpd. conf magic mime. types original

/Application/Apache/CONF/# configure all the configuration file directories in Apache

| -- Extra # additional Apache configuration file directories such as: httpd-vhost.conf

| -- Httpd-autoindex.conf

| -- Httpd-dav.conf

| -- Httpd-default.conf

| -- Httpd-info.conf

| -- Httpd-languages.conf

| -- Httpd-manual.conf

| -- Httpd-mpm.conf

| -- Httpd-multilang-errordoc.conf

| -- Httpd-ssl.conf

| -- Httpd-userdir.conf

| -- Httpd-vhosts.conf

| -- Httpd. conf # Apache main configuration file

| -- Magic

| -- Mime. Types

| -- Original

| -- Extra

| -- Httpd-autoindex.conf

| -- Httpd-dav.conf # Dav supports Configuration

| -- Httpd-default.conf # This file is configured with Apache related service parameters: timeout time, keep Link

| -- Httpd-info.conf

| -- Httpd-languages.conf # Language Support

| -- Httpd-manual.conf

| -- Httpd-mpm.conf # server pool management, is also a configuration file to optimize Apache (APACHE mode and the number of configuration links, the common mode is worker mode and profork mode, the default porfork)

| -- Httpd-multilang-errordoc.conf

| -- Httpd-ssl.conf # provides Apache SSL support configuration files

| -- Httpd-userdir.conf

| -- Httpd-vhosts.conf # virtual machine configuration file

| -- Httpd. conf

 

Site storage directory

[[Email protected] Apache] # ls-l htdocs/# The default homepage files are stored in this directory.

Total 4

-RW-r -- 1 Root 44 Nov 21 2004 index.html

 

Log storage directory

[[Email protected] Apache] # tree logs

Logs # default Log Path of the Apache service, including error logs and access logs

| -- Access_log # apache service access log tail-F command to view webpage user access information

| -- Cgisock.16406

| -- Error_log # error log of the Apache service. For example, APACHE service startup failure

| -- Httpd. pid # PID file of httpd. After the HTTP process is started, the idnumber of all processes is written to this file.

 

Module Directory

[[Email protected] Apache] # ls-L manual/# Apache Module Directory such as PHP mencache

Total 2984

-RW-r -- 1 Root 543 May 6 2008 bind.html

-RW-r -- 1 Root 11422 Jan 3 2012 bind.html.de

Detailed description of the main directory and configuration file of the Apache service

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.