我正在尝试使用 WAMPServer 从我的笔记本电脑托管一个开发网站。我的目标是安装 WordPress 并让用户从家里登录。
- 我已经成功安装了 WAMPServer 2.2
- 我已将其添加到我的文件
127.0.0.1 localhost
中hosts
- 我已经
#
从前面移除了Include conf/extra/httpd-vhosts.conf
现在localhost
运行正常,直到我编辑httpd-vhost.conf
文件以包含以下内容:
<VirtualHost *:80>
SeverAdmin webmaster@localhost
ServerName localhost
DocumentRoot "C:/Program Files/WampServer2/www"
ErrorLog "C:/Program Files/WampServer2/www/logs/error.log"
CustomLog "C:/Program Files/WampServer2/www/logs/access.log" common
</VirtualHost>
重新启动 WAMPServer 后,图标保持橙色。如果我尝试将 WAMPServer 联机,我会收到一条标题为Aestan 托盘菜单陈述Could not execute menu item (internal error). [Exception] Could not preform service action: the service has not been started
。
(端口 80 测试为“未实际使用”。)
当我运行 时httpd.exe
,命令提示符打开,然后在我读到它之前立即关闭。我尝试了各种格式,但都<VirtualHost *:80>
无济于事,但是一旦我注释掉我的更改,我就能成功重新启动 WAMPServer 并访问localhost
。
我没有在任何地方找到有关此问题的帖子。
[编辑]:当我尝试重新启动包含的 WAMPServer 时,我的错误日志未包含任何新条目<VirtualHost *:80>
,但是当注释掉时,WAMPServer 启动和停止时没有错误,并且添加了以下几行:
Child 10084: Child process is running
Child 10084: Acquired the start mutex.
Child 10084: Starting 64 worker threads.
Child 10084: Starting thread to listen on port 80.
Child 10084: Starting thread to listen on port 80.
Parent: Received shutdown signal -- Shutting down the server.
Child 10084: Exit event signaled.
Child process is ending.
Child 10084: Released the start mutex
Child 10084: All worker threads have exited.
Child 10084: Child process is exiting Parent:
Child process exited successfully.
这些之前还有一行写着[warn] NameVirtualHost *:80 has no VirtualHosts
。
我已经尝试了好几天才让它工作。有什么想法可以解决它吗?
答案1
我遇到了一些类似的问题,但在 httpd.exe 命令提示符关闭之前成功截屏。我发现 httpd-vhost.conf 文件中以下条目中存在错误。
名称虚拟主机 *:80
nameVirtualHost 已弃用,只需使用 Listen 127.0.0.1:80