I installed nginx on RevPi with:
Code: Select all
sudo apt install nginx
Code: Select all
sudo /etc/init.d/nginx start
After a reboot the nginx was not running any more.
I thought it would be possible to enable autostart with
Code: Select all
sudo systemctl enable nginx
I see the following erorrs in the daemon.log:
Code: Select all
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)
nginx[2601]: 2024/08/03 18:16:18 [emerg] 2601#2601: open() "/var/log/nginx/access.log" failed (2: No such file or directory)
nginx[2601]: nginx: configuration file /etc/nginx/nginx.conf test failed
systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
nginx.service: Failed with result 'exit-code'.
Code: Select all
sudo /etc/init.d/nginx start
Code: Select all
Starting nginx (via systemctl): nginx.serviceJob for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
failed!
Code: Select all
sudo mkdir /var/log/nginx
cd nginx
sudo nano access.log
sudo nano error.log
Code: Select all
sudo /etc/init.d/nginx start
How is it possible to create directories and files at boot time befor starting nginx?
Or how do I get the nginx autostart working?