Apache 2.4.3 配置多域名

# vi /usr/local/apache/conf/httpd.conf

#ServerRoot "/usr/local/apache"   #注释掉

#ServerAdmin you@example.com  #注释掉

#DocumentRoot "/usr/local/apache/htdocs"  #注释掉

#<Directory "/usr/local/apache/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
#Options FollowSymLinks

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

#
# Controls who can get stuff from this server.
#
#Require all granted
#</Directory>

#以上都注释掉

# Virtual hosts
Include conf/extra/httpd-vhosts.conf  #去掉注释

:wq

# vi /usr/local/apache/conf/extra/httpd-vhosts.conf

<VirtualHost *:80>
ServerAdmin lwysoft@163.com
DocumentRoot /usr/local/apache/htdocs
ServerName localhost
DirectoryIndex index.htm index.html index.php
ErrorLog logs/localhost-error_log
CustomLog logs/localhost-custom_log common
</VirtualHost>

<Directory "/usr/local/apache/htdocs">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

<VirtualHost *:80>
ServerAdmin lwysoft@163.com
DocumentRoot /var/www/wordpress
ServerName www.wordpress.loc
DirectoryIndex index.htm index.html index.php
ErrorLog logs/www.wordpress.loc-error_log
CustomLog logs/www.wordpress.loc-custom_log common
</VirtualHost>

<Directory "/var/www/wordpress">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

:wq

# service httpd stop

# service httpd start

# 配置完成

 

posted on 2013-01-06 16:26  lwysoft  阅读(686)  评论(0编辑  收藏  举报

导航