Apache fails to start on Vagrant

后端 未结 3 833
走了就别回头了
走了就别回头了 2021-02-19 16:32

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

I have my source code on the host machine in the same folder as my Vagrantf

3条回答
  •  一向
    一向 (楼主)
    2021-02-19 16:54

    I would like to add a little to Zauberfisch's answer (Apache fails to start on Vagrant)

    What needed to happen was this command needed to be run as a superuser AKA 'Sudo' so this was the command that was needed:

    `config.vm.provision "shell", inline: "sudo service apache2 restart", run: "always"`
    

    The reason why this didn't work for you without the sudo appears to be that Vagrant tries to run the command without /usr/sbin in PATH. For me, this worked just as well:

    `config.vm.provision "shell", inline: "/usr/sbin/service apache2 restart", run: "always"`
    

提交回复
热议问题