Mac OS X Lion 升级后无法让我的虚拟主机恢复运行
将 MacBook Pro 升级到 Mac OS X Lion 后,我无法再像以前一样运行“Zend Server”。起初,“Zend Server”通过从命令行启动它给了我一些服务错误。我通过全新安装 Zend Server 解决了这个问题。
新安装后,Zend Server 运行良好,没有任何问题。所以现在我想放回我的 zend 项目。我备份了我的虚拟主机文件并将其放回去,看来Lion没有碰我的主机文件,所以我也没有碰(只是检查过)。我做了以下事情;
- 将我的虚拟主机之一放回conf/extra/httpd-vhosts.conf(只需检查一个)。
- 取消注释 conf/httpd.conf 中包含的 vhost
- 检查我的主机文件
- 从命令行重新启动 zend 服务器
此后我仍然无法通过浏览到 http://foo.localhost:10088/
Vhosts
<VirtualHost *:10088>
ServerAdmin [email protected]
SetEnv APPLICATION_ENV "development"
DocumentRoot "/Users/nicky/Zend/workspaces/DefaultWorkspace7/foo/public"
ServerName foo.localhost
ErrorLog "/Users/nicky/Zend/workspaces/foo-log"
CustomLog "/Users/nicky/Zend/workspaces/foo-log" common
</VirtualHost>
Hosts
127.0.0.1 localhost
127.0.0.1 dummy-host.example.com
127.0.0.1 dummy-host2.example.com
127.0.0.1 foo.localhost
我不确定这是否会对问题产生影响,但是通过从 命令行,我得到以下信息:
MacBook-Pro-van-Nicky-Klaasse:~ nickyklaasse$ sudo /usr/local/zend/bin/zendctl.sh
restarthttpd: Could not reliably determine the server's fully qualified domain name,
using MacBook-Pro-van-Nicky-Klaasse.local for ServerName
问候, 尼基
After upgrading my MacBook Pro to Mac OS X Lion I am not able anymore to get my 'Zend Server' running like before. At first the 'Zend Server' gave me servile errors by starting it from the command line. I fix this by doing a complete new installation of Zend Server.
After this new installation Zend Server runs fine and no problems at all. So now I want to put back my zend projects. I made a backup of my vhost file and put it back, it seems to be Lion didn't touch my host file so I didn't touch either (just checked). I did the follow things;
- Put one of my vhosts back in conf/extra/httpd-vhosts.conf (just one to check).
- Uncomment the vhost include in conf/httpd.conf
- Checked my host file
- Restart zend server from command line
After this I still cant reach the project by browsing to http://foo.localhost:10088/
Vhosts
<VirtualHost *:10088>
ServerAdmin [email protected]
SetEnv APPLICATION_ENV "development"
DocumentRoot "/Users/nicky/Zend/workspaces/DefaultWorkspace7/foo/public"
ServerName foo.localhost
ErrorLog "/Users/nicky/Zend/workspaces/foo-log"
CustomLog "/Users/nicky/Zend/workspaces/foo-log" common
</VirtualHost>
Hosts
127.0.0.1 localhost
127.0.0.1 dummy-host.example.com
127.0.0.1 dummy-host2.example.com
127.0.0.1 foo.localhost
I am not sure if this can have effect on the problem, but by restarting zend from the
command line, i get the follow:
MacBook-Pro-van-Nicky-Klaasse:~ nickyklaasse$ sudo /usr/local/zend/bin/zendctl.sh
restarthttpd: Could not reliably determine the server's fully qualified domain name,
using MacBook-Pro-van-Nicky-Klaasse.local for ServerName
Regards,
Nicky
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也遇到过类似的问题。我一直在寻找答案,找到了一些解决方案,但似乎都不起作用。
最终使它起作用的唯一一件事(甚至不确定它实际上是如何帮助的),是进入系统首选项 ->共享并启用网络共享。这通常是启动你的 apache2 服务器,但我没有使用默认的服务器,我正在运行另一个具有不同 httpd 配置的 apache2 进程。无论如何,在启动并停止它(从系统首选项窗口)之后,它似乎正在工作。
可能有用的一件事是检查 error_log 以及 /var/log/apache2/ 中的 access_log。检查 access_log 以查看尝试解析的地址是什么。起初,每当我通过虚拟主机在我的网站上发出请求时,在我的访问日志中我只有 127.0.0.1,这是不正确的。工作后,我可以看到请求是 www.example.com 而不是 localhost,这表明虚拟主机确实正在工作。
不确定这是否对您有帮助,请尝试一下,粘贴 access_log 和 error_log 最新行以查看可能存在问题的位置。
I've had similar problems as well with that. I've been searching around for an answer, found some solutions but none of them seemed to work.
The only thing that finally made it working (not even sure how it actually helped), is going into system preferences -> sharing and enabling web sharing. That is normally starting your apache2 server but I wasn't using the default one, I am running another apache2 process with a different httpd configuration. Anyway, after starting it and stopping it (from the system preferences window), it seemed like it was working.
One thing that could be useful is checking your error_log as well as the access_log in /var/log/apache2/. Check the access_log to see what is the address trying to be resolved. At first, whenever I was making a request on my website through the Virtual Host, in my access log I only had 127.0.0.1 which is incorrect. After it worked, I can see that the requests are www.example.com and not the localhost, showing that the virtual host is indeed working.
Not sure if that will help you, give it a try, paste the access_log and error_log latest lines to see where there could be a problem.