阿帕奇无法启动的放浪 [英] Apache fails to start on Vagrant

查看:147
本文介绍了阿帕奇无法启动的放浪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我流浪的环境我有一个客人Ub​​untu的VirtualBox虚拟与默认设置的灯。

In my Vagrant environment I have a guest Ubuntu Virtualbox with a LAMP with default settings.

我在主机上在同一文件夹作为我Vagrantfile我的源$ C ​​$ C。所以在来宾Ubuntu的我可以访问安装文件/游民 DIR像这样

I have my source code on the host machine in the same folder as my Vagrantfile. So on the guest Ubuntu I can access the files in the mounted /vagrant dir like this

/vagrant
  /mysite
    /index.php
  /Vagrantfile

现在在我的Apache的配置我加一行

Now in my Apache config I add a line

Alias /mysite /vagrant/mysite

重装配置和重启动Apache后,我可以去本地主机:8558 / mysite的/ index.php文件和它的作品

问题是,当我重​​装VirtualBox虚拟与流浪汉重装启动Apache服务的之前安装 /游民文件夹中。所以阿帕奇找不到别名目录,并无法启动。我必须手动启动它,然后

The problem is that when I reload Virtualbox with vagrant reload it starts Apache service before mounting the /vagrant folder. So Apache can't find the aliased dir and fails to start. i have to start it manually then

我的问题是 - ?有没有延迟的Apache开始,使其在安装后启动方式

My question is - is there a way to delay Apache start so that it starts after the mounting?

更新:作为一种变通方法,我添加脚本到crontab,作为描述开机后阿帕奇30秒开始的此处。但我不知道是否有更好的解决方案。

Update: As a workaround I added script to the crontab that starts apache 30 seconds after the boot as described here. But I wonder if there is a better solution.

推荐答案

如果新贵安装(如在Ubuntu),流浪发出无业游民式事件。请参见 http://serverfault.com/a/568033/179583 来的想法。在你的脚本就可以(重新)启动Apache服务器。

If upstart is installed (as in Ubuntu), Vagrant emits "vagrant-mounted" event. See http://serverfault.com/a/568033/179583 to get the idea. In your script you can (re)start the Apache server.

顺便说一句,我有一种感觉,新的Apache的版本只是发出警告,但即使文档根不存在仍然启动。同样nginx的。

Btw, I have a feeling that newer Apache versions just warn, but still start even if the doc root doesn't exist. The same with nginx.

这篇关于阿帕奇无法启动的放浪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆