1

I built a fresh VM built from the std Ubuntu 18/04 LTS x64 Server image.

Installed updates, then installed VBox Guest Additions following the simple steps outlined here.

Installed nginx with:

sudo apt-get install nginx

I check that the service is running;

papa@papa:~$ systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-05-30 18:01:37 UTC; 14s ago
     Docs: man:nginx(8)
  Process: 823 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 783 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 832 (nginx)
    Tasks: 2 (limit: 1112)
   CGroup: /system.slice/nginx.service
           ├─832 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           └─840 nginx: worker process

May 30 18:01:37 papa systemd[1]: Starting A high performance web server and a reverse proxy server...
May 30 18:01:37 papa systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
May 30 18:01:37 papa systemd[1]: Started A high performance web server and a reverse proxy server.

Upon running nginx -t I get:

papa@papa:~$ nginx -t
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2018/05/30 18:02:09 [warn] 1234#1234: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2018/05/30 18:02:09 [emerg] 1234#1234: open() "/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/nginx.conf test failed

As this is a clean installation, why would nginx not have permissions it requires to write to the log? Also, why the Failed to parse PID? Did I miss a step somewhere?

1

0

You must log in to answer this question.

Browse other questions tagged .