新配置出的apache2.2虚拟主机特来共享一下
时间:2008-04-03
来源:互联网
写的比较简单,目前只搞了这一种配置方法,原谅……
1,httpd.conf
(1), 将“#LoadModule vhost_alias_module modules/mod_vhost_alias.so”前的“#”号去掉
(2),将“#Include conf/extra/httpd-vhosts.conf” 前的“#”号去掉
2,conf\extra\httpd-vhosts.conf
加
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot D:/www/hosts/localhost
ServerName localhost
ErrorLog D:/www/logs/localhost-error_log
CustomLog D:/www/logs/localhost-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot D:/www/hosts/demo1
ServerName demo1
ErrorLog D:/www/logs/demo1-error_log
CustomLog D:/www/logs/demo1-access_log common
</VirtualHost>
3,C:\WINDOWS\system32\drivers\etc\hosts
加
127.0.0.1 localhost
127.0.0.1 demo1
4,目录
D:/www/hosts
D:/www/logs
D:/www/hosts/localhost //这里新建一个index.php
D:/www/hosts/demo1 // 这里新建一个index.php
分别在IE中输入http://localhost 和 http://demo1 来浏览两个虚拟主机中的内容
若出现403错误,打开 httpd.conf
修改
<Directory />
Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order deny,allow
deny from all
Satisfy all
</Directory>
为
<Directory />
Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order allow,deny
allow from all
Satisfy all
</Directory>
再试就OK了……
[ 本帖最后由 dx_andy 于 2008-4-3 14:11 编辑 ]
1,httpd.conf
(1), 将“#LoadModule vhost_alias_module modules/mod_vhost_alias.so”前的“#”号去掉
(2),将“#Include conf/extra/httpd-vhosts.conf” 前的“#”号去掉
2,conf\extra\httpd-vhosts.conf
加
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot D:/www/hosts/localhost
ServerName localhost
ErrorLog D:/www/logs/localhost-error_log
CustomLog D:/www/logs/localhost-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot D:/www/hosts/demo1
ServerName demo1
ErrorLog D:/www/logs/demo1-error_log
CustomLog D:/www/logs/demo1-access_log common
</VirtualHost>
3,C:\WINDOWS\system32\drivers\etc\hosts
加
127.0.0.1 localhost
127.0.0.1 demo1
4,目录
D:/www/hosts
D:/www/logs
D:/www/hosts/localhost //这里新建一个index.php
D:/www/hosts/demo1 // 这里新建一个index.php
分别在IE中输入http://localhost 和 http://demo1 来浏览两个虚拟主机中的内容
若出现403错误,打开 httpd.conf
修改
<Directory />
Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order deny,allow
deny from all
Satisfy all
</Directory>
为
<Directory />
Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order allow,deny
allow from all
Satisfy all
</Directory>
再试就OK了……
[ 本帖最后由 dx_andy 于 2008-4-3 14:11 编辑 ]
作者: dx_andy 发布时间: 2008-04-03
<Directory />
Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order allow,deny
allow from all
Satisfy all
</Directory>
这样安全性太低了!
Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order allow,deny
allow from all
Satisfy all
</Directory>
这样安全性太低了!
作者: thaiki 发布时间: 2008-04-03
<Directory />
Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order allow,deny
deny from all
Satisfy all
</Directory>
下面加上
<Directory /你的目录>
Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order allow,deny
allow from all
Satisfy all
</Directory>
就可以了,两者不冲突!
Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order allow,deny
deny from all
Satisfy all
</Directory>
下面加上
<Directory /你的目录>
Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order allow,deny
allow from all
Satisfy all
</Directory>
就可以了,两者不冲突!
作者: thaiki 发布时间: 2008-04-03
谢谢,我是本地测试用,也没考虑那么多,多谢指点
作者: dx_andy 发布时间: 2008-04-03
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28