LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 463|回复: 0

Mandrake Linux 9.1 下的APACHE虚拟主机设置!!

[复制链接]
发表于 2004-4-13 13:56:32 | 显示全部楼层 |阅读模式

  1. ### Main Configuration Section
  2. ### You really shouldn't change these settings unless you're a guru
  3. ###
  4. ServerType standalone
  5. ServerRoot /etc/httpd
  6. ServerName *
  7. LockFile /etc/httpd/httpd.lock
  8. PidFile /var/run/httpd.pid
  9. ScoreBoardFile /etc/httpd/httpd.scoreboard
  10. ErrorLog logs/error_log
  11. LogLevel warn
  12. ResourceConfig /dev/null
  13. AccessConfig /dev/null

  14. ### Dynamic Shared Object (DSO) Support
  15. ###
  16. ###
  17. #LoadModule mmap_static_module modules/mod_mmap_static.so
  18. LoadModule env_module         modules/mod_env.so
  19. LoadModule config_log_module  modules/mod_log_config.so
  20. LoadModule agent_log_module   modules/mod_log_agent.so
  21. LoadModule referer_log_module modules/mod_log_referer.so
  22. #LoadModule mime_magic_module  modules/mod_mime_magic.so
  23. LoadModule mime_module        modules/mod_mime.so
  24. LoadModule negotiation_module modules/mod_negotiation.so
  25. LoadModule status_module      modules/mod_status.so
  26. LoadModule info_module        modules/mod_info.so
  27. LoadModule includes_module    modules/mod_include.so
  28. LoadModule autoindex_module   modules/mod_autoindex.so
  29. LoadModule dir_module         modules/mod_dir.so
  30. LoadModule cgi_module         modules/mod_cgi.so
  31. LoadModule asis_module        modules/mod_asis.so
  32. LoadModule imap_module        modules/mod_imap.so
  33. LoadModule action_module      modules/mod_actions.so
  34. #LoadModule speling_module     modules/mod_speling.so
  35. LoadModule userdir_module     modules/mod_userdir.so
  36. LoadModule proxy_module       modules/libproxy.so
  37. LoadModule alias_module       modules/mod_alias.so
  38. LoadModule rewrite_module     modules/mod_rewrite.so
  39. LoadModule access_module      modules/mod_access.so
  40. LoadModule auth_module        modules/mod_auth.so
  41. LoadModule anon_auth_module   modules/mod_auth_anon.so
  42. #LoadModule dbm_auth_module    modules/mod_auth_dbm.so
  43. #LoadModule db_auth_module     modules/mod_auth_db.so
  44. LoadModule digest_module      modules/mod_digest.so
  45. #LoadModule cern_meta_module   modules/mod_cern_meta.so
  46. LoadModule expires_module     modules/mod_expires.so
  47. LoadModule headers_module     modules/mod_headers.so
  48. LoadModule usertrack_module   modules/mod_usertrack.so
  49. #LoadModule example_module     modules/mod_example.so
  50. #LoadModule unique_id_module   modules/mod_unique_id.so
  51. LoadModule setenvif_module    modules/mod_setenvif.so
  52. <IfDefine HAVE_SSL>
  53. LoadModule ssl_module    extramodules/libssl.so
  54. </IfDefine>
  55. <IfDefine HAVE_SXNET>
  56. LoadModule sxnet_module    extramodules/mod_sxnet.so
  57. </IfDefine>
  58. <IfDefine HAVE_PHP4>
  59. LoadModule php4_module    extramodules/libphp4.so
  60. </IfDefine>
  61. LoadModule vhost_alias_module        modules/mod_vhost_alias.so

  62. #  Reconstruction of the complete module list from all available modules
  63. #  (static and shared ones) to achieve correct module execution order.
  64. #  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
  65. #AddModule mod_mmap_static.c
  66. #AddModule mod_mime_magic.c
  67. #AddModule mod_speling.c
  68. #AddModule mod_auth_dbm.c
  69. #AddModule mod_auth_db.c
  70. #AddModule mod_cern_meta.c
  71. #AddModule mod_example.c
  72. #AddModule mod_unique_id.c
  73. <IfDefine HAVE_SSL>
  74. </IfDefine>
  75. <IfDefine HAVE_SXNET>
  76. AddModule mod_sxnet.c
  77. </IfDefine>
  78. <IfDefine HAVE_PHP4>
  79. </IfDefine>

  80. ###
  81. ### Global Configuration
  82. ###
  83. # We now support multiple apache configurations on the same server. In
  84. # common.conf, we put all directives that are common to all implementations
  85. # (httpd, httpd-perl, etc.)
  86. Include conf/commonhttpd.conf


  87. ###
  88. ### IP Address/Port and Proxied configuration section
  89. ###
  90. # The APACHEPROXIED setting can be set in /etc/rc.d/init.d/httpd if you
  91. # are using a proxy or accelerator, like the Apache-SGI or khttpd, so that
  92. # the fast web server serves static content while Apache handles the
  93. # cgi or php files

  94. #BindAddress *
  95. <IfDefine APACHEPROXIED>
  96.     Port 8080
  97.     Listen 8080
  98. </IfDefine>
  99. <IfDefine !APACHEPROXIED>
  100. Port 80
  101. Listen *:80
  102. </IfDefine>

  103. # Likewise, we can set apache as the server by default and send perl
  104. # requests via ProxyPass to apache-mod_perl. It increases performance
  105. # since the perl interpreter is only used for perl and the standard apache
  106. # does all the html and image files, with a smaller footprint.
  107. #
  108. # If you install apache and apache-mod_perl, this is the default config.
  109. # If you don't want two web servers to use perl, uninstall apache, and
  110. # apache-mod_perl will not be proxied.

  111. <IfDefine PERLPROXIED>
  112.     RewriteEngine on
  113.     RewriteRule ^proxy:.*  -  [F]
  114.     RewriteRule ^(.*\/perl\/.*)$  [url]http://%[/url]{HTTP_HOST}:8200$1 [P]
  115.     RewriteRule ^(.*\/cgi-perl\/.*)$  [url]http://%[/url]{HTTP_HOST}:8200$1 [P]
  116. </IfDefine>

  117. ###
  118. ### Log configuration Section
  119. ###

  120. #Single logfile with access, agent and referer information
  121. #This is the default, if vlogs are not defined for the main server
  122. CustomLog logs/access_log combined env=!VLOG
  123. #If VLOG is defined in conf/vhosts/Vhost.conf, we use this entry
  124. CustomLog "|/usr/sbin/advxsplitlogfile" vhost env=VLOG


  125. ###
  126. ### Virtual Hosts
  127. ###
  128. # We include different templates for Virtual Hosting. Have a look in the
  129. # vhosts directory and modify to suit your needs.
  130. #Include conf/vhosts/Vhosts.conf
  131. #Include conf/vhosts/DynamicVhosts.conf
  132. #Include conf/vhosts/VirtualHomePages.conf


  133. ###
  134. ### Performance settings Section
  135. ###
  136. #
  137. # Timeout: The number of seconds before receives and sends time out.
  138. #
  139. TimeOut 300

  140. #
  141. # KeepAlive: Whether or not to allow persistent connections (more than
  142. # one request per connection). Set to "Off" to deactivate.
  143. #
  144. KeepAlive on

  145. #
  146. # MaxKeepAliveRequests: The maximum number of requests to allow
  147. # during a persistent connection. Set to 0 to allow an unlimited amount.
  148. # We recommend you leave this number high, for maximum performance.
  149. #
  150. MaxKeepAliveRequests 100

  151. #
  152. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  153. # same client on the same connection.
  154. #
  155. KeepAliveTimeout 15

  156. #
  157. # Server-pool size regulation.  Rather than making you guess how many
  158. # server processes you need, Apache dynamically adapts to the load it
  159. # sees --- that is, it tries to maintain enough server processes to
  160. # handle the current load, plus a few spare servers to handle transient
  161. # load spikes (e.g., multiple simultaneous requests from a single
  162. # Netscape browser).
  163. #
  164. # It does this by periodically checking how many servers are waiting
  165. # for a request.  If there are fewer than MinSpareServers, it creates
  166. # a new spare.  If there are more than MaxSpareServers, some of the
  167. # spares die off.  The default values are probably OK for most sites.
  168. #
  169. MinSpareServers 4
  170. MaxSpareServers 10

  171. #
  172. # Number of servers to start initially --- should be a reasonable ballpark
  173. # figure.
  174. #
  175. StartServers 4

  176. #
  177. # Limit on total number of servers running, i.e., limit on the number
  178. # of clients who can simultaneously connect --- if this limit is ever
  179. # reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
  180. # It is intended mainly as a brake to keep a runaway server from taking
  181. # the system with it as it spirals down...
  182. #
  183. MaxClients 150

  184. #
  185. # MaxRequestsPerChild: the number of requests each child process is
  186. # allowed to process before the child dies.  The child will exit so
  187. # as to avoid problems after prolonged use when Apache (and maybe the
  188. # libraries it uses) leak memory or other resources.  On most systems, this
  189. # isn't really needed, but a few (such as Solaris) do have notable leaks
  190. # in the libraries. For these platforms, set to something like 10000
  191. # or so; a setting of 0 means unlimited.
  192. #
  193. # NOTE: This value does not include keepalive requests after the initial
  194. #       request per connection. For example, if a child process handles
  195. #       an initial request and 10 subsequent "keptalive" requests, it
  196. #       would only count as 1 request towards this limit.
  197. #
  198. MaxRequestsPerChild 500

  199. Include  conf/ssl/mod_ssl.conf
  200. Include  conf/ssl/ssl.default-vhost.conf
  201. Include conf/mailman.conf
  202. Include  conf/addon-modules/php.conf
  203. <VirtualHost *>
  204. DocumentRoot /home/Admin/www
  205. ServerName forum.zhangrui.com
  206. ServerAdmin [email]info@thcnc.com[/email]
  207. ServerPath /home/Admin/www
  208. </VirtualHost>
复制代码



不管加什么虚拟主机都是访问的同一个目录~~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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