<span id="ArticleContent1_ArticleContent1_lblContent">ServerRoot /Apache<br>#可以用绝对路径 e:webapache<br>#ServerRoot用于指定守护进程httpd的运行目录,httpd在启动之后将自动将进程的当前目录改变为这个目录,因此如果设置文件中指定的文件或目录是相对路径,那么真实路径就位于这个ServerRoot定义的路径之下。<br>PidFile logs/httpd.pid<br>#PidFile指定的文件将记录httpd守护进程的进程号,由于httpd能自动复制其自身,因此系统中有多个httpd进程,但只有一个进程为最初启动的进程,它为其他进程的父进程,对这个进程发送信号将影响所有的httpd进程。PidFILE定义的文件中就记录httpd父进程的进程号<br>Timeout 300<br>#Timeout定义客户程序和服务器连接的超时间隔,超过这个时间间隔(秒)后服务器将断开与客户机的连接.<br>KeepAlive On<br>#在HTTP 1.0中,一次连接只能作传输一次HTTP请求,而KeepAlive参数用于支持HTTP 1.1版本的一次连接、多次传输功能,这样就可以在一次连接中传递多个HTTP请求。虽然只有较新的浏览器才支持这个功能,但还是打开使用这个选项<br>MaxKeepAliveRequests 100<br>#MaxKeepAliveRequests为一次连接可以进行的HTTP请求的最大请求次数。将其值设为0将支持在一次连接内进行无限次的传输请求。事实上没有客户程序在一次连接中请求太多的页面,通常达不到这个上限就完成连接了。<br>KeepAliveTimeout 15<br>#KeepAliveTimeout测试一次连接中的多次请求传输之间的时间,如果服务器已经完成了一次请求,但一直没有接收到客户程序的下一次请求,在间隔超过了这个参数设置的值之后,服务器就断开连接。<br>&lt;IfModule mpm_winnt.c><br>ThreadsPerChild 250<br>MaxRequestsPerChild 0<br>&lt;/IfModule><br>Listen 80<br>#端口,启动模块.下面许多模块只有在LIUNX下才有用<br>LoadModule access_module modules/mod_access.so<br>LoadModule actions_module modules/mod_actions.so<br>LoadModule alias_module modules/mod_alias.so<br>LoadModule asis_module modules/mod_asis.so<br>LoadModule auth_module modules/mod_auth.so<br>LoadModule dir_module modules/mod_dir.so<br>LoadModule cgi_module modules/mod_cgi.so<br>LoadModule mime_module modules/mod_mime.so<br>LoadModule log_config_module modules/mod_log_config.so<br>LoadModule autoindex_module modules/mod_autoindex.so<br>LoadModule negotiation_module modules/mod_negotiation.so<br>LoadModule setenvif_module modules/mod_setenvif.so<br>#LoadModule cern_meta_module modules/mod_cern_meta.so<br>#LoadModule env_module modules/mod_env.so<br>#LoadModule expires_module modules/mod_expires.so<br>#LoadModule file_cache_module modules/mod_file_cache.so<br>#LoadModule headers_module modules/mod_headers.so<br>#LoadModule imap_module modules/mod_imap.so<br>#LoadModule auth_anon_module modules/mod_auth_anon.so<br>#LoadModule auth_dbm_module modules/mod_auth_dbm.so<br>#LoadModule auth_digest_module modules/mod_auth_digest.so<br>#LoadModule dav_module modules/mod_dav.so<br>#LoadModule dav_fs_module modules/mod_dav_fs.so<br>#LoadModule include_module modules/mod_include.so<br>#LoadModule info_module modules/mod_info.so<br>#LoadModule isapi_module modules/mod_isapi.so<br>#LoadModule mime_magic_module modules/mod_mime_magic.so<br>#LoadModule proxy_module modules/mod_proxy.so<br>#LoadModule proxy_connect_module modules/mod_proxy_connect.so<br>#LoadModule proxy_http_module modules/mod_proxy_http.so<br>#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so<br>#LoadModule speling_module modules/mod_speling.so<br>#LoadModule status_module modules/mod_status.so<br>#LoadModule unique_id_module modules/mod_unique_id.so<br>#LoadModule usertrack_module modules/mod_usertrack.so<br>#LoadModule ssl_module modules/mod_ssl.so<br>#LoadModule vhost_alias_module modules/mod_vhost_alias.so<br>#LoadModule userdir_module modules/mod_userdir.so<br>LoadModule rewrite_module modules/mod_rewrite.so<br>#ExtendedStatus On<br>ServerAdmin <u>abc@123.com</u><br>#服务器管理员邮箱,在出错,探针中显示<br>ServerName localhost.domain.com<br>UseCanonicalName Off<br>#是否允许对每个访问者的 DNS 域名的反向查询<br>DocumentRoot /Apache<br>#放网页的目录.这个很重要.<br>#你设置了,e:web是目录 而虚拟主机设置了e:webtwo<br>#虽然程序还是能运行,但是不在documentroot内的话,程序会有错误<br>&lt;Directory /><br>Options FollowSymLinks MultiViews ExecCGI<br>AllowOverride None<br>&lt;/Directory><br>&lt;Directory /Apache/><br>Options FollowSymLinks MultiViews ExecCGI<br>AllowOverride None<br>Order allow,deny<br>php_admin_value open_basedir /apache/<br>Allow from all<br>&lt;/Directory><br>#以下是关于用户目录配置部分,即用户可以用<u>http://www.xxxx.com/~username</u>的方式来访问自已的网站!<br>#UserDir /apache/webroot/aaausersfreehost/*/public_html<br>#&lt;Directory e:/虚拟主机/*/public_html><br># AllowOverride None<br># Options MultiViews SymLinksIfOwnerMatch IncludesNoExec ExecCGI<br>#下面这条指令定义php只能对public_html此目录及其子目录下的文件进行操作.<br># php_flag engine off #表示此目录下的PHP文件不被解释执行,限没有PHP权限。 <br># php_admin_value open_basedir ./<br># Order allow,deny<br># Allow from all<br>#&lt;/Directory><br>#下面这条指令可以把虚拟目录freehost映射到实际路径/apache/webroot/users/下!<br>#AliasMatch ^/class/([0-9]).html$ /article.php?articleid=$1<br>#AliasMatch ^/class/([0-9] ).([0-9a-zA-Z] ).html$ /article.php?articleid=$1&amp;pagenum=$2<br>DirectoryIndex index.html index.htm index.php index.cgi bbs.pl index.pl admin.php login.htm login.html login.php<br>#默然主机头<br>AccessFileName .htaccess<br>&lt;Files ~ ^.ht><br>Order allow,deny<br>Deny from all<br>&lt;/Files><br>TypesConfig conf/mime.types<br>DefaultType text/plain<br>&lt;IfModule mod_mime_magic.c><br>MIMEMagicFile conf/magic<br>&lt;/IfModule><br>#以下是限制主机同时并发连接数<br>#&lt;IfModule prefork.c> <br>#ServerLimit 2000 <br>#StartServers 15 <br>#MinSpareServers 15 <br>#MaxSpareServers 20 <br>#MaxClients 850 #最大客户端<br>#MaxRequestsPerChild 10000 #最大请求数<br>#&lt;/IfModule><br>#以下是对单个文件进行访问控制<br>#&lt;Files ~ 要屏蔽的文件的名称> <br>#Order allow,deny <br>#Allow from 允许IP <br>#Deny from all <br>#&lt;/Files><br>HostnameLookups Off<br>#EnableMMAP off<br>#EnableSendfile off<br>ErrorLog logs/error.log<br>LogLevel warn<br>LogFormat 镲?? ?痋飁ferer}i 飐er-Agent}i combined<br>LogFormat 镲?? ??common<br>LogFormat 飁ferer}i -> ?referer<br>LogFormat 飐er-agent}i agent<br>CustomLog logs/access.log common<br>#CustomLog logs/referer.log referer<br>#CustomLog logs/agent.log agent<br>#CustomLog logs/access.log combined<br>ServerTokens Full<br>ServerSignature Off<br>#当客户请求的网页并不存在时,服务器将产生错误文档,缺省情况下由于打开了 ServerSignature选项,错误文档的最后一行将包含服务器的名字、Apache的版本等信息。<br>#Alias /class/ /apache/webroot/phpa #虚拟目录啦<br># &lt;Directory /apache/phpsafe> #对虚拟目录进行权限配置<br># Options FollowSymLinks # MultiViews ExecCGI为有CGI执行权限<br># php_admin_value safe_mode 1 #表示此目录下的PHP脚本只能有php_safe下权限<br># php_admin_value open_basedir /apache/phpsafe/ <br># 此句是限制PHP的文件操作只能限于/apache/phpsafe及其子目录下,不能对此目录外的文进行操作<br># php_flag engine off <br>#表示此目录下的PHP脚本不会被解释执行,此选项要求PHP必须以模块方式安装的!<br># AllowOverride None<br># Order allow,deny<br># Allow from all #表示允许任何人从任何地方访问<br># &lt;/Directory><br>#ScriptAlias /cgi-bin/ E:/Apache2/cgi-bin/<br>#&lt;Directory E:/Apache2/cgi-bin><br># AllowOverride None<br># Options None<br># Order allow,deny<br># Allow from all<br>#&lt;/Directory><br>IndexOptions FancyIndexing VersionSort<br>#AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip<br>#AddIconByType (TXT,/icons/text.gif) text/*<br>#AddIconByType (IMG,/icons/image2.gif) image/*<br>#AddIconByType (SND,/icons/sound2.gif) audio/*<br>#AddIconByType (VID,/icons/movie.gif) video/*<br>#AddIcon /icons/binary.gif .bin .exe<br>#AddIcon /icons/binhex.gif .hqx<br>#AddIcon /icons/tar.gif .tar<br>#AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv<br>#AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip<br>#AddIcon /icons/a.gif .ps .ai .eps<br>#AddIcon /icons/layout.gif .html .shtml .htm .pdf<br>#AddIcon /icons/text.gif .txt<br>#AddIcon /icons/c.gif .c<br>#AddIcon /icons/p.gif .pl .py<br>#AddIcon /icons/f.gif .for<br>#AddIcon /icons/dvi.gif .dvi<br>#AddIcon /icons/uuencoded.gif .uu<br>#AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl<br>#AddIcon /icons/tex.gif .tex<br>#AddIcon /icons/bomb.gif core<br>#AddIcon /icons/back.gif ..<br>#AddIcon /icons/hand.right.gif README<br>#AddIcon /icons/folder.gif ^^DIRECTORY^^<br>#AddIcon /icons/blank.gif ^^BLANKICON^^<br>#DefaultIcon /icons/unknown.gif<br>AddDescription GZIP compressed document .gz<br>AddDescription tar archive .tar<br>AddDescription GZIP compressed tar archive .tgz<br>ReadmeName README.html<br>HeaderName HEADER.html<br>IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t<br>AddEncoding x-compress Z<br>AddEncoding x-gzip gz tgz<br>AddLanguage ca .ca<br>AddLanguage cs .cz .cs<br>AddLanguage da .dk<br>AddLanguage de .de<br>AddLanguage el .el<br>AddLanguage en .en<br>AddLanguage eo .eo<br>AddLanguage es .es<br>AddLanguage et .et<br>AddLanguage fr .fr<br>AddLanguage he .he<br>AddLanguage hr .hr<br>AddLanguage it .it<br>AddLanguage ja .ja<br>AddLanguage ko .ko<br>AddLanguage ltz .ltz<br>AddLanguage nl .nl<br>AddLanguage nn .nn<br>AddLanguage no .no<br>AddLanguage pl .po<br>AddLanguage pt .pt<br>AddLanguage pt-BR .pt-br<br>AddLanguage ru .ru<br>AddLanguage sv .sv<br>AddLanguage zh-CN .zh-cn<br>AddLanguage zh-TW .zh-tw<br>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<br>ForceLanguagePriority Prefer Fallback<br>#AddDefaultCharset ISO-8859-1<br>AddDefaultCharset GB2312<br>AddCharset ISO-8859-1 .iso8859-1 .latin1<br>AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen<br>AddCharset ISO-8859-3 .iso8859-3 .latin3<br>AddCharset ISO-8859-4 .iso8859-4 .latin4<br>AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru<br>AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb<br>AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk<br>AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb<br>AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk<br>AddCharset ISO-2022-JP .iso2022-jp .jis<br>AddCharset ISO-2022-KR .iso2022-kr .kis<br>AddCharset ISO-2022-CN .iso2022-cn .cis<br>AddCharset Big5 .Big5 .big5<br># For russian, more than one charset is used (depends on client, mostly):<br>AddCharset WINDOWS-1251 .cp-1251 .win-1251<br>AddCharset CP866 .cp866<br>AddCharset KOI8-r .koi8-r .koi8-ru<br>AddCharset KOI8-ru .koi8-uk .ua<br>AddCharset ISO-10646-UCS-2 .ucs2<br>AddCharset ISO-10646-UCS-4 .ucs4<br>AddCharset UTF-8 .utf8<br>AddCharset GB2312 .gb2312 .gb <br>AddCharset utf-7 .utf7<br>AddCharset utf-8 .utf8<br>AddCharset big5 .big5 .b5<br>AddCharset EUC-TW .euc-tw<br>AddCharset EUC-JP .euc-jp<br>AddCharset EUC-KR .euc-kr<br>AddCharset shift_jis .sjis<br>#以CGI方式安装PHP<br>#ScriptAlias /__php_dir__/ /apache/cgiphp5/<br>#AddType application/x-httpd-php .php4 .php .htm .php3 .inc .fire<br>#Action application/x-httpd-php /__php_dir__/php.exe<br>#以apache的模块方式运行php<br>LoadModule php4_module /apache/php/sapi/php4apache.dll<br>PHPINIDir /apache/php/php.ini<br>AddType application/x-httpd-php .php .htm .php3<br>AddType application/x-httpd-php-source .phps<br>#支持fcgi<br>#LoadModule fastcgi_module modules/mod_fastcgi.dll <br>#AddHandler fastcgi-script .fcgi .fpl<br>AddType application/x-tar .tgz<br>#AddEncoding x-compress .Z<br>#AddEncoding x-gzip .gz .tgz<br>AddType application/x-compress .Z<br>AddType application/x-gzip .gz .tgz<br>AddHandler cgi-script .cgi .pl<br>#AddHandler send-as-is asis<br>#AddHandler imap-file map<br>AddHandler type-map var<br>#AddType text/html .shtml<br>#AddOutputFilter INCLUDES .shtml<br>#ErrorDocument 500 The server made a boo boo.<br>#ErrorDocument 404 /apache/yyfzx/soft<br>#ErrorDocument 404 /apache/yyfzx/soft<br>#ErrorDocument 402 <u>http://www.example.com/subscription_info.html</u><br>BrowserMatch Mozilla/2 nokeepalive<br>BrowserMatch MSIE 4.0b2; nokeepalive downgrade-1.0 force-response-1.0<br>BrowserMatch RealPlayer 4.0 force-response-1.0<br>BrowserMatch Java/1.0 force-response-1.0<br>BrowserMatch JDK/1.0 force-response-1.0<br>BrowserMatch Microsoft Data Access Internet Publishing Provider redirect-carefully<br>BrowserMatch ^WebDrive redirect-carefully<br>BrowserMatch ^WebDAVFS/1.[012] redirect-carefully<br>BrowserMatch ^gnome-vfs redirect-carefully<br>#&lt;Location /server-status><br># SetHandler server-status<br># Order deny,allow<br># Deny from all<br># Allow from .51web.net<br>#&lt;/Location><br>#&lt;Location /server-info><br># SetHandler server-info<br># Order deny,allow<br># Deny from all<br># Allow from .51web.net<br>#&lt;/Location><br>&lt;IfModule mod_ssl.c><br>Include conf/ssl.conf<br>&lt;/IfModule><br>#以下是关于虚拟机的配置<br>NameVirtualHost 218.87.169.209:80<br>&lt;VirtualHost 218.87.169.209:80> <br>RewriteEngine On<br>RewriteRule ^/index.htm$ /index.php<br>RewriteRule ^/soft/([0-9] ).htm$ /download.php?soft=$1<br>RewriteRule ^/sort/([0-9-_] ).htm$ /list.php?list=$1<br>RewriteRule ^/sort/index.htm$ /type.php<br>RewriteRule ^/a-z/([0-9] ).htm$ /az.php?id=$1<br>DocumentRoot /apache/mayidown<br>ServerName mayidown.3322.org<br>&lt;/VirtualHost><br>//以 #开头的就是解释用.启动的时候不加载的.我提供了一个虚拟主机给大家参考重写URL功能</span> <p style="width:100%;text-align:center;margin:10px 0"> <br> <br> </p> <p style="width:100%;text-align:center;margin:10px 0"> </p> <p class="clear"></p>