Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

apache配置问题

[复制链接]
linjiarong1004 发表于 2006-3-11 00:41:14 | 显示全部楼层 |阅读模式
  1. PidFile logs/httpd.pid

  2. Timeout 100

  3. KeepAlive Off

  4. MaxKeepAliveRequests 100

  5. KeepAliveTimeout 15

  6. <IfModule mpm_winnt.c>
  7. ThreadsPerChild 250
  8. MaxRequestsPerChild  0
  9. </IfModule>

  10. LoadModule access_module modules/mod_access.so
  11. LoadModule actions_module modules/mod_actions.so
  12. LoadModule alias_module modules/mod_alias.so
  13. LoadModule asis_module modules/mod_asis.so
  14. LoadModule auth_module modules/mod_auth.so
  15. LoadModule autoindex_module modules/mod_autoindex.so
  16. LoadModule cgi_module modules/mod_cgi.so
  17. LoadModule dir_module modules/mod_dir.so
  18. LoadModule env_module modules/mod_env.so
  19. LoadModule expires_module modules/mod_expires.so
  20. LoadModule headers_module modules/mod_headers.so
  21. LoadModule include_module modules/mod_include.so
  22. LoadModule info_module modules/mod_info.so
  23. LoadModule isapi_module modules/mod_isapi.so
  24. LoadModule log_config_module modules/mod_log_config.so
  25. LoadModule mime_module modules/mod_mime.so
  26. LoadModule negotiation_module modules/mod_negotiation.so
  27. LoadModule setenvif_module modules/mod_setenvif.so
  28. LoadModule rewrite_module modules/mod_rewrite.so

  29. <IfModule mod_deflate.c>
  30. AddEncoding x-compress Z
  31. AddEncoding x-gzip gz tgz
  32. DeflateCompressionLevel 9
  33. AddOutputFilterByType DEFLATE text/html text/plain text/xml
  34. DeflateFilterNote Input instream
  35. DeflateFilterNote Output outstream
  36. DeflateFilterNote Ratio ratio
  37. LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
  38. <Directory />

  39. SetOutputFilter DEFLATE
  40. BrowserMatch ^Mozilla/4 gzip-only-text/html
  41. BrowserMatch ^Mozilla/4\.0[678] no-gzip
  42. BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  43. SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
  44. SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
  45. SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar|7z)$ no-gzip dont-vary
  46. </Directory>
  47. </IfModule>

  48. UseCanonicalName Off

  49. <Directory />
  50.   Options Includes
  51.   AllowOverride All
  52. </Directory>

  53. AddType application/x-httpd-php .php

  54. DirectoryIndex index.html index.htm index.php

  55. AccessFileName .htaccess

  56. <Files ~ "^\.ht">
  57.     Order allow,deny
  58.     Deny from all
  59. </Files>

  60. TypesConfig conf/mime.types

  61. DefaultType text/plain

  62. <IfModule mod_mime_magic.c>
  63.     MIMEMagicFile conf/magic
  64. </IfModule>

  65. HostnameLookups Off

  66. ErrorLog logs/error.log

  67. LogLevel warn

  68. LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
  69. LogFormat "%h %l %u %t "%r" %>s %b" common
  70. LogFormat "%{Referer}i -> %U" referer
  71. LogFormat "%{User-agent}i" agent

  72. CustomLog logs/access.log combined

  73. ServerTokens Prod

  74. ServerSignature Off

  75. IndexOptions FancyIndexing VersionSort

  76. AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

  77. AddIconByType (TXT,/icons/text.gif) text/*
  78. AddIconByType (IMG,/icons/image2.gif) image/*
  79. AddIconByType (SND,/icons/sound2.gif) audio/*
  80. AddIconByType (VID,/icons/movie.gif) video/*

  81. AddIcon /icons/binary.gif .bin .exe
  82. AddIcon /icons/binhex.gif .hqx
  83. AddIcon /icons/tar.gif .tar
  84. AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
  85. AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
  86. AddIcon /icons/a.gif .ps .ai .eps
  87. AddIcon /icons/layout.gif .html .shtml .htm .pdf
  88. AddIcon /icons/text.gif .txt
  89. AddIcon /icons/c.gif .c
  90. AddIcon /icons/p.gif .pl .py
  91. AddIcon /icons/f.gif .for
  92. AddIcon /icons/dvi.gif .dvi
  93. AddIcon /icons/uuencoded.gif .uu
  94. AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
  95. AddIcon /icons/tex.gif .tex
  96. AddIcon /icons/bomb.gif core

  97. AddIcon /icons/back.gif ..
  98. AddIcon /icons/hand.right.gif README
  99. AddIcon /icons/folder.gif ^^DIRECTORY^^
  100. AddIcon /icons/blank.gif ^^BLANKICON^^

  101. DefaultIcon /icons/unknown.gif

  102. AddEncoding x-compress Z
  103. AddEncoding x-gzip gz tgz

  104. DefaultLanguage zh-CN

  105. AddLanguage en .en
  106. AddLanguage zh-CN .zh-cn
  107. AddLanguage zh-TW .zh-tw

  108. LanguagePriority en tw

  109. ForceLanguagePriority Prefer Fallback

  110. AddCharset ISO-8859-1  .iso8859-1 .latin1
  111. AddCharset ISO-8859-2  .iso8859-2 .latin2 .cen
  112. AddCharset ISO-8859-3  .iso8859-3 .latin3
  113. AddCharset ISO-8859-4  .iso8859-4 .latin4
  114. AddCharset ISO-8859-5  .iso8859-5 .latin5 .cyr .iso-ru
  115. AddCharset ISO-8859-6  .iso8859-6 .latin6 .arb
  116. AddCharset ISO-8859-7  .iso8859-7 .latin7 .grk
  117. AddCharset ISO-8859-8  .iso8859-8 .latin8 .heb
  118. AddCharset ISO-8859-9  .iso8859-9 .latin9 .trk
  119. AddCharset ISO-2022-JP .iso2022-jp .jis
  120. AddCharset ISO-2022-KR .iso2022-kr .kis
  121. AddCharset ISO-2022-CN .iso2022-cn .cis
  122. AddCharset Big5        .Big5       .big5
  123. AddCharset WINDOWS-1251 .cp-1251   .win-1251
  124. AddCharset CP866       .cp866
  125. AddCharset KOI8-r      .koi8-r .koi8-ru
  126. AddCharset KOI8-ru     .koi8-uk .ua
  127. AddCharset ISO-10646-UCS-2 .ucs2
  128. AddCharset ISO-10646-UCS-4 .ucs4
  129. AddCharset UTF-8       .utf8

  130. AddCharset GB2312      .gb2312 .gb
  131. AddCharset utf-7       .utf7
  132. AddCharset utf-8       .utf8
  133. AddCharset big5        .big5 .b5
  134. AddCharset EUC-TW      .euc-tw
  135. AddCharset EUC-JP      .euc-jp
  136. AddCharset EUC-KR      .euc-kr
  137. AddCharset shift_jis   .sjis

  138. AddType application/x-tar .tgz
  139. AddType image/x-icon .ico

  140. AddHandler server-parsed .shtml .shtm .sht

  141. AddHandler type-map var

  142. AddType text/html .shtml
  143. AddOutputFilter INCLUDES .shtml

  144. BrowserMatch "Mozilla/2" nokeepalive
  145. BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
  146. BrowserMatch "RealPlayer 4\.0" force-response-1.0
  147. BrowserMatch "Java/1\.0" force-response-1.0
  148. BrowserMatch "JDK/1\.0" force-response-1.0

  149. BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
  150. BrowserMatch "^WebDrive" redirect-carefully
  151. BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
  152. BrowserMatch "^gnome-vfs" redirect-carefully

  153. <Location /info>
  154.     SetHandler server-info
  155.     Order deny,allow
  156.     Deny from all
  157.     Allow from localhost
  158. </Location>

  159. <IfModule mod_ssl.c>
  160.     Include conf/ssl.conf
  161. </IfModule>

  162. Listen 80
  163. ServerName localhost
  164. ServerAdmin webmaster@domain.com
  165. ServerRoot "C:\Web\DiscuzEXP\Apache2"
  166. DocumentRoot "C:\Web\DiscuzEXP\wwwroot"
  167. LoadModule php4_module "C:\Web\DiscuzEXP\PHP\php4apache2.dll"
  168. PHPIniDir "C:\Web\DiscuzEXP\PHP\php.ini"
  169. NameVirtualHost *:80
  170. <VirtualHost *:80>
  171.     DocumentRoot C:\Web\bbs
  172.     ServerName bbs.52mag.com
  173.     ServerAlias 52mag.net www.52mag.net
  174.     ErrorLog C:\Web\log\52magbbs
  175. <IfModule mod_rewrite.c>
  176. RewriteEngine On
  177. RewriteRule ^(.*)/archiver/([a-z0-9-]+.html)$ $1/archiver/index.php?$2
  178. RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+).html$ $1/forumdisplay.php?fid=$2&page=$3
  179. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3
  180. RewriteRule ^(.*)/profile-(username|uid)-(.+).html$ $1/viewpro.php?$2=$3
  181. </IfModule>
  182. </VirtualHost>
  183. <VirtualHost *:80>
  184.     DocumentRoot C:\Web\main
  185.     ServerName www.52mag.com
  186.     ServerAlias 52mag.com www.52mag.com.cn 52mag.com.cn www.52mag.cn 52mag.cn www.mpdaogou.net mpdaogou.net
  187. www.mpdaogou.com.cn mpdaogou.com.cn www.mpdaogou.cn,mpdaogou.cn
  188.     ErrorLog C:\Web\log\52mag
  189. <IfModule mod_rewrite.c>
  190. RewriteEngine On
  191. RewriteRule ^(.*)/archiver/([a-z0-9-]+.html)$ $1/archiver/index.php?$2
  192. RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+).html$ $1/forumdisplay.php?fid=$2&page=$3
  193. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3
  194. RewriteRule ^(.*)/profile-(username|uid)-(.+).html$ $1/viewpro.php?$2=$3
  195. </IfModule>
  196. </VirtualHost>
复制代码


虚拟主机设置没用,请赐教
Nanu 发表于 2006-3-11 00:45:10 | 显示全部楼层
如果是在自己电脑安装的Discuz!EXP这样添加虚拟是不行的,因为www.52mag.com等域名并没有解析到本机,而通过其他域名或者IP访问的话都会被ServerName *的默认虚拟主机处理。
回复

使用道具 举报

 楼主| linjiarong1004 发表于 2006-3-11 00:47:31 | 显示全部楼层
原帖由 Nanu 于 2006-3-11 00:45 发表
如果是在自己电脑安装的Discuz!EXP这样添加虚拟是不行的,因为www.52mag.com等域名并没有解析到本机,而通过其他域名或者IP访问的话都会被ServerName *的默认虚拟主机处理。

不是自己电脑,是服务器啊
回复

使用道具 举报

Nanu 发表于 2006-3-11 00:51:18 | 显示全部楼层
将新建虚拟主机中的
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)/archiver/([a-z0-9-]+.html)$ $1/archiver/index.php?$2
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+).html$ $1/forumdisplay.php?fid=$2&page=$3
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3
RewriteRule ^(.*)/profile-(username|uid)-(.+).html$ $1/viewpro.php?$2=$3
</IfModule>
去掉试试。
回复

使用道具 举报

 楼主| linjiarong1004 发表于 2006-3-11 00:57:21 | 显示全部楼层
还是老样子。。本来好的呀。。奇怪。。
回复

使用道具 举报

 楼主| linjiarong1004 发表于 2006-3-11 00:59:20 | 显示全部楼层
PidFile logs/httpd.pid

Timeout 100

KeepAlive Off

MaxKeepAliveRequests 100

KeepAliveTimeout 15

<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild  0
</IfModule>

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 autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule rewrite_module modules/mod_rewrite.so

<IfModule mod_deflate.c>
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
DeflateCompressionLevel 9
AddOutputFilterByType DEFLATE text/html text/plain text/xml
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
<Directory />

SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar|7z)$ no-gzip dont-vary
</Directory>
</IfModule>

UseCanonicalName Off

<Directory />
  Options Includes
  AllowOverride All
</Directory>

AddType application/x-httpd-php .php

DirectoryIndex index.html index.htm index.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>

HostnameLookups 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 combined

ServerTokens Prod

ServerSignature Off

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 .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 .conf .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

AddEncoding x-compress Z
AddEncoding x-gzip gz tgz

DefaultLanguage zh-CN

AddLanguage en .en
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw

LanguagePriority en tw

ForceLanguagePriority Prefer Fallback

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
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

AddType application/x-tar .tgz
AddType image/x-icon .ico

AddHandler server-parsed .shtml .shtm .sht

AddHandler type-map var

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

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 /info>
    SetHandler server-info
    Order deny,allow
    Deny from all
    Allow from localhost
</Location>

<IfModule mod_ssl.c>
    Include conf/ssl.conf
</IfModule>

Listen 80
ServerName localhost
ServerAdmin webmaster@domain.com
ServerRoot "C:\Web\DiscuzEXP\Apache2"
DocumentRoot "C:\Web\DiscuzEXP\wwwroot"
LoadModule php4_module "C:\Web\DiscuzEXP\PHP\php4apache2.dll"
PHPIniDir "C:\Web\DiscuzEXP\PHP\php.ini"

NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot C:\Web\bbs
    ServerName bbs.52mag.com
    ServerAlias 52mag.net www.52mag.net
    ErrorLog C:\Web\log\52magbbs
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot C:\Web\main
    ServerName www.52mag.com
    ServerAlias 52mag.com www.52mag.com.cn 52mag.com.cn www.52mag.cn 52mag.cn www.mpdaogou.net mpdaogou.net
www.mpdaogou.com.cn mpdaogou.com.cn www.mpdaogou.cn,mpdaogou.cn
    ErrorLog C:\Web\log\52mag
</VirtualHost>
回复

使用道具 举报

 楼主| linjiarong1004 发表于 2006-3-11 01:15:53 | 显示全部楼层
这个是本来的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-2-25 13:40 , Processed in 0.028594 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表