PageSpeed는 Nginx로 컴파일해야 하는데, 구글 페이지에 설명된 방식이 마음에 들지 않아서 따라하기로 했습니다.다른훌륭한 것입니다.
아무튼 거기서 다 했어요. 도착했을 때 service nginx restart
FAILED 오류가 발생했습니다.
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
산출:
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
산출:
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
아마도 포트 80에서 뭔가가 수신 대기 중일 것이라고 생각했습니다. 이것은 "netstat" 출력입니다:
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
어쨌든 왜 이런 일이 발생하는지 모르겠습니다. 제로 상태의 CentOS 7 VPS에 설치했습니다. 거기에는 다른 것이 설치되어 있지 않습니다.
미리 감사드립니다.
답변1
init 스크립트가 실행 가능한지 확인하십시오.
chmod +x /etc/init.d/nginx
또한 selinux 상태를 확인하십시오. 다음 명령을 실행하여 일시적으로 비활성화할 수 있습니다.
setenforce 0