Localhost vhost设置后Wamp服务未启动
最近,我在httpd vhosts文件中做了一些更改,以创建一个虚拟主机。之后,wamp图标状态不再变为绿色,因此保持橙色。我检查了是否通过测试端口80运行了其他http程序,但没有发现要运行的程序。我想在配置虚拟主机时可能会出现一些错误。下面是我在wamp停止工作之前试过的。请告诉我所做的配置是否正确。请建议一些在am错误中配置vhosts文件的解决方案 这是我在httpd vhosts文件中包含的行Localhost vhost设置后Wamp服务未启动,localhost,wamp,virtualhost,Localhost,Wamp,Virtualhost,最近,我在httpd vhosts文件中做了一些更改,以创建一个虚拟主机。之后,wamp图标状态不再变为绿色,因此保持橙色。我检查了是否通过测试端口80运行了其他http程序,但没有发现要运行的程序。我想在配置虚拟主机时可能会出现一些错误。下面是我在wamp停止工作之前试过的。请告诉我所做的配置是否正确。请建议一些在am错误中配置vhosts文件的解决方案 这是我在httpd vhosts文件中包含的行 <VirtualHost *:80> ServerAdmin web
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "c:/wamp/www"
ServerName tastingroom.com
#ServerAlias www.dummy-host.example.com
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:\wamp\www"
ServerName tastingroom.com
ServerAlias www.tastingroom.com
ErrorLog "logs/tastingroom-error.log"
CustomLog "logs/tastingroom-access.log" common
<directory "c:\wamp\www">
Option Indexes FollowSymLinks
AllowOerride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</directory>
</VirtualHost>
我认为不允许使用相同的服务器名称,请检查apache错误日志,看看它显示了什么错误消息。此外,您的VirtualHost条目应该位于下面,并删除第一个条目,因为它是多余的
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:\wamp\www"
ServerName tastingroom.com
ServerAlias www.tastingroom.com tastingroom.com
ErrorLog "logs/tastingroom-error.log"
CustomLog "logs/tastingroom-access.log" common
<directory "c:\wamp\www">
Option Indexes FollowSymLinks
AllowOerride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</directory>
</VirtualHost>
服务器管理员webmaster@dummy-host2.example.com
DocumentRoot“c:\wamp\www”
ServerName tastingroom.com
ServerAlias www.tastingroom.com tastingroom.com
ErrorLog“logs/tastingroom error.log”
CustomLog“logs/tastingroom access.log”通用
选项索引跟随符号链接
Allowerride all
命令拒绝,允许
全盘否定
允许从127.0.0.1开始
我希望您对这些命令非常了解,
但我还是建议你按照我的建议去做,因为我已经用下面的步骤成功了
这是我在ubuntu pc上做的
在终端类型中,输入以下命令
sudo nano /etc/hosts (then enter)
它可能会要求输入密码&稍后它会在中打开hosts文件,并按如下方式提供通用IP
127.0.0.1 project.local
接下来,执行命令
cd/etc/apache2/站点已启用
(然后输入)
它看起来像/etc/apache2/sites enabled$
然后
sudo nano项目。本地
确保project.local必须与我们之前输入的相同。。
现在,
ServerName project.local
DocumentRoot/var/www/project
最后
sudo/etc/init.d/apache2重启
127.0.0.1 project.local
<VirtualHost *:80>
ServerName project.local
DocumentRoot /var/www/project
</VirtualHost>