nginx.org --> use for our downloads
nginx.com --> product page with other enterprise product information
-----
apt-get install nginx --> in ubuntu
yum install epel-relase
yum install nginx --> in centos
ps aux | grep nginx
for centos, if it doesn't start automatically:
service nginx start
aux --> all users including boot processes
/etc/nginx ---> config files in ubuntu
for windows:
----------
nginx.org --> download binary
using source:
-----
apt-get update (or) yum check-update
apt-get install build-essential (or) yom groupinstall "Development Tools"
nginx.org -- download soruce code --mailine version -- wget url
tar -zxvf tarfile
cd nginx-<version>
./configure
install missing pacakges:
apt-get install libpcre2 libpcre3-dev zlipb1g zlib1g-devel libssl-dev
yum install pcre pcre-devel zlib zlib-devel openssl openssl-devel
./configure --sbin-path=/usr/bin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-pcre --pid-path=/var/run/nginx.pid --with-http_ssl_module
#enable bundled modules or thrid party modules in the configuration. more details of configuration: nginx.org/en/docs/configure.html
make
make install
ls -l /etc/nginx
nginx -v
create a systemd service
------
supported only from ubuntu 15 and centos 7 later
ps aux | grep nginx
nginx -h
nginx -s stop
sample file from systemd in https://www.nginx.com/nginx-wiki/build/dirhtml/start/topics/examples/initscripts/
https://www.nginx.com/nginx-wiki/build/dirhtml/start/topics/examples/systemd/
touch /lib/systemd/system/nginx.service and update as below
---
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStartPre=/usr/bin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/usr/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
--------------
systemctl start nginx
ps aux | grep nginx
systemctl status nginx
systemctl enable nginx
No comments:
Post a Comment