I am using Kirby on Ubuntu 16.04, and every time I reboot I have to login on my server, go to my website folder and type
sudo php -S 0.0.0.0:80
for the server to start.
What's a correct way of getting this to start automatically after a reboot?
Sorry for the trivial question, I just don't seem to be able to find a simple answer on the web...
You can use root's crontab with @reboot
directive. Edit it with sudo crontab -e
@reboot cd /path/to/directory && php -S 0.0.0.0:80
Notice that there is no sudo
before the php
command, because it's run from root's crontab.