PageSpeedはNginxでコンパイルする必要がありますが、Googleページで説明されている方法が気に入らず、従うことにしました。その他素晴らしいです。
とにかくそこでやりました。到着時に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