Nginx的安裝

1、 What's Nginx?

Nginx [engine x] is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP proxy server.html

2、How to install?

準備工做:

  1. 系統:ubuntu16.04 server
  2. 網絡:暢通
  3. 方式:經過deb包安裝
  4. 其餘Linux平臺安裝方式參考:install nginx

安裝過程(本教程是root用戶執行命令,其餘用戶需在各個命令前加 sudo)

  1. wget -c https://nginx.org/keys/nginx_signing.key
  2. sudo apt-key add nginx_signing.key
  3. echo 'deb http://nginx.org/packages/ubuntu/ xenial nginx' >> /etc/apt/sources.list
  4. echo 'deb-src http://nginx.org/packages/ubuntu/ xenial nginx' >> /etc/apt/sources.list
  5. apt update
  6. apt install nginx
  7. nginx # 啓動nginx

3、How to use Nginx?

  • nginx -s signal

Where signal may be one of the following:

  • stop — fast shutdown
  • quit — graceful shutdown
  • reload — reloading the configuration file
  • reopen — reopening the log files

For Example:

  1. nginx -s quit
  2. nginx -s reload
  3. nginx -s restart

if the master process ID is 1628, to send the QUIT signal resulting in nginx’s graceful shutdown, execute:nginx

kill -s QUIT 1628ubuntu

For getting the list of all running nginx processes, the ps utility may be used, for example, in the following way:網絡

ps -ax | grep nginxui

相關文章
相關標籤/搜索