Apache 在xampp中设置虚拟主机时出错
我已经阅读了很多关于虚拟主机设置的文章和帖子,但我无法找出问题出在哪里 我有一台Win7 pc,在那里我安装了一个xampp来管理我的php+mysql项目。 默认情况下,web根目录为C:\xampp\htdocs 为了避免与skype冲突,我将apache设置为在端口8080上工作 如果我浏览到localhost:8080/mysubdir之类的东西,它就可以正常工作 我现在的想法是将Apache的webroot指向我电脑上的另一个目录:我希望指向webroot的目录是C:\Users\myuser\Google Drive\CODE\u REPOS 我在网上搜索,虚拟主机似乎可以做到这一点; 这是我的配置Apache 在xampp中设置虚拟主机时出错,apache,xampp,virtualhost,Apache,Xampp,Virtualhost,我已经阅读了很多关于虚拟主机设置的文章和帖子,但我无法找出问题出在哪里 我有一台Win7 pc,在那里我安装了一个xampp来管理我的php+mysql项目。 默认情况下,web根目录为C:\xampp\htdocs 为了避免与skype冲突,我将apache设置为在端口8080上工作 如果我浏览到localhost:8080/mysubdir之类的东西,它就可以正常工作 我现在的想法是将Apache的webroot指向我电脑上的另一个目录:我希望指向webroot的目录是C:\Users\my
apache httpd.conf
#Listen [::]:80
Listen *:8080
# Virtual hosts
#Include "conf/extra/httpd-vhosts.conf"
这里是我的httpd-vhosts.conf
# Use name-based virtual hosting.
#
NameVirtualHost *:8080
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:8080>
ServerAdmin admin@localhost.com
DocumentRoot "C:/xampp/htdocs" # change this line with your htdocs folder
ServerName localhost
ServerAlias localhost
<Directory "C:/xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost development.loc:8080>
ServerAdmin admin@localhost.com
DocumentRoot "C:/Users/myuser/Google Drive/CODE_REPOS" # change this line with your htdocs folder
ServerName development.loc
ServerAlias development.loc
<Directory "C:/Users/myuser/Google Drive/CODE_REPOS">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
如果我停止Apache,取消对行的注释#Include“conf/extra/httpd vhosts.conf”并再次尝试启动Apache,它会立即启动并停止
我不明白我遗漏了什么。从include行的开头删除散列
apache httpd.conf
#Listen [::]:80
Listen *:8080
# Virtual hosts
include "conf/extra/httpd-vhosts.conf"
你检查过你的Apache日志了吗?
apache httpd.conf
#Listen [::]:80
Listen *:8080
# Virtual hosts
include "conf/extra/httpd-vhosts.conf"