Re: [ngx-pagespeed-discuss] fail to start nginx on ubuntu 16.04 after successfull compiling and installing

139 views
Skip to first unread message
Message has been deleted

Otto van der Schaaf

unread,
Feb 15, 2017, 8:25:58 AM2/15/17
to ngx-pagespeed-discuss
Are there any lines of interest being written to /var/log/nginx/error.log?

Otto



On Wed, Feb 15, 2017 at 11:51 AM rhazor <rhaz...@gmail.com> wrote:
root@dev / # systemctl status nginx
* nginx.service - A high performance web server and a reverse proxy server
   
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   
Active: failed (Result: exit-code) since Wed 2017-02-15 10:04:37 UTC; 41min ago

Feb 15 10:04:37 dev systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 15 10:04:37 dev systemd[1]: nginx.service: Control process exited, code=exited status=203
Feb 15 10:04:37 dev systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Feb 15 10:04:37 dev systemd[1]: nginx.service: Unit entered failed state.
Feb 15 10:04:37 dev systemd[1]: nginx.service: Failed with result 'exit-code'.
root@dev
/ # nginx -t
nginx
: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx
: configuration file /etc/nginx/nginx.conf test is successful
root@dev
/ #


My process for compiling and installing:

1:
bash <(curl -f -L -sS https://ngxpagespeed.com/install) \ --nginx-version latest

2: ./configure

--sbin-path=/usr/sbin/nginx \
 
--conf-path=/etc/nginx/nginx.conf \
 
--http-log-path=/var/log/nginx/access.log \
 
--error-log-path=/var/log/nginx/error.log \
 
--lock-path=/var/lock/nginx.lock \
 
--pid-path=/run/nginx.pid \
 
--user=www-data \
 
--group=www-data \
 
--with-debug \
 
--with-pcre-jit \
 
--with-http_ssl_module \
 
--with-http_stub_status_module \
 
--with-http_realip_module \
 
--with-http_auth_request_module \
 
--with-http_addition_module \
 
--with-http_dav_module \
 
--with-http_flv_module \
 
--with-http_geoip_module \
 
--with-http_gunzip_module \
 
--with-http_gzip_static_module \
 
--with-http_image_filter_module \
 
--with-http_mp4_module \
 
--with-http_perl_module \
 
--with-http_random_index_module \
 
--with-http_secure_link_module \
 
--with-http_v2_module \
 
--with-http_sub_module \
 
--with-mail \
 
--with-mail_ssl_module \
 
--with-stream \
 
--with-stream_ssl_module \
 
--with-threads \
 
--with-file-aio \
 
--with-http_ssl_module \
 
--with-http_xslt_module \
 
--with-http_degradation_module \
 
--with-pcre \
 
--with-google_perftools_module \
 
--add-module=${DIRECTORY}/headers-more-nginx-module-${HEADERS_VERSION} \
 
--add-module=${DIRECTORY}/ngx_pagespeed-release-${PAGESPEED_VERSION}-beta

3: init

### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
### END INIT INFO
 
PATH
=/usr/local/nginx:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON
=/usr/local/nginx/sbin/nginx
NAME
=nginx
DESC
=nginx
 
test
-x $DAEMON || exit 0
 
# Include nginx defaults if available
if [ -f /etc/default/nginx ] ; then
 
. /etc/default/nginx
fi
 
set -e
 
case "$1" in
 start
)
 echo
-n "Starting $DESC: "
 start
-stop-daemon --start --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
 
--exec $DAEMON -- $DAEMON_OPTS
 echo
"$NAME."
 
;;
 stop
)
 echo
-n "Stopping $DESC: "
 start
-stop-daemon --stop --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
 
--exec $DAEMON
 echo
"$NAME."
 
;;
 restart
|force-reload)
 echo
-n "Restarting $DESC: "
 start
-stop-daemon --stop --quiet --pidfile \
 
/usr/local/nginx/logs/$NAME.pid --exec $DAEMON
 sleep
1
 start
-stop-daemon --start --quiet --pidfile \
 
/usr/local/nginx/logs/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
 echo
"$NAME."
 
;;
 reload
)
 echo
-n "Reloading $DESC configuration: "
 start
-stop-daemon --stop --signal HUP --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
 
--exec $DAEMON
 echo
"$NAME."
 
;;
 
*)
 N
=/etc/init.d/$NAME
 echo
"Usage: $N {start|stop|restart|force-reload}" &gt;&amp;2
 
exit 1
 
;;
esac
 
exit 0

Followed this guide partially https://www.markbarry.info/ (the nginx pagespeed section)

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.
Visit this group at https://groups.google.com/group/ngx-pagespeed-discuss.
For more options, visit https://groups.google.com/d/optout.

rhazor

unread,
Feb 15, 2017, 11:41:40 AM2/15/17
to ngx-pagespeed-discuss
2017/02/15 16:39:39 [info] 14592#14592: [ngx_pagespeed 1.11.33.4-0] No threading detected. Own threads: 1 Rewrite, 1 Expensive Rewrite.
Message has been deleted

Longinos

unread,
Feb 16, 2017, 8:23:17 AM2/16/17
to ngx-pagespeed-discuss
Hi Otto
The init script don´t seems a systemd init script but an old rc init script. An systenctl config file look as:
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

User must try to exec ngix directly ( #
root@dev / # /usr/bin/nginx ) if that work the problem is only the init script, not the executable itself
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages