您的位置:首页 > 运维架构 > Apache

apache vhost

2013-12-06 14:03 417 查看
httpd.conf:

Include "F:/wamp/alias/*"

<Directory "F:\wamp\www">
Options Indexes FollowSymLinks Multiviews
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
<VirtualHost *:80>
DocumentRoot F:\wamp\www
ServerName localhost
</VirtualHost>

<VirtualHost 168.192.122.74:80>
DocumentRoot f:/wamp/www2
ServerName 168.192.122.74:80
</VirtualHost>

<Directory "f:/wamp/www2">
Options Indexes FollowSymLinks Multiviews
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>

httpd-vhost.conf:

<VirtualHost *:80>
ServerAdmin mss112.com
DocumentRoot "F:/wamp/www2/veryeast/jingnian_phone/Code/v1.2/webroot"
ServerName mssv12.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

wamp2.49,php5.5:

这里用wamp做演示,wamp2.5内置了Apache2.4.9,我们先安装完wamp2.5.

2

我们打开Apache目录\wamp\bin\apache\apache2.4.9下的“conf”文件夹,完整路径:C:\wamp\bin \apache\apache2.4.9\conf,找到httpd.conf,用sublime text或者notepad等代码编辑器打开。

3

找到

# onlineoffline tag - don't remove

下方的:

Require local

4

将 Require local 替换成: Require all granted 即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: