Ubuntu 16.04 running on a vagrant
virtual machine on a Windows 8.1 host.
My xdebug.ini
file is symlinked to a directory that's shared with the host machine.
(This is so I can create new machines and have xdebug.ini
set up how I want, and and edits I make to it are always available on the Windows host - I don't have to worry about backing up configurations from the VM)
It seems like the directory is mounted after apache has been started during boot. So I always have to restart apache to load xdebug.
Can I make it so that apache starts after the shared directory is mounted? Or automatically restart apache after startup, so I don't have to do it manually?
Ok, so I figured out an answer. I'm not super familiar with manipulating the linux boot sequence and even though this is a
vagrant
machine, I didn't want to break it.So I found a
vagrant
solution for my problem.I just added this bash script,
startup.sh
, to the virtual machine in a directory shared with the host:Then I modified my
Vagrantfile
to add the following line:Or, you could skip the separate bash script and run it
inline
in theVagrantfile
as Karl suggested in the comments:So, now my VM restarts Apache after boot, and everything works as I wanted it to.