PHP Apache httpd.conf Chinese detailed

Source: Internet
Author: User
Tags header http request php file sort time interval

ServerRoot "/apache"

#可以用绝对路径 E:\web\apache

#ServerRoot用于指定守护进程httpd的运行目录, httpd automatically changes the current directory of the process to this directory after it is started, so if the file or directory specified in the settings file is a relative path, the true path is under the ServerRoot defined path.

Pidfile Logs/httpd.pid

#PidFile指定的文件将记录httpd守护进程的进程号, because httpd can automatically replicate itself, there are multiple httpd processes in the system, but only one process is the first initiated process, it is the parent process for the other process, Sending a signal to this process will affect all httpd processes. The process number of the httpd parent process is recorded in the file defined by the Pidfile

Timeout 300

#Timeout定义客户程序和服务器连接的超时间隔, the server disconnects from the client after this time interval (seconds).

KeepAlive on

#在HTTP 1.0, a connection can only transmit one HTTP request at a time, and the keepalive parameter is used to support a single connection, multiple transfer features of the HTTP 1.1 version, so that multiple HTTP requests can be delivered in a single connection. Although only newer browsers support this feature, it is still open to use this option

Maxkeepaliverequests 100

#MaxKeepAliveRequests为一次连接可以进行的HTTP请求的最大请求次数. Setting its value to 0 will support an unlimited transmission request within a single connection. In fact, no client program requests too many pages in a single connection, and usually does not reach the upper limit to complete the connection.

KeepAliveTimeout 15

#KeepAliveTimeout测试一次连接中的多次请求传输之间的时间, if the server has completed a request but has not received the next request from the client, the server disconnects after the interval exceeds the value set by this parameter.

<ifmodule mpm_winnt.c>

Threadsperchild 250

Maxrequestsperchild 0

</IfModule>

Listen 80

#端口, start the module. Many of the following modules are only useful under Liunx

LoadModule Access_module modules/mod_access.so

LoadModule Actions_module modules/mod_actions.so

LoadModule Alias_module modules/mod_alias.so

LoadModule Asis_module modules/mod_asis.so

LoadModule Auth_module modules/mod_auth.so

LoadModule Dir_module modules/mod_dir.so

LoadModule Cgi_module modules/mod_cgi.so

LoadModule Mime_module modules/mod_mime.so

LoadModule Log_config_module modules/mod_log_config.so

LoadModule Autoindex_module modules/mod_autoindex.so

LoadModule Negotiation_module modules/mod_negotiation.so

LoadModule Setenvif_module modules/mod_setenvif.so

#LoadModule Cern_meta_module modules/mod_cern_meta.so

#LoadModule Env_module modules/mod_env.so

#LoadModule Expires_module modules/mod_expires.so

#LoadModule File_cache_module modules/mod_file_cache.so

#LoadModule Headers_module modules/mod_headers.so

#LoadModule Imap_module modules/mod_imap.so

#LoadModule Auth_anon_module modules/mod_auth_anon.so

#LoadModule Auth_dbm_module modules/mod_auth_dbm.so

#LoadModule Auth_digest_module modules/mod_auth_digest.so

#LoadModule Dav_module modules/mod_dav.so

#LoadModule Dav_fs_module modules/mod_dav_fs.so

#LoadModule Include_module modules/mod_include.so

#LoadModule Info_module modules/mod_info.so

#LoadModule Isapi_module modules/mod_isapi.so

#LoadModule Mime_magic_module modules/mod_mime_magic.so

#LoadModule Proxy_module modules/mod_proxy.so

#LoadModule Proxy_connect_module modules/mod_proxy_connect.so

#LoadModule Proxy_http_module modules/mod_proxy_http.so

#LoadModule Proxy_ftp_module modules/mod_proxy_ftp.so

#LoadModule Speling_module modules/mod_speling.so

#LoadModule Status_module modules/mod_status.so

#LoadModule Unique_id_module modules/mod_unique_id.so

#LoadModule Usertrack_module modules/mod_usertrack.so

#LoadModule Ssl_module modules/mod_ssl.so

#LoadModule Vhost_alias_module modules/mod_vhost_alias.so

#LoadModule Userdir_module modules/mod_userdir.so

LoadModule Rewrite_module modules/mod_rewrite.so

#ExtendedStatus on

ServerAdmin abc@123.com

#服务器管理员邮箱, in error, the probe shows

ServerName localhost.domain.com

Usecanonicalname off

Reverse query for #是否允许对每个访问者的 DNS domain name

DocumentRoot "/apache"

#放网页的目录. This is very important.

#你设置了, E:\web is a directory and the virtual host is set up E:\webtwo

#虽然程序还是能运行, but not in DocumentRoot, the program will be wrong.

<directory/>

Options followsymlinks multiviews execcgi

AllowOverride None

</Directory>

<directory "/apache/" >

Options followsymlinks multiviews execcgi

AllowOverride None

Order Allow,deny

Php_admin_value open_basedir/apache/

Allow from all

</Directory>

#以下是关于用户目录配置部分, that is, users can use the Http://www.xxxx.com/~username way to access their own web site!

#UserDir/apache/webroot/aaausersfreehost/*/public_html

#<directory e:/Virtual Host/*/public_html>

# allowoverride None

# Options MultiViews symlinksifownermatch includesnoexec execcgi

#下面这条指令定义php只能对public_html此目录及其子目录下的文件进行操作.

# Php_flag engine off #表示此目录下的PHP文件不被解释执行, no PHP permissions are restricted.

# Php_admin_value Open_basedir./

# Order Allow,deny

# Allow from all

#</directory>

#下面这条指令可以把虚拟目录freehost映射到实际路径/apache/webroot/users/!

#AliasMatch ^/class/([0-9]). html$/article.php?articleid=

#AliasMatch ^/class/([0-9]+). ([0-9a-za-z]+). \html$/article.php?articleid=&pagenum=

DirectoryIndex index.html index.htm index.php index.cgi bbs.pl index.pl admin.php login.htm login.html login.php

#默然主机头

Accessfilename. htaccess

<files ~ "^\.ht" >

Order Allow,deny

Deny from all

</Files>

Typesconfig Conf/mime.types

DefaultType Text/plain

<ifmodule mod_mime_magic.c>

Mimemagicfile Conf/magic

</IfModule>

#以下是限制主机同时并发连接数

#<ifmodule prefork.c>

#ServerLimit 2000

#StartServers 15

#MinSpareServers 15

#MaxSpareServers 20

#MaxClients 850 #最大客户端

#MaxRequestsPerChild 10000 #最大请求数

#</ifmodule>

#以下是对单个文件进行访问控制

#<files ~ "Name of the file to be masked" >

#Order Allow,deny

#Allow from Allow IP

#Deny from all

#</files>

Hostnamelookups off

#EnableMMAP off

#EnableSendfile off

ErrorLog Logs/error.log

LogLevel warn

Logformat "%h%l%u%t \%r\"%>s%b \ "%{referer}i\" \ "%{user-agent}i\" "combined

Logformat "%h%l%u%t \"%r\ "%>s%b" common

Logformat "%{referer}i->%u" Referer

Logformat "%{user-agent}i" Agent

Customlog Logs/access.log Common

#CustomLog Logs/referer.log Referer

#CustomLog Logs/agent.log Agent

#CustomLog Logs/access.log combined

Servertokens full

Serversignature off

#当客户请求的网页并不存在时, the server generates an error document, and by default the Serversignature option is turned on, and the last line of the error document contains information such as the name of the server, the version of Apache, and so on.

#Alias/class/"/APACHE/WEBROOT/PHPA" #虚拟目录啦

# <Directory/apache/phpsafe> #对虚拟目录进行权限配置

# Options FollowSymLinks #+multiviews execcgi to have CGI Execute permissions

# php_admin_value Safe_mode 1 #表示此目录下的PHP脚本只能有php_safe下权限

# Php_admin_value open_basedir/apache/phpsafe/

# This sentence is restricted to PHP file operations can only be limited to/apache/phpsafe and its subdirectories, can not operate on the text outside this directory

# Php_flag engine off

#表示此目录下的PHP脚本不会被解释执行, this option requires that PHP be installed in a modular manner!

# allowoverride None

# Order Allow,deny

# Allow from all #表示允许任何人从任何地方访问

# </Directory>

#ScriptAlias/cgi-bin/"e:/apache2/cgi-bin/"

#<directory "E:/apache2/cgi-bin" >

# allowoverride None

# Options None

# Order Allow,deny

# Allow from all

#</directory>

Indexoptions fancyindexing Versionsort

#AddIconByEncoding (cmp,/icons/compressed.gif) x-compress X-gzip

#AddIconByType (txt,/icons/text.gif) text/*

#AddIconByType (img,/icons/image2.gif) image/*

#AddIconByType (snd,/icons/sound2.gif) audio/*

#AddIconByType (vid,/icons/movie.gif) video/*

#AddIcon/icons/binary.gif. bin. exe

#AddIcon/icons/binhex.gif. hqx

#AddIcon/icons/tar.gif. Tar

#AddIcon/icons/world2.gif. wrl. wrl.gz. vrml. Vrm. IV

#AddIcon/icons/compressed.gif. Z. tgz. gz. zip

#AddIcon/icons/a.gif. ps. ai. eps

#AddIcon/icons/layout.gif. html. shtml. htm. pdf

#AddIcon/icons/text.gif. txt

#AddIcon/icons/c.gif. C

#AddIcon/icons/p.gif. pl. py

#AddIcon/icons/f.gif. For

#AddIcon/icons/dvi.gif. DVI

#AddIcon/icons/uuencoded.gif UU.

#AddIcon/icons/script.gif. Sh. Shar. csh. Ksh. tcl

#AddIcon/icons/tex.gif. Tex

#AddIcon/icons/bomb.gif Core

#AddIcon/icons/back.gif.

#AddIcon/icons/hand.right.gif README

#AddIcon/icons/folder.gif ^^ directory^^

#AddIcon/icons/blank.gif ^^ blankicon^^

#DefaultIcon/icons/unknown.gif

Adddescription "GZIP Compressed document". GZ

Adddescription "Tar archive". Tar

Adddescription "GZIP Compressed Tar archive". tgz

Readmename readme.html

Headername header.html

Indexignore.?? * *~ *# header* readme* RCS CVS *,v *,t

AddEncoding x-compress Z

AddEncoding X-gzip GZ tgz

AddLanguage ca. ca

AddLanguage CS. cz. CS

AddLanguage da. DK

AddLanguage de. de

AddLanguage el. El

AddLanguage en. en

AddLanguage EO. EO

AddLanguage es. es

AddLanguage et et.

AddLanguage Fr. fr

AddLanguage He.

AddLanguage hr. HR

AddLanguage it. it

AddLanguage ja. Ja

AddLanguage Ko Ko

AddLanguage Ltz. Ltz

AddLanguage NL. nl

AddLanguage nn. nn

AddLanguage No. No

AddLanguage Pl. po

AddLanguage Pt. PT

AddLanguage pt-br. pt-br

AddLanguage ru. ru

AddLanguage sv. sv

AddLanguage ZH-CN. ZH-CN

AddLanguage ZH-TW. zh-tw

Languagepriority ZH-CN en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-br RU SV ZH-TW

Forcelanguagepriority prefer fallback

#AddDefaultCharset iso-8859-1

Adddefaultcharset GB2312

Addcharset iso-8859-1. Iso8859-1 latin1

Addcharset iso-8859-2. iso8859-2 latin2. Cen

Addcharset iso-8859-3. iso8859-3 latin3

Addcharset iso-8859-4. Iso8859-4 latin4

Addcharset iso-8859-5. iso8859-5 latin5 Cyr. Iso-ru

Addcharset iso-8859-6. iso8859-6 latin6. Arb

Addcharset iso-8859-7. iso8859-7 latin7. Grk

Addcharset iso-8859-8. iso8859-8 latin8. Heb

Addcharset iso-8859-9. iso8859-9 latin9. trk

Addcharset iso-2022-jp. Iso2022-jp. JIS

Addcharset iso-2022-kr. Iso2022-kr Kis

Addcharset ISO-2022-CN. Iso2022-cn. CIS

Addcharset Big5. Big5. Big5

# for Russian, more than one charset are used (depends on client, mostly):

Addcharset WINDOWS-1251. cp-1251 win-1251

Addcharset CP866. cp866

Addcharset koi8-r. Koi8-r Koi8-ru

Addcharset Koi8-ru. Koi8-uk. UA

Addcharset iso-10646-ucs-2. ucs2

Addcharset iso-10646-ucs-4. Ucs4

Addcharset UTF-8. UTF8

Addcharset GB2312. gb2312. GB

Addcharset utf-7. Utf7

Addcharset utf-8. UTF8

Addcharset Big5. Big5 b5

Addcharset EUC-TW. euc-tw

Addcharset EUC-JP. euc-jp

Addcharset Euc-kr. Euc-kr

Addcharset Shift_JIS. Sjis

#以CGI方式安装PHP

#ScriptAlias "/__php_dir__/" "/apache/cgiphp5/"

#AddType application/x-httpd-php php4. php. php3. htm. Fire

#Action application/x-httpd-php "/__php_dir__/php.exe"

#以apache的模块方式运行php

LoadModule Php4_module/apache/php/sapi/php4apache.dll

Phpinidir/apache/php/php.ini

AddType application/x-httpd-php. php. htm php3

AddType Application/x-httpd-php-source. Phps

#支持fcgi

#LoadModule Fastcgi_module Modules/mod_fastcgi.dll

#AddHandler fastcgi-script fcgi FPL.

AddType Application/x-tar. tgz

#AddEncoding x-compress. Z

#AddEncoding x-gzip. gz. tgz

AddType application/x-compress. Z

AddType application/x-gzip. GZ tgz

AddHandler cgi-script. cgi. pl

#AddHandler Send-as-is ASIS

#AddHandler imap-file Map

AddHandler type-map var

#AddType text/html. shtml

#AddOutputFilter INCLUDES. shtml

#ErrorDocument "The server made a boo boo."

#ErrorDocument 404/apache/yyfzx/soft

#ErrorDocument 404 "/apache/yyfzx/soft"

#ErrorDocument 402 http://www.example.com/subscription_info.html

Browsermatch "MOZILLA/2" nokeepalive

Browsermatch "MSIE 4\.0b2;" Nokeepalive downgrade-1.0 force-response-1.0

Browsermatch "RealPlayer 4\.0" force-response-1.0

Browsermatch "java/1\.0" force-response-1.0

Browsermatch "jdk/1\.0" force-response-1.0

Browsermatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully

Browsermatch "^webdrive" redirect-carefully

Browsermatch "^WEBDAVFS/1. [012] "redirect-carefully

Browsermatch "^gnome-vfs" redirect-carefully

#<location/server-status>

# SetHandler Server-status

# Order Deny,allow

# Deny from all

# Allow from. 51web.net

#</location>

#<location/server-info>

# SetHandler Server-info

# Order Deny,allow

# Deny from all

# Allow from. 51web.net

#</location>

<ifmodule mod_ssl.c>

Include conf/ssl.conf

</IfModule>

#以下是关于虚拟机的配置

Namevirtualhost 218.87.169.209:80

<virtualhost 218.87.169.209:80>

Rewriteengine on

Rewriterule ^/index.htm$/index.php

Rewriterule ^/soft/([0-9]+). htm$/download.php?soft=

Rewriterule ^/sort/([0-9-_]+). htm$/list.php?list=

Rewriterule ^/sort/index.htm$/type.php

Rewriterule ^/a-z/([0-9]+). htm$/az.php?id=

Documentroot/apache/mayidown

ServerName mayidown.3322.org

</VirtualHost>

To #开头的就是解释用. does not load when starting. I have provided a virtual host for you to refer to the rewrite URL function

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.