ServerRoot /Apache
#可以用绝对路径 e:webapache
#ServerRoot用于指定守护进程httpd的运行目录,httpd在启动之后将自动将进程的当前目录改变为这个目录,因此如果设置文件中指定的文件或目录是相对路径,那么真实路径就位于这个ServerRoot定义的路径之下。
PidFile logs/httpd.pid
#PidFile指定的文件将记录httpd守护进程的进程号,由于httpd能自动复制其自身,因此系统中有多个httpd进程,但只有一个进程为最初启动的进程,它为其他进程的父进程,对这个进程发送信号将影响所有的httpd进程。PidFILE定义的文件中就记录httpd父进程的进程号
Timeout 300
#Timeout定义客户程序和服务器连接的超时间隔,超过这个时间间隔(秒)后服务器将断开与客户机的连接.
KeepAlive On
#在HTTP 1.0中,一次连接只能作传输一次HTTP请求,而KeepAlive参数用于支持HTTP 1.1版本的一次连接、多次传输功能,这样就可以在一次连接中传递多个HTTP请求。虽然只有较新的浏览器才支持这个功能,但还是打开使用这个选项
MaxKeepAliveRequests 100
#MaxKeepAliveRequests为一次连接可以进行的HTTP请求的最大请求次数。将其值设为0将支持在一次连接内进行无限次的传输请求。事实上没有客户程序在一次连接中请求太多的页面,通常达不到这个上限就完成连接了。
KeepAliveTimeout 15
#KeepAliveTimeout测试一次连接中的多次请求传输之间的时间,如果服务器已经完成了一次请求,但一直没有接收到客户程序的下一次请求,在间隔超过了这个参数设置的值之后,服务器就断开连接。
<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild 0
</IfModule>
Listen 80
#端口,启动模块.下面许多模块只有在LIUNX下才有用
LoadModule access_module modules/mod_access.so
#.....
LoadModule rewrite_module modules/mod_rewrite.so
#ExtendedStatus On
ServerAdmin abc@123.com
#服务器管理员邮箱,在出错,探针中显示
ServerName localhost.domain.com
UseCanonicalName Off
#是否允许对每个访问者的 DNS 域名的反向查询
DocumentRoot /Apache
#放网页的目录.这个很重要.
#你设置了,e:web是目录 而虚拟主机设置了e:webtwo
#虽然程序还是能运行,但是不在documentroot内的话,程序会有错误
<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>
#以下是关于用户目录配置部分,即用户可以用http://www.xxxx.com/~username的方式来访问自已的网站!
#UserDir /apache/webroot/aaausersfreehost/*/public_html
#<Directory e:/虚拟主机/*/public_html>
# AllowOverride None
# Options MultiViews SymLinksIfOwnerMatch IncludesNoExec ExecCGI
#下面这条指令定义php只能对public_html此目录及其子目录下的文件进行操作.
# php_flag engine off #表示此目录下的PHP文件不被解释执行,限没有PHP权限。
# php_admin_value open_basedir ./
# order allow,deny
# Allow from all
#</Directory>
#下面这条指令可以把虚拟目录freehost映射到实际路径/apache/webroot/users/下!
#AliasMatch ^/class/([0-9]).html$ /article.php?articleid=$1
#AliasMatch ^/class/([0-9] ).([0-9a-zA-Z] ).html$ /article.php?articleid=$1&amp;pagenum=$2
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 ~ 要屏蔽的文件的名称>
#Order allow,deny
#Allow from 允许IP
#Deny from all
#</Files>
HostnameLookups Off
#EnableMMAP off
#EnableSendfile off
ErrorLog logs/error.log
LogLevel warn
LogFormat 镲?? ?痋飁ferer}i 飐er-Agent}i combined
LogFormat 镲?? ??common
LogFormat 飁ferer}i -> ?referer
LogFormat 飐er-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
#当客户请求的网页并不存在时,服务器将产生错误文档,缺省情况下由于打开了 ServerSignature选项,错误文档的最后一行将包含服务器的名字、Apache的版本等信息。
#Alias /class/ /apache/webroot/phpa #虚拟目录啦
# <Directory /apache/phpsafe> #对虚拟目录进行权限配置
# Options FollowSymLinks # MultiViews ExecCGI为有CGI执行权限
# php_admin_value safe_mode 1 #表示此目录下的PHP脚本只能有php_safe下权限
# php_admin_value open_basedir /apache/phpsafe/
# 此句是限制PHP的文件操作只能限于/apache/phpsafe及其子目录下,不能对此目录外的文进行操作
# php_flag engine off
#表示此目录下的PHP脚本不会被解释执行,此选项要求PHP必须以模块方式安装的!
# 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
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 ......
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 Big5 .Big5 .big5
# For russian, more than one charset is used (depends on client, mostly):
AddCharset UTF-8 .utf8
AddCharset GB2312 .gb2312 .gb
AddCharset .....
#以CGI方式安装PHP
#ScriptAlias /__php_dir__/ /apache/cgiphp5/
#AddType application/x-httpd-php .php4 .php .htm .php3 .inc .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 500 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=$1
RewriteRule ^/sort/([0-9-_] ).htm$ /list.php?list=$1
RewriteRule ^/sort/index.htm$ /type.php
RewriteRule ^/a-z/([0-9] ).htm$ /az.php?id=$1
DocumentRoot /apache/mayidown
ServerName mayidown.3322.org
</VirtualHost>
//以 #开头的就是解释用.启动的时候不加载的.我提供了一个虚拟主机给大家参考重写URL功能


原创内容如转载请注明:来自 阿权的书房
收藏本文到网摘
发表评论
表情
emotemotemotemotemotemotemotemotemotemotemotemotemot
emotemotemotemotemotemotemotemotemotemotemotemot
打开HTML 打开UBB 打开表情 隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写
 

阅读推荐

服务器相关推荐

开发相关推荐

应用软件推荐