A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service
1.1 ServerRoot Configuration
"ServerRoot" is used primarily to specify the installation path for Apache, which will automatically write Apache's path when Apache is installed. When Windows is installed, the value of this option is the path to the Windows installation, and the option value is the path selected at compile time for Linux installation "
1.2 Mutex Default:logs
Mutex: Allows you to set the mutex "mutex mechanism" and the mutex file directory for several different mutex objects, or to modify the global default value
Uncomment and change the directory if the mutex is file-based and the default mutex file directory is not on the local disk or is not applicable for other reasons.
"The following command is a directory that changes the mutex object"
1.3 Listen Configuration
"Listen mainly listens to the Web service port State, the default is: 80, that is, listening to all the addresses of the 80 port, note that this can also be written as the IP address of the listening form, not write the default address: 0.0.0.0"
1.4 Dynamic Shared Object (DSO) support
"Mainly used to add Apache dynamic modules, such as the PHP support module. REDIRECT module, authentication module support, note If you need to add some module support, only the relevant module before the comment symbol cancellation. , to add a function module to Apache, remove the previous comment symbol on the line "
1.5 Apache Run User Configuration
"This option is used primarily for running users and user groups that specify Apache services, by default: Daemon,"
1.6 Apache Service default Administrator address setting
"This option mainly uses the specified Apache service administrator to notify the mailbox address, select the default value, if you have a real mailbox address can also set this value"
1.7 Apache's default service name and port settings
"This option is mainly used to specify the Apache default server name and port, and the default parameter value is set to: ServerName localhost:80"
1.8 Apache access control settings for root directory
"This option is primarily for user control of all access rights under the root directory, and the default Apache access to the root directory is access denied." We'll go back to "
1.6 Apache Default Web site root settings and access control
"The configuration file for this zone, primarily for the Apache Default Web site root settings and related access settings, default to the root directory of the Web site has access, this option is the default value"
1.9 Apache's default home page settings
"This zone file mainly sets the Apache default supported home page, the default is only supported: Index.html home, if you want to support other types of home, you need to add in this area: such as index.php support index.php type Home"
1.10 Apache about. ht File Access configuration
"This option is primarily for. ht file access control, which, by default, has access, and this zone file defaults to"
1.11 Apache about log file configuration
"This zone file is mainly for Apache default log level, default access log path, default error log path and other related settings, this option content default"
1.11 URL redirection, CGI module configuration instructions
"This zone file mainly contains some related settings such as URL redirection, aliases, script aliases, and some specific handlers, such as CGI setup instructions. Later will continue to say "
1.12 MIME media files, and related HTTP file resolution configuration instructions
"This zone file mainly contains some MIME file support, as well as adding some directives to establish a mapping relationship between a given file extension and a specific content type, such as adding a mapping to a php file extension." 】
1.13 Server Page prompt settings
"This area can be customized for access error response hints, supported in three ways: 1 plaintext, 2 local redirect 3, external redirection; also includes memory maps or" Send file system calls "can be used to distribute files and other configurations"
1.14 Apache Server Supplemental settings
"This area mainly includes: Server pool management, multi-lingual error messages, dynamic directory list form configuration, language settings, user home directories, real-time information on requests and configurations, virtual hosting, Apache Http server manuals, Distributed Authoring and versioning, multi-type default settings, Mod_ Proxy_html, which complements the supplemental configuration of HTML4/XHTML1, etc. "
1.15 Apache Server Secure connection settings
"This area is primarily about server-safe connection settings, where you use HTTPS to connect to servers, and so on."
Second, Apache extended configuration file
/application/apache/conf/extra # Apache Extended configuration file
[email protected] extra]# LL
-rw-r--r--1 root root 2859 Jan 01:49 httpd-autoindex.conf
-rw-r--r--1 root root 1753 Jan 01:49 httpd-dav.conf
-rw-r--r--1 root root 2344 Jan 01:49 httpd-default.conf
-rw-r--r--1 root root 1103 Jan 01:49 httpd-info.conf
-rw-r--r--1 root root 5078 Jan 01:49 httpd-languages.conf
-rw-r--r--1 root root 932 Jan 01:49 httpd-manual.conf
-rw-r--r--1 root root 3789 Jan 01:49 httpd-mpm.conf
-rw-r--r--1 root root 2207 Jan 01:49 httpd-multilang-errordoc.conf
-rw-r--r--1 root root 11185 Jan 01:49 httpd-ssl.conf
-rw-r--r--1 root root 817 Jan 01:49 httpd-userdir.conf
-rw-r--r--1 root root 1507 Jan 01:49 httpd-vhosts.conf # Virtual Host configuration file
Iii. httpd-vhosts.conf Virtual Host profile comments
[Email protected] extra]# egrep-v "^.*#|^$" httpd-vhosts.conf |nl
1 namevirtualhost *:80 # NAME-based virtual host configuration (*:80 indicates all IP listening on this machine)
2 <virtualhost *:80> # define a virtual host
3 ServerAdmin [email protected] # Configure admin mailbox
4 DocumentRoot "/application/apache2.2.22/docs/dummy-host.example.com" # program's Site Directory
5 ServerName dummy-host.example.com # Domain Name service, requires 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 #访问日志配置 (production environment we use combined format instead of common format)
Ten <virtualhost *:80>
ServerAdmin [email protected]
Customlog "Logs/dummy-host2.example.com-access_log" common
Iv. Directory of Apache service storage sites
/application/apache/htdocs # Default to the path of the Web page, enter the IP to this directory to see it ' s wroks! This is the directory
[email protected] htdocs]# less index.html
V. Apache Service Directory Structure description
[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 # Apache Service Command Directory
| |--AB # HTTP service performance test tool
| |--apachectl # Apache boot command
| |--APXS # HTTP service compiles and installs extension modules using the tool, which is used when the DSO mode module is compiled
| |--Htcacheclean # Control command to clean up disk buffers
| |--htpasswd # Create and update basic certification files
| |--httpd # httpd for Apache Control command Program
| --Rotatelogs # Apache comes with a Day poll command (Cronolog production environment uses more).
Conf configuration file Directory
[Email protected] htdocs]# ls/application/apache/conf/
Extra httpd.conf Magic Mime.types Original
/application/apache/conf/# Apache Configure all profile directories
|--Extra # Additional Apache configuration file directory such as: httpd-vhost.conf
|--httpd.conf # Apache master config file
| | |--httpd-autoindex.conf
| | |--httpd-dav.conf # DAV support 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 configure the number of links, common mode for worker mode and profork mode, default porfork)
| | |--httpd-multilang-errordoc.conf
| | |--httpd-ssl.conf # provides Apache SSL support configuration file
| | |--httpd-userdir.conf
| | |--httpd-vhosts.conf # Configuration file for virtual machines
Site Storage Directory
[[email protected] apache]# ls-l htdocs/# The default home file is placed in this directory.
-rw-r--r--1 root root (2004 index.html
Log storage Directory
[Email protected] apache]# tree logs
Logs # Apache service default log path, including error log and access log
|--Access_log # Apache service Access Log tail-f command to view information on Web page user access
|--error_log # Apache Service error log. Example: Apache service startup failure
|--httpd.pid # httpd pid file, when the HTTP process starts, it writes the ID number of all processes to this file
[[email protected] apache]# ls-l manual/# Apache's module directory such as PHP Mencache
-rw-r--r--1 root root 543 May 6 bind.html
-rw-r--r--1 root root 11422 Jan 3 bind.html.de
An explanation of Apache configuration file
Start building with 50+ products and up to 12 months usage for Elastic Compute Service