Art*_*san 3 apache virtualhost
我正在使用Yosemite和Apache 2.4
/private/etc/apache2/httpd.conf
ServerName 127.0.0.1:80
DocumentRoot "/Library/WebServer/Documents/"
<Directory "/Library/WebServer/Documents">
Options Multiviews FollowSymLinks
MultiviewsMatch Any
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Run Code Online (Sandbox Code Playgroud)
一切都很好,http://localhost指导我到默认的/Library/WebServer/Documents/index.html
添加Include /private/etc/apache2/extra/httpd-vhosts.conf到/private/etc/apache2/httpd.conf后
并将以下配置添加到/private/etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin admin@xxx.com
ServerName xxx.local
DocumentRoot "/Library/WebServer/Documents/xxx"
<Directory "/Library/WebServer/Documents/xxx/">
Options +FollowSymLinks
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
当使用http://localhost并http://127.0.0.1从浏览器,Apache的指导我/Library/WebServer/Documents/xxx/index.html而不是/Library/WebServer/Documents/index.html,我该如何解决?请指导.
谢谢.
小智 5
我今天遇到了同样的问题.
主要人物消失了
任何与现有服务器不匹配的请求都由全局服务器配置处理,无论主机名或ServerName如何.
将基于名称的虚拟主机添加到现有服务器,并且虚拟主机参数与预先存在的IP和端口组合匹配时,请求现在将由显式虚拟主机处理.在这种情况下,通常明智的做法是创建一个ServerName与基本服务器匹配的默认虚拟主机.然后,可以将相同接口和端口上的新域(但需要单独的配置)添加为后续(非默认)虚拟主机.
| 归档时间: |
|
| 查看次数: |
3358 次 |
| 最近记录: |