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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[求助] ComsenzEXP 虚拟主机配置

[复制链接]
zhousy2008 发表于 2012-6-28 22:59:42 | 显示全部楼层 |阅读模式
问题一:ComsenzEXP 安装在D:\Program Files\ComsenzEXP\
问题二:打开httpd.conf文件,文件位置:D:\Program Files\ComsenzEXP\Apache\conf
以下是http.conf文件原代码;做虚拟主机应该怎么修改,请提供代码?
  1. #
  2. # This is the main Apache HTTP server configuration file. It contains the
  3. # configuration directives that give the server its instructions.
  4. # See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
  5. # In particular, see
  6. # <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
  7. # for a discussion of each configuration directive.
  8. #
  9. # Do NOT simply read the instructions in here without understanding
  10. # what they do. They're here only as hints or reminders. If you are unsure
  11. # consult the online docs. You have been warned.
  12. #
  13. # Configuration and logfile names: If the filenames you specify for many
  14. # of the server's control files begin with "/" (or "drive:/" for Win32), the
  15. # server will use that explicit path. If the filenames do *not* begin
  16. # with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
  17. # with ServerRoot set to "C:/Program Files/Apache Software Foundation/Apache2.2" will be interpreted by the
  18. # server as "C:/Program Files/Apache Software Foundation/Apache2.2/logs/foo.log".
  19. #
  20. # NOTE: Where filenames are specified, you must use forward slashes
  21. # instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
  22. # If a drive letter is omitted, the drive on which httpd.exe is located
  23. # will be used by default. It is recommended that you always supply
  24. # an explicit drive letter in absolute paths to avoid confusion.

  25. #
  26. # ServerRoot: The top of the directory tree under which the server's
  27. # configuration, error, and log files are kept.
  28. #
  29. # Do not add a slash at the end of the directory path. If you point
  30. # ServerRoot at a non-local disk, be sure to point the LockFile directive
  31. # at a local disk. If you wish to share the same ServerRoot for multiple
  32. # httpd daemons, you will need to change at least LockFile and PidFile.
  33. #
  34. ServerRoot "D:\Program Files\ComsenzEXP\Apache"

  35. #
  36. # Listen: Allows you to bind Apache to specific IP addresses and/or
  37. # ports, instead of the default. See also the <VirtualHost>
  38. # directive.
  39. #
  40. # Change this to Listen on specific IP addresses as shown below to
  41. # prevent Apache from glomming onto all bound IP addresses.
  42. #
  43. #Listen 12.34.56.78:80
  44. Listen 80

  45. #
  46. # Dynamic Shared Object (DSO) Support
  47. #
  48. # To be able to use the functionality of a module which was built as a DSO you
  49. # have to place corresponding `LoadModule' lines at this location so the
  50. # directives contained in it are actually available _before_ they are used.
  51. # Statically compiled modules (those listed by `httpd -l') do not need
  52. # to be loaded here.
  53. #
  54. # Example:
  55. # LoadModule foo_module modules/mod_foo.so
  56. #
  57. LoadModule actions_module modules/mod_actions.so
  58. LoadModule alias_module modules/mod_alias.so
  59. LoadModule asis_module modules/mod_asis.so
  60. LoadModule auth_basic_module modules/mod_auth_basic.so
  61. #LoadModule auth_digest_module modules/mod_auth_digest.so
  62. #LoadModule authn_alias_module modules/mod_authn_alias.so
  63. #LoadModule authn_anon_module modules/mod_authn_anon.so
  64. #LoadModule authn_dbd_module modules/mod_authn_dbd.so
  65. #LoadModule authn_dbm_module modules/mod_authn_dbm.so
  66. LoadModule authn_default_module modules/mod_authn_default.so
  67. LoadModule authn_file_module modules/mod_authn_file.so
  68. #LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
  69. #LoadModule authz_dbm_module modules/mod_authz_dbm.so
  70. LoadModule authz_default_module modules/mod_authz_default.so
  71. LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
  72. LoadModule authz_host_module modules/mod_authz_host.so
  73. #LoadModule authz_owner_module modules/mod_authz_owner.so
  74. LoadModule authz_user_module modules/mod_authz_user.so
  75. LoadModule autoindex_module modules/mod_autoindex.so
  76. #LoadModule cache_module modules/mod_cache.so
  77. #LoadModule cern_meta_module modules/mod_cern_meta.so
  78. LoadModule cgi_module modules/mod_cgi.so
  79. #LoadModule charset_lite_module modules/mod_charset_lite.so
  80. #LoadModule dav_module modules/mod_dav.so
  81. #LoadModule dav_fs_module modules/mod_dav_fs.so
  82. #LoadModule dav_lock_module modules/mod_dav_lock.so
  83. #LoadModule dbd_module modules/mod_dbd.so
  84. #LoadModule deflate_module modules/mod_deflate.so
  85. LoadModule dir_module modules/mod_dir.so
  86. #LoadModule disk_cache_module modules/mod_disk_cache.so
  87. #LoadModule dumpio_module modules/mod_dumpio.so
  88. LoadModule env_module modules/mod_env.so
  89. #LoadModule expires_module modules/mod_expires.so
  90. #LoadModule ext_filter_module modules/mod_ext_filter.so
  91. #LoadModule file_cache_module modules/mod_file_cache.so
  92. #LoadModule filter_module modules/mod_filter.so
  93. #LoadModule headers_module modules/mod_headers.so
  94. #LoadModule ident_module modules/mod_ident.so
  95. #LoadModule imagemap_module modules/mod_imagemap.so
  96. LoadModule include_module modules/mod_include.so
  97. #LoadModule info_module modules/mod_info.so
  98. LoadModule isapi_module modules/mod_isapi.so
  99. #LoadModule ldap_module modules/mod_ldap.so
  100. #LoadModule logio_module modules/mod_logio.so
  101. LoadModule log_config_module modules/mod_log_config.so
  102. #LoadModule log_forensic_module modules/mod_log_forensic.so
  103. #LoadModule mem_cache_module modules/mod_mem_cache.so
  104. LoadModule mime_module modules/mod_mime.so
  105. #LoadModule mime_magic_module modules/mod_mime_magic.so
  106. LoadModule negotiation_module modules/mod_negotiation.so
  107. #LoadModule proxy_module modules/mod_proxy.so
  108. #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
  109. #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
  110. #LoadModule proxy_connect_module modules/mod_proxy_connect.so
  111. #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
  112. #LoadModule proxy_http_module modules/mod_proxy_http.so
  113. #LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
  114. #LoadModule reqtimeout_module modules/mod_reqtimeout.so
  115. LoadModule rewrite_module modules/mod_rewrite.so
  116. LoadModule setenvif_module modules/mod_setenvif.so
  117. #LoadModule speling_module modules/mod_speling.so
  118. #LoadModule ssl_module modules/mod_ssl.so
  119. #LoadModule status_module modules/mod_status.so
  120. #LoadModule substitute_module modules/mod_substitute.so
  121. LoadModule unique_id_module modules/mod_unique_id.so
  122. #LoadModule userdir_module modules/mod_userdir.so
  123. #LoadModule usertrack_module modules/mod_usertrack.so
  124. #LoadModule version_module modules/mod_version.so
  125. #LoadModule vhost_alias_module modules/mod_vhost_alias.so

  126. <IfModule !mpm_netware_module>
  127. <IfModule !mpm_winnt_module>
  128. #
  129. # If you wish httpd to run as a different user or group, you must run
  130. # httpd as root initially and it will switch.
  131. #
  132. # User/Group: The name (or #number) of the user/group to run httpd as.
  133. # It is usually good practice to create a dedicated user and group for
  134. # running httpd, as with most system services.
  135. #
  136. User daemon
  137. Group daemon

  138. </IfModule>
  139. </IfModule>

  140. # 'Main' server configuration
  141. #
  142. # The directives in this section set up the values used by the 'main'
  143. # server, which responds to any requests that aren't handled by a
  144. # <VirtualHost> definition. These values also provide defaults for
  145. # any <VirtualHost> containers you may define later in the file.
  146. #
  147. # All of these directives may appear inside <VirtualHost> containers,
  148. # in which case these default settings will be overridden for the
  149. # virtual host being defined.
  150. #

  151. #
  152. # ServerAdmin: Your address, where problems with the server should be
  153. # e-mailed. This address appears on some server-generated pages, such
  154. # as error documents. e.g. admin@your-domain.com
  155. #
  156. ServerAdmin admin@EXPTEST.org

  157. #
  158. # ServerName gives the name and port that the server uses to identify itself.
  159. # This can often be determined automatically, but we recommend you specify
  160. # it explicitly to prevent problems during startup.
  161. #
  162. # If your host doesn't have a registered DNS name, enter its IP address here.
  163. #
  164. ServerName EXPServer

  165. #
  166. # DocumentRoot: The directory out of which you will serve your
  167. # documents. By default, all requests are taken from this directory, but
  168. # symbolic links and aliases may be used to point to other locations.
  169. #
  170. DocumentRoot "../wwwroot"

  171. #
  172. # Each directory to which Apache has access can be configured with respect
  173. # to which services and features are allowed and/or disabled in that
  174. # directory (and its subdirectories).
  175. #
  176. # First, we configure the "default" to be a very restrictive set of
  177. # features.
  178. #
  179. <Directory />
  180. Options FollowSymLinks
  181. AllowOverride None
  182. Order deny,allow
  183. Deny from all
  184. </Directory>

  185. #
  186. # Note that from this point forward you must specifically allow
  187. # particular features to be enabled - so if something's not working as
  188. # you might expect, make sure that you have specifically enabled it
  189. # below.
  190. #

  191. #
  192. # This should be changed to whatever you set DocumentRoot to.
  193. #
  194. <IfModule mod_rewrite.c>
  195. RewriteEngine On
  196. RewriteCond %{QUERY_STRING} ^(.*)$
  197. RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2&%1
  198. RewriteCond %{QUERY_STRING} ^(.*)$
  199. RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3&%1
  200. RewriteCond %{QUERY_STRING} ^(.*)$
  201. RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&%1
  202. RewriteCond %{QUERY_STRING} ^(.*)$
  203. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1
  204. RewriteCond %{QUERY_STRING} ^(.*)$
  205. RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3&%1
  206. RewriteCond %{QUERY_STRING} ^(.*)$
  207. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3&%1
  208. RewriteCond %{QUERY_STRING} ^(.*)$
  209. RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3&%1
  210. RewriteCond %{QUERY_STRING} ^(.*)$
  211. RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3&%1
  212. </IfModule>

  213. <Directory "../wwwroot">
  214. #
  215. # Possible values for the Options directive are "None", "All",
  216. # or any combination of:
  217. # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  218. #
  219. # Note that "MultiViews" must be named *explicitly* --- "Options All"
  220. # doesn't give it to you.
  221. #
  222. # The Options directive is both complicated and important. Please see
  223. # http://httpd.apache.org/docs/2.2/mod/core.html#options
  224. # for more information.
  225. #
  226. Options Indexes FollowSymLinks

  227. #
  228. # AllowOverride controls what directives may be placed in .htaccess files.
  229. # It can be "All", "None", or any combination of the keywords:
  230. # Options FileInfo AuthConfig Limit
  231. #
  232. AllowOverride All

  233. #
  234. # Controls who can get stuff from this server.
  235. #
  236. Order allow,deny
  237. Allow from all

  238. </Directory>

  239. #
  240. # DirectoryIndex: sets the file that Apache will serve if a directory
  241. # is requested.
  242. #
  243. <IfModule dir_module>
  244. DirectoryIndex index.html index.htm index.php
  245. </IfModule>

  246. #
  247. # The following lines prevent .htaccess and .htpasswd files from being
  248. # viewed by Web clients.
  249. #
  250. <FilesMatch "^\.ht">
  251. Order allow,deny
  252. Deny from all
  253. Satisfy All
  254. </FilesMatch>

  255. #
  256. # ErrorLog: The location of the error log file.
  257. # If you do not specify an ErrorLog directive within a <VirtualHost>
  258. # container, error messages relating to that virtual host will be
  259. # logged here. If you *do* define an error logfile for a <VirtualHost>
  260. # container, that host's errors will be logged there and not here.
  261. #
  262. ErrorLog "logs/error.log"

  263. #
  264. # LogLevel: Control the number of messages logged to the error_log.
  265. # Possible values include: debug, info, notice, warn, error, crit,
  266. # alert, emerg.
  267. #
  268. LogLevel warn

  269. <IfModule log_config_module>
  270. #
  271. # The following directives define some format nicknames for use with
  272. # a CustomLog directive (see below).
  273. #
  274. LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
  275. LogFormat "%h %l %u %t "%r" %>s %b" common

  276. <IfModule logio_module>
  277. # You need to enable mod_logio.c to use %I and %O
  278. LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %I %O" combinedio
  279. </IfModule>

  280. #
  281. # The location and format of the access logfile (Common Logfile Format).
  282. # If you do not define any access logfiles within a <VirtualHost>
  283. # container, they will be logged here. Contrariwise, if you *do*
  284. # define per-<VirtualHost> access logfiles, transactions will be
  285. # logged therein and *not* in this file.
  286. #
  287. CustomLog "logs/access.log" common

  288. #
  289. # If you prefer a logfile with access, agent, and referer information
  290. # (Combined Logfile Format) you can use the following directive.
  291. #
  292. #CustomLog "logs/access.log" combined
  293. </IfModule>

  294. <IfModule alias_module>
  295. #
  296. # Redirect: Allows you to tell clients about documents that used to
  297. # exist in your server's namespace, but do not anymore. The client
  298. # will make a new request for the document at its new location.
  299. # Example:
  300. # Redirect permanent /foo http://localhost/bar

  301. #
  302. # Alias: Maps web paths into filesystem paths and is used to
  303. # access content that does not live under the DocumentRoot.
  304. # Example:
  305. # Alias /webpath /full/filesystem/path
  306. #
  307. # If you include a trailing / on /webpath then the server will
  308. # require it to be present in the URL. You will also likely
  309. # need to provide a <Directory> section to allow access to
  310. # the filesystem path.

  311. #
  312. # ScriptAlias: This controls which directories contain server scripts.
  313. # ScriptAliases are essentially the same as Aliases, except that
  314. # documents in the target directory are treated as applications and
  315. # run by the server when requested rather than as documents sent to the
  316. # client. The same rules about trailing "/" apply to ScriptAlias
  317. # directives as to Alias.
  318. #
  319. ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"

  320. </IfModule>

  321. <IfModule cgid_module>
  322. #
  323. # ScriptSock: On threaded servers, designate the path to the UNIX
  324. # socket used to communicate with the CGI daemon of mod_cgid.
  325. #
  326. #Scriptsock logs/cgisock
  327. </IfModule>

  328. #
  329. # "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased
  330. # CGI directory exists, if you have that configured.
  331. #
  332. <Directory "../wwwroot/cgi-bin">
  333. AllowOverride None
  334. Options None
  335. Order allow,deny
  336. Allow from all
  337. </Directory>

  338. #
  339. # DefaultType: the default MIME type the server will use for a document
  340. # if it cannot otherwise determine one, such as from filename extensions.
  341. # If your server contains mostly text or HTML documents, "text/plain" is
  342. # a good value. If most of your content is binary, such as applications
  343. # or images, you may want to use "application/octet-stream" instead to
  344. # keep browsers from trying to display binary files as though they are
  345. # text.
  346. #
  347. DefaultType text/plain

  348. <IfModule mime_module>
  349. #
  350. # TypesConfig points to the file containing the list of mappings from
  351. # filename extension to MIME-type.
  352. #
  353. TypesConfig conf/mime.types

  354. #
  355. # AddType allows you to add to or override the MIME configuration
  356. # file specified in TypesConfig for specific file types.
  357. #
  358. #AddType application/x-gzip .tgz
  359. #
  360. # AddEncoding allows you to have certain browsers uncompress
  361. # information on the fly. Note: Not all browsers support this.
  362. #
  363. #AddEncoding x-compress .Z
  364. #AddEncoding x-gzip .gz .tgz
  365. #
  366. # If the AddEncoding directives above are commented-out, then you
  367. # probably should define those extensions to indicate media types:
  368. #
  369. AddType application/x-compress .Z
  370. AddType application/x-gzip .gz .tgz

  371. #
  372. # AddHandler allows you to map certain file extensions to "handlers":
  373. # actions unrelated to filetype. These can be either built into the server
  374. # or added with the Action directive (see below)
  375. #
  376. # To use CGI scripts outside of ScriptAliased directories:
  377. # (You will also need to add "ExecCGI" to the "Options" directive.)
  378. #
  379. #AddHandler cgi-script .cgi

  380. # For type maps (negotiated resources):
  381. #AddHandler type-map var

  382. #
  383. # Filters allow you to process content before it is sent to the client.
  384. #
  385. # To parse .shtml files for server-side includes (SSI):
  386. # (You will also need to add "Includes" to the "Options" directive.)
  387. #
  388. #AddType text/html .shtml
  389. #AddOutputFilter INCLUDES .shtml
  390. </IfModule>

  391. #
  392. # The mod_mime_magic module allows the server to use various hints from the
  393. # contents of the file itself to determine its type. The MIMEMagicFile
  394. # directive tells the module where the hint definitions are located.
  395. #
  396. #MIMEMagicFile conf/magic

  397. #
  398. # Customizable error responses come in three flavors:
  399. # 1) plain text 2) local redirects 3) external redirects
  400. #
  401. # Some examples:
  402. #ErrorDocument 500 "The server made a boo boo."
  403. #ErrorDocument 404 /missing.html
  404. #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
  405. #ErrorDocument 402 http://localhost/subscription_info.html
  406. #

  407. #
  408. # EnableMMAP and EnableSendfile: On systems that support it,
  409. # memory-mapping or the sendfile syscall is used to deliver
  410. # files. This usually improves server performance, but must
  411. # be turned off when serving from networked-mounted
  412. # filesystems or if support for these functions is otherwise
  413. # broken on your system.
  414. #
  415. #EnableMMAP off
  416. #EnableSendfile off

  417. # Supplemental configuration
  418. #
  419. # The configuration files in the conf/extra/ directory can be
  420. # included to add extra features or to modify the default configuration of
  421. # the server, or you may simply copy their contents here and change as
  422. # necessary.

  423. # Server-pool management (MPM specific)
  424. Include conf/extra/httpd-mpm.conf

  425. # Multi-language error messages
  426. #Include conf/extra/httpd-multilang-errordoc.conf

  427. # Fancy directory listings
  428. #Include conf/extra/httpd-autoindex.conf

  429. # Language settings
  430. #Include conf/extra/httpd-languages.conf

  431. # User home directories
  432. #Include conf/extra/httpd-userdir.conf

  433. # Real-time info on requests and configuration
  434. #Include conf/extra/httpd-info.conf

  435. # Virtual hosts
  436. #Include conf/extra/httpd-vhosts.conf

  437. # Local access to the Apache HTTP Server Manual
  438. #Include conf/extra/httpd-manual.conf

  439. # Distributed authoring and versioning (WebDAV)
  440. #Include conf/extra/httpd-dav.conf

  441. # Various default settings
  442. #Include conf/extra/httpd-default.conf

  443. # Secure (SSL/TLS) connections
  444. #Include conf/extra/httpd-ssl.conf
  445. #
  446. # Note: The following must must be present to support
  447. # starting without SSL on platforms with no /dev/random equivalent
  448. # but a statically compiled-in mod_ssl.
  449. #
  450. <IfModule ssl_module>
  451. SSLRandomSeed startup builtin
  452. SSLRandomSeed connect builtin
  453. </IfModule>

  454. LoadModule php5_module "../php5/php5apache2_2.dll"
  455. PHPINIDir "../php5/"
  456. <FilesMatch "\.php$">
  457. AddType application/x-httpd-php .php
  458. </FilesMatch>
  459. AddType application/x-httpd-php-source .phps
复制代码
问题三:打开httpd-vhosts文件,文件位置:D:\Program Files\ComsenzEXP\Apache\conf\extra\
以下是httpd-vhosts.conf文件原代码;做虚拟主机应该怎么修改,请提供代码?
  1. #
  2. # Virtual Hosts
  3. #
  4. # If you want to maintain multiple domains/hostnames on your
  5. # machine you can setup VirtualHost containers for them. Most configurations
  6. # use only name-based virtual hosts so the server doesn't need to worry about
  7. # IP addresses. This is indicated by the asterisks in the directives below.
  8. #
  9. # Please see the documentation at
  10. # <URL:http://httpd.apache.org/docs/2.2/vhosts/>
  11. # for further details before you try to setup virtual hosts.
  12. #
  13. # You may use the command line option '-S' to verify your virtual host
  14. # configuration.

  15. #
  16. # Use name-based virtual hosting.
  17. #
  18. NameVirtualHost *:80

  19. #
  20. # VirtualHost example:
  21. # Almost any Apache directive may go into a VirtualHost container.
  22. # The first VirtualHost section is used for all requests that do not
  23. # match a ServerName or ServerAlias in any <VirtualHost> block.
  24. #
  25. <VirtualHost *:80>
  26. ServerAdmin webmaster@dummy-host.localhost
  27. DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.localhost"
  28. ServerName dummy-host.localhost
  29. ServerAlias www.dummy-host.localhost
  30. ErrorLog "logs/dummy-host.localhost-error.log"
  31. CustomLog "logs/dummy-host.localhost-access.log" common
  32. </VirtualHost>

  33. <VirtualHost *:80>
  34. ServerAdmin webmaster@dummy-host2.localhost
  35. DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost"
  36. ServerName dummy-host2.localhost
  37. ErrorLog "logs/dummy-host2.localhost-error.log"
  38. CustomLog "logs/dummy-host2.localhost-access.log" common
  39. </VirtualHost>



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

本版积分规则

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

GMT+8, 2024-5-17 15:43 , Processed in 0.111552 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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