我原本是用 Apache 2.0.58 的版本, 最近改用 2.2.2 的版本, 我把原來的設定全都移到 2.2.2 後, 原本正常的虛擬機器全都失效了!
以下是我的 httpd-vhost.conf 設定檔內容:
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin abc@abc.com
DocumentRoot "E:\network\front"
ServerName abc.com
ErrorLog logs/dummy-abc.com-error_log
CustomLog logs/dummy-abc.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin abc@abc.com
DocumentRoot "E:\network\error"
ServerName error.abc.com
ErrorLog logs/dummy-error.abc.com-error_log
CustomLog logs/dummy-error.abc.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin abc@abc.com
DocumentRoot "E:\network\photos"
ServerName photos.abc.com
ErrorLog logs/dummy-photos.abc.com-error_log
CustomLog logs/dummy-photos.abc.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin abc@abc.com
DocumentRoot "E:\network\www"
ServerName
ErrorLog logs/dummy-www.abc.com-error_log
CustomLog logs/dummy-www.abc.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin abc@abc.com
DocumentRoot "E:\network\briefcase"
ServerName briefcase.abc.com
ErrorLog logs/dummy-briefcase.abc.com-error_log
CustomLog logs/dummy-briefcase.abc.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin abc@abc.com
DocumentRoot "E:\network\test"
ServerName test.abc.com
ErrorLog logs/dummy-test.abc.com-error_log
CustomLog logs/dummy-test.abc.com-access_log common
</VirtualHost>
以下是我的 httpd.conf 設定檔內容:
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL: for detailed information.
# In particular, see
# <URL:
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "D:/Chinese/Apache2.2.2" will be interpreted by the
# server as "D:/Chinese/Apache2.2.2/logs/foo.log".
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which Apache.exe is located
# will be used by default. It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
# confusion.
#
# ThreadsPerChild: constant number of worker threads in the server process
# MaxRequestsPerChild: maximum number of requests a server process serves
ThreadsPerChild 250
MaxRequestsPerChild 0
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to point the LockFile directive
# at a local disk. If you wish to share the same ServerRoot for multiple
# httpd daemons, you will need to change at least LockFile and PidFile.
#
ServerRoot "D:/Chinese/Apache2.2.2"
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
LoadModule imagemap_module modules/mod_imagemap.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 mime_magic_module modules/mod_mime_magic.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_ ..
訪客只能看到部份內容,免費 加入會員 或由臉書 Google 可以看到全部內容