/ 中存储网

Apache服务器配置多个域名的方法

2013-09-10 14:31:12 来源:kejihao
①因为用虚拟域名,把以下各行注释掉(在前面加上##):

##DocumentRoot "D:/server/Apache/htdocs"

##<Directory />

## Options FollowSymLinks

## AllowOverride None

## Order deny,allow

## Deny from all

## Satisfy all

##</Directory>

##<Directory "D:/server/Apache/htdocs">

### Options Indexes FollowSymLinks

### AllowOverride None

### Order allow,deny

### Allow from all

###</Directory>

② DirectoryIndex index.html

改为:

DirectoryIndex index.php index.html index.htm index.wml

③为支持PHP,在文件末尾增加以下几行(cgi和module模式请选择一种,一般用module模式):

LoadModule php5_module "d:/server/php/php5apache2_2.dll"

AddType application/x-httpd-php .php

PHPIniDir "d:/server/php"

④除掉这一行的注释(可以在httpd-vhosts.conf配置多个虚拟站点):

Include conf/extra/httpd-vhosts.conf

b.修改d:serverApacheconfextrahttpd-vhosts.conf

可把此文件的内容删除,然后拷贝下面的内容到文件中:

NameVirtualHost *:80

<VirtualHost *:80>

Options None

ServerAdmin [email protected]

DocumentRoot d:wwwxingmo

ServerName www1.xingmo.com

ErrorLog logs/www1.xingmo.com-error_log

CustomLog logs/www1.xingmo.com-access_log common

php_admin_value open_basedir "d:wwwxingmo"

</VirtualHost>