0

Since PageSpeed must be compiled along with Nginx, and I don't like the way instructions are in the Google page, I decided to follow another great one.

Anyway, I did everything there. And when I get to the service nginx restart, I got a FAILED error:

Restarting nginx (via systemctl):  Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
                                                           [FAILED]

systemctl status nginx.service -l output:

systemctl status nginx.service -l
nginx.service - SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server
   Loaded: loaded (/etc/rc.d/init.d/nginx)
   Active: failed (Result: exit-code) since mar 2015-03-17 12:59:03 EDT; 1min 21s ago
  Process: 19716 ExecStart=/etc/rc.d/init.d/nginx start (code=exited, status=203/EXEC)

mar 17 12:59:03 alemany.me systemd[1]: Starting SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server...
mar 17 12:59:03 alemany.me systemd[1]: nginx.service: control process exited, code=exited status=203
mar 17 12:59:03 alemany.me systemd[1]: Failed to start SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server.
mar 17 12:59:03 alemany.me systemd[1]: Unit nginx.service entered failed state.

journalctl -xn output:

journalctl -xn
-- Logs begin at mar 2015-03-17 11:09:37 EDT, end at mar 2015-03-17 13:05:46 EDT. --
mar 17 13:03:39 alemany.me systemd[1]: Starting SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy
-- Subject: Unit nginx.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nginx.service has begun starting up.
mar 17 13:03:39 alemany.me systemd[19761]: Failed at step EXEC spawning /etc/rc.d/init.d/nginx: Exec fo
-- Subject: Process /etc/rc.d/init.d/nginx could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- The process /etc/rc.d/init.d/nginx could not be executed and failed.
-- 
-- The error number returned while executing this process is 8.
mar 17 13:03:39 alemany.me systemd[1]: nginx.service: control process exited, code=exited status=203
mar 17 13:03:39 alemany.me systemd[1]: Failed to start SYSV: Nginx is an HTTP(S) server, HTTP(S) revers
-- Subject: Unit nginx.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nginx.service has failed.
-- 
-- The result is failed.
mar 17 13:03:39 alemany.me systemd[1]: Unit nginx.service entered failed state.
lines 1-25...skipping...
-- Logs begin at mar 2015-03-17 11:09:37 EDT, end at mar 2015-03-17 13:05:46 EDT. --                                                                                                           
mar 17 13:03:39 alemany.me systemd[1]: Starting SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server...                                                          
-- Subject: Unit nginx.service has begun with start-up                                                                                                                                         
-- Defined-By: systemd                                                                                                                                                                         
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel                                                                                                                        
--                                                                                                                                                                                             
-- Unit nginx.service has begun starting up.                                                                                                                                                   
mar 17 13:03:39 alemany.me systemd[19761]: Failed at step EXEC spawning /etc/rc.d/init.d/nginx: Exec format error                                                                              
-- Subject: Process /etc/rc.d/init.d/nginx could not be executed                                                                                                                               
-- Defined-By: systemd                                                                                                                                                                         
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel                                                                                                                        
--                                                                                                                                                                                             
-- The process /etc/rc.d/init.d/nginx could not be executed and failed.                                                                                                                        
--                                                                                                                                                                                             
-- The error number returned while executing this process is 8.                                                                                                                                
mar 17 13:03:39 alemany.me systemd[1]: nginx.service: control process exited, code=exited status=203                                                                                           
mar 17 13:03:39 alemany.me systemd[1]: Failed to start SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server.                                                     
-- Subject: Unit nginx.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nginx.service has failed.
-- 
-- The result is failed.
mar 17 13:03:39 alemany.me systemd[1]: Unit nginx.service entered failed state.
mar 17 13:05:46 alemany.me systemd[1]: Starting SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server...
-- Subject: Unit nginx.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nginx.service has begun starting up.
mar 17 13:05:46 alemany.me systemd[19766]: Failed at step EXEC spawning /etc/rc.d/init.d/nginx: Exec format error
-- Subject: Process /etc/rc.d/init.d/nginx could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- The process /etc/rc.d/init.d/nginx could not be executed and failed.
-- 
-- The error number returned while executing this process is 8.
mar 17 13:05:46 alemany.me systemd[1]: nginx.service: control process exited, code=exited status=203
mar 17 13:05:46 alemany.me systemd[1]: Failed to start SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server.
-- Subject: Unit nginx.service has failed

I thought maybe something was listening to port 80. Here's the "netstat" output:

netstat -punta
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      899/master          
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      747/sshd            
tcp        0     36 128.199.42.29:22        200.55.154.30:38580     ESTABLISHED 9536/sshd: root@pts 
tcp6       0      0 ::1:25                  :::*                    LISTEN      899/master          
tcp6       0      0 :::22                   :::*                    LISTEN      747/sshd            
udp        0      0 0.0.0.0:33440           0.0.0.0:*                           344/avahi-daemon: r 
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           344/avahi-daemon: r

Anyway, I have no idea why is happening that. I installed that on a CentOS 7 VPS which is in zero state. Nothing else is installed there.

Thanks in advance.

1

Make sure the init script is executable:

chmod +x /etc/init.d/nginx

Also check the selinux status. You can temporarily disable it by issuing the following command:

setenforce 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.