Nginx does not start

Asked

Viewed 867 times

1

I’m doing some tests with Nginx and I’m trying to error below when I try to start, how do I fix it?

systemctl start nginx

Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.

Exit to the command systemctl status nginx.service:

nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2018-06-16 18:35:03 -03; 53s ago
  Process: 4584 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
  Process: 4582 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)

jun 16 18:35:03 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server...
jun 16 18:35:03 localhost.localdomain nginx[4584]: nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permis>
jun 16 18:35:03 localhost.localdomain nginx[4584]: 2018/06/16 18:35:03 [warn] 4584#0: could not build optimal types_hash, you should increase either >
jun 16 18:35:03 localhost.localdomain nginx[4584]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
jun 16 18:35:03 localhost.localdomain nginx[4584]: 2018/06/16 18:35:03 [emerg] 4584#0: mkdir() "/var/lib/nginx/tmp/client_body" failed (13: Permissio>
jun 16 18:35:03 localhost.localdomain nginx[4584]: nginx: configuration file /etc/nginx/nginx.conf test failed
jun 16 18:35:03 localhost.localdomain systemd[1]: nginx.service: Control process exited, code=exited status=1
jun 16 18:35:03 localhost.localdomain systemd[1]: nginx.service: Failed with result 'exit-code'.
jun 16 18:35:03 localhost.localdomain systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
  • 2

    Errors indicate a lack of permission to create log file and temporary subdirectory. Is the user used to start Nginx correct? Was it installed from a package manager? Check the directories /var/lib/nginx and var/log/nginx are owned by the Nginx user.

  • Ok, solved...haha Another problem I installed php-fpm gave a systemctl enable php-fpm created a virtual host restarted all services but when access test.local it does not read the file as php it just as if it were an html not know print like this on the screen <? php phpinfo(); ? > ?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.