Welcome! Log In Create A New Profile

Advanced

Init script on Custom built nginx

Posted by Pawangond 
Init script on Custom built nginx
March 09, 2018 02:17AM
Facing some problems after installing source built nginx
Installed using automatic pagespeed installer on NEW Ubuntu 16.04 (Clean install)
Doc Link : https://www.modpagespeed.com/doc/build_ngx_pagespeed_from_source

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

i.e it is source built and not from ubuntu repo

root@xyz:~# vi "/usr/local/nginx/conf/nginx.conf"
root@xyz:~# vi "/usr/local/nginx/conf/nginx.conf"
root@xyz:~# nginx -t
The program 'nginx' can be found in the following packages:
* nginx-core
* nginx-extras
* nginx-full
* nginx-light
Try: apt install <selected package>
root@xyz:~# vi "/usr/local/nginx/conf/nginx.conf"
root@xyz:~# sudo service nginx restart
Failed to restart nginx.service: Unit nginx.service not found.
root@xyz:~# sudo /usr/sbin/nginx -V
sudo: /usr/sbin/nginx: command not found
root@xyz:~# sudo /usr/local/nginx -V
sudo: /usr/local/nginx: command not found
root@xyz:~# sudo /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.13.9
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)
configure arguments: --add-module=/root/incubator-pagespeed-ngx-latest-stable
root@xyz:~# sudo /usr/local/nginx/sbin/nginx restart
nginx: invalid option: "restart"
root@xyz:~# sudo service nginx restart
Failed to restart nginx.service: Unit nginx.service not found.
root@xyz:~# sudo systemctl restart nginx
Failed to restart nginx.service: Unit nginx.service not found.
root@xyz:~# sudo service nginx restart
Failed to restart nginx.service: Unit nginx.service not found.
root@xyz:~# /usr/local/nginx/sbin/nginx -s reload
nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
root@xyz:~# /usr/local/nginx/sbin/nginx start
nginx: invalid option: "start"
root@xyz:~# ps aux | grep nginx
root 20012 0.0 0.1 12944 1084 pts/0 S+ 06:50 0:00 grep --color=auto nginx


also i get only this when finding nginx

sudo find / -type f -name "nginx"
/usr/local/nginx/sbin/nginx
/root/nginx-1.13.9/objs/nginx



AFter Searching a lot on google finally i found that i need init script but still not sure which one to use
https://www.nginx.com/resources/wiki/start/topics/examples/initscripts/
linux init.d or upstart or systemd
and what i need to edit in those scripts

First time i have compiled nginx from source , so dont know much. earlier was using installing using apt-get



Edited 1 time(s). Last edit at 03/09/2018 02:20AM by Pawangond.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 290
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready