Join the community today
Register Now

Nginx Can not restart nginx

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Peih, Mar 31, 2016.

Tags:
  1. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    1:59 AM
    i install centminmod then i tried to install owncloud 9 but when i restart nginx and php-fpm with nprestart command i got this issue and idk what to do with it.

    [root@sv1 domain.com]# nprestart
    Restarting nginx (via systemctl): Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. [FAILED]
    [root@sv1 domain.com]# systemctl status nginx.service
    * 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 Wed 2016-03-30 08:42:42 UTC; 26s ago
    Docs: man:systemd-sysv-generator(8)
    Process: 18439 ExecStop=/etc/rc.d/init.d/nginx stop (code=exited, status=0/SUCCESS)
    Process: 13417 ExecReload=/etc/rc.d/init.d/nginx reload (code=exited, status=0/SUCCESS)
    Process: 29466 ExecStart=/etc/rc.d/init.d/nginx start (code=exited, status=1/FAILURE)
    Main PID: 8570 (code=exited, status=0/SUCCESS)

    Mar 30 08:42:42 sv1.domain.com systemd[1]: Starting SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse ...r...
    Mar 30 08:42:42 sv1.domain.com nginx[29466]: Starting nginx: nginx: [emerg] unknown directive "pagespe...nf:1
    Mar 30 08:42:42 sv1.domain.com nginx[29466]: [FAILED]
    Mar 30 08:42:42 sv1.domain.com systemd[1]: nginx.service: control process exited, code=exited status=1
    Mar 30 08:42:42 sv1.domain.com systemd[1]: Failed to start SYSV: Nginx is an HTTP(S) server, HTTP(S) r...ver.
    Mar 30 08:42:42 sv1.domain.com systemd[1]: Unit nginx.service entered failed state.
    Mar 30 08:42:42 sv1.domain.com systemd[1]: nginx.service failed.

     
  2. Ahmad

    Ahmad Active Member

    209
    80
    28
    Apr 13, 2015
    Ratings:
    +150
    Local Time:
    8:59 AM
    1.9.9
    10.1.10
    Seems like an error in the nginx config.
    Try
    Code (Text):
    nginx -t
    to know where the issue is exactly.
     
  3. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    1:59 AM
    [root@sv1 ~]# nginx -t
    nginx: [emerg] unknown directive "pagespeed" in /usr/local/nginx/conf/pagespeed.conf:1
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
     
  4. Ahmad

    Ahmad Active Member

    209
    80
    28
    Apr 13, 2015
    Ratings:
    +150
    Local Time:
    8:59 AM
    1.9.9
    10.1.10
    Seems like you have uncommented pagespeed directives in your vhost configs but not compiled it.
    So you'll either need to comment out pagespeed stuff or compile it. Cannot really give more details on mobile :/.
     
  5. eva2000

    eva2000 Administrator Staff Member

    55,163
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:59 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    see news thread at Nginx 1.9.11 dynamic module compatibility

    123.08stable has disabled ngx_pagespeed and lua nginx modules due to incompatibility with nginx 1.9.11 dynamic modules. If you want ngx_pagespeed for now you need to update Centmin Mod to 123.09beta01 outlined here Beta Branch - Centmin Mod .09 beta branch Testing

    With 123.09beta01, set in /etc/centminmod/custom_config.inc persistent config file you create or already created and set:
    Code:
    NGINX_PAGESPEED=y
    and then recompile Nginx 1.9.13 via centmin.sh menu option 4
     
  6. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    1:59 AM
    i'm at Centmin Mod 123.09beta01. seem i miss file ngx_pagespeed.so in module.
    trying to recompile Nginx 1.9.13 via centmin.sh menu option 4 again. The process is very slow right?

    Update: work and there is ngx_pagespeed.so in module. But how do i know its working?
    i try: curl -sI localhost | grep X-Page-Speed but there is nothing happen.
     
  7. eva2000

    eva2000 Administrator Staff Member

    55,163
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:59 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    did you do above and create and set in /etc/centminmod/custom_config.inc
    Code (Text):
    NGINX_PAGESPEED=y

    before recompile nginx via centmin.sh menu option 4 ? speed of compile depends on your server hardware
     
  8. eva2000

    eva2000 Administrator Staff Member

    55,163
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:59 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    also a security update was just made for ngx_pagespeed so updated centmin mod 123.09beta01 code first

    Upgrading Centmin Mod Code to Latest Version



    Getting Started Guide step 19 outlines also how to keep Centmin Mod code updated or how to switch version branches.

    Centmin Mod LEMP stack's script code is constantly updated for improvements, bug fixes and security fixes so keeping the Centmin Mod code up to date is important. With Centmin Mod 1.2.3-eva2000.08) (123.08stable) and higher releases, a newly added centmin.sh menu option 23 allows much easier code updates and version branch swicthing via Git backed environment you can setup. For full details read the following links:
    Upgrading Centmin Mod involves 2 parts.
    1. Upgrading the actual Centmin Mod code outlined at Upgrade Centmin Mod. This is heart of Centmin Mod where the code is the engine that runs centmin.sh shell based menu and all the automation you're accustomed to. You can easily update within a Centmin Mod version branch or switch version branches via centmin.sh menu option 23 outlined here.
    2. Upgrade software that Centmin Mod installed or manages. For this part following outline at How to upgrade Centmin Mod software installed on your server.
    So essentially, you can upgrade from .07 to .08 in place, but not everything is upgraded as some things like server initial environment setup isn't changed i.e. how swap, tmp setup and allocation are created etc. The main parts from part 2 above are what in place upgrades do i.e. Nginx and PHP-FPM compilation and config/settings parameters and MariaDB version from 5.5 to 10.0.x. If you want the full environment changed including tmp and swap setup to .08's configuration, then you would need a fresh OS install and fresh .08 initial install. You can think of it like upgrading Windows 7 to Windows 8. An in place upgrade will upgrade code but won't change your computer environment from when you installed Windows 7 i.e. disk configuration and partition sizes won't change from when you initially installed Windows 7. Only way to change that would be fresh Windows 8 install.
     
  9. Peih

    Peih New Member

    24
    2
    3
    Mar 2, 2016
    Ratings:
    +2
    Local Time:
    1:59 AM
    i install centminmod directly from this command: curl -O https://centminmod.com/betainstaller7.sh && chmod 0700 betainstaller7.sh && bash betainstaller7.sh

    Update: working now and there is ngx_pagespeed.so in module. But how do i know its working?
    i try: curl -sI localhost | grep X-Page-Speed but there is nothing happen.

    How can i create a domain with pagespeed and memcached only?
     
  10. eva2000

    eva2000 Administrator Staff Member

    55,163
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:59 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+