Nginx反向代理+DNS輪詢+IIS7.5 千萬PV 百萬IP 雙線 網站架構案例

原文地址:http://www.jb51.net/article/31844.htmjavascript

Nginx  ("engine x") 是一個高性能的 HTTP 和反向代理服務器,也是一個 IMAP/POP3/SMTP 代理服務器。 Nginx 是由 Igor Sysoev 爲俄羅斯訪問量第二的 Rambler.ru 站點開發的,它已經在該站點運行超過兩年半了。Igor 將源代碼以類BSD許可證的形式發佈。

  Nginx 的中文維基:http://wiki.codemongers.com/NginxChs

   在高併發鏈接的狀況下,Nginx是Apache服務器不錯的替代品。Nginx同時也能夠做爲7層負載均衡服務器來使用。根據個人測試結 果,Nginx 0.5.31 + PHP 5.2.4 (FastCGI) 能夠承受3萬以上的併發鏈接數,至關於同等環境下Apache的10倍。

   Nginx 超越 Apache 的高性能和穩定性,使得國內使用 Nginx 做爲 Web 服務器的網站也愈來愈多,其中包括新浪博客、新浪播客、網易新聞、騰訊網、搜狐博客等門戶網站頻道,六間房、56.com等視頻分享網站,Discuz! 官方論壇、水木社區等知名論壇,盛大在線、金山逍遙網等網絡遊戲網站,豆瓣、人人網、YUPOO相冊、金山愛詞霸、迅雷在線等新興Web 2.0網站。

    在 高併發鏈接的狀況下,Nginx是Apache服務器不錯的替代品。Nginx同時也能夠做爲7層負載均衡服務器來使用。根據個人測試結果,Nginx 0.8.46 + PHP 5.2.14 (FastCGI) 能夠承受3萬以上的併發鏈接數,至關於同等環境下Apache的10倍。

   根據個人經驗,4GB內存的服務器+Apache(prefork模式)通常只能處理3000個併發鏈接,由於它們將佔用3GB以上的內存,還得爲系統 預留1GB的內存。我曾經就有兩臺Apache服務器,由於在配置文件中設置的MaxClients爲4000,當Apache併發鏈接數達到3800 時,致使服務器內存和Swap空間用滿而崩潰。

  而這臺 Nginx 0.8.46 + PHP 5.2.14 (FastCGI) 服務器在3萬併發鏈接下,開啓的10個Nginx進程消耗150M內存(15M*10=150M),開啓的64個php-cgi進程消耗1280M內存 (20M*64=1280M),加上系統自身消耗的內存,總共消耗不到2GB內存。若是服務器內存較小,徹底能夠只開啓25個php-cgi進程,這樣 php-cgi消耗的總內存數才500M。

  在3萬併發鏈接下,訪問Nginx 0.8.46 + PHP 5.2.14 (FastCGI) 服務器的PHP程序,仍然速度飛快。下圖爲Nginx的狀態監控頁面,顯示的活動鏈接數爲28457(關於Nginx的監控頁配置,會在本文接下來所給出 的Nginx配置文件中寫明):

Highslide JS

Highslide JS
php

 





爲何Nginx的性能要比Apache高得多?這得益於Nginx使用了最新的epoll(Linux 2.6內核)和kqueue(freebsd)網絡I/O模型,而Apache則使用的是傳統的select模型。目前Linux下可以承受高併發訪問的 Squid、Memcached都採用的是epoll網絡I/O模型。

  處理大量的鏈接的讀寫,Apache所採用的select網絡I/O模型很是低效。下面用一個比喻來解析Apache採用的select模型和Nginx採用的epoll模型進行之間的區別:

   假設你在大學讀書,住的宿舍樓有不少間房間,你的朋友要來找你。select版宿管大媽就會帶着你的朋友挨個房間去找,直到找到你爲止。而epoll版 宿管大媽會先記下每位同窗的房間號,你的朋友來時,只需告訴你的朋友你住在哪一個房間便可,不用親自帶着你的朋友滿大樓找人。若是來了10000我的,都要 找本身住這棟樓的同窗時,select版和epoll版宿管大媽,誰的效率更高,不言自明。同理,在高併發服務器中,輪詢I/O是最耗時間的操做之 一,select和epoll的性能誰的性能更高,一樣十分明瞭。

    某公司有一站點,一天IP 430W,PV 3100W,以前採用5臺 DELL R610 作NLB,系統2008 IIS7.5.天天高峯期時都不堪重負.會出現如下狀況
1:遠程登錄巨慢無比
2:遠程登錄系統後沒法操做,表現爲鼠標移動緩慢,操做延時,系統呆滯.
3:CPU長期在80%以上,內存消耗極高
4:....
    通過部門討論後決定採用Nginx反向代理的架構替代目前不堪重負的站點.拓撲圖以下

Highslide JS
css

 



硬件:
前端採用2臺DELL M420刀片,虛擬4臺Centos5.8跑Nginx反向代理.
後端依舊採用5臺服務器,不過從硬件上也升級到DELL M420 2008系統 IIS7.5

網絡結構:
Nginx
電信 192.168.0.1 192.168.0.2
聯通 192.168.1.1 192.168.1.2

2008 IIS7.5
電信 192.168.0.10 192.168.0.11 192.168.0.13 192.168.0.14 192.168.0.15
聯通 192.168.1.10 192.168.1.11 192.168.1.13 192.168.1.14 192.168.1.15

域名xxx.com經過DNS輪詢到 Nginx前端,再根據你的配置甩向不一樣upstream

新架構部署好後能明顯感受整個站點打開都飛快,後端徹底無壓力狀態,這還並無開啓Nginx自帶的Cache.
如今這套架構天天承載百萬IP 千萬PV的訪問量 如圖
AWStats 統計結果
Highslide JS

Nginx性能圖以下
Highslide JS
html

 



單臺Centos CPU圖
Highslide JS
前端

 





安裝步驟:
一:
2臺宿主機虛擬成4臺這個步驟就略過,網上教程一大把.在這裏咱們每臺分配2個cpu共8個核心,內存6G,硬盤100G.
系統要求:Linux 2.6+ 內核,本文中的Linux操做系統爲CentOS 5.8 64位)
系統爲最精簡安裝文本界面,系統安裝好後配置系統.

#修改系統DNSjava


rm -rf /etc/resolv.conf
touch /etc/resolv.conf
echo -ne "nameserver 114.114.114.114\nnameserver 114.114.115.115\nsearch localdomain" >>/etc/resolv.conf



#修改系統源node

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget http://mirrors.163.com/.help/CentOS5-Base-163.repo
cp CentOS5-Base-163.repo /etc/yum.repos.d/



#yum 升級安裝,根據需求本身行刪除linux

yum install -y lrzsz gcc gcc-c++ make flex autoconf automake vixie-cron libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel kernel-devel wget patch ntp libevent m4 zip unzip gd gd-devel file libtool-libs gmp-devel pspell-devel mod_perl-devel parted apr-util readline-devel sysstat vim* popt-devel patch openssh-clients net-snmp net-snmp-devel net-snmp-utils net-snmp-libs



#設置ssh下 SecureCRT標籤顯示爲賬號@IP

nginx

touch /etc/sysconfig/bash-prompt-xterm
vim  /etc/sysconfig/bash-prompt-xterm
#添加如下一行
echo -ne "\e]2;${USER}@$(/sbin/ifconfig eth0|grep 'inet addr'|sed -e 's/^.*inet addr:\(.*\) Bcast.*$/\1/')\a"



#設置term類型是screen時(命令screen進入新窗口時)標籤顯示內容, 和xterm同樣c++

cp /etc/sysconfig/bash-prompt-xterm /etc/sysconfig/bash-prompt-screen



#設置term類型不是xterm和screen時標籤顯示內容, 也和xterm同樣

cp /etc/sysconfig/bash-prompt-xterm /etc/sysconfig/bash-prompt-default



#給予可執行權限

chmod +x /etc/sysconfig/bash-prompt-*



#修改文件句柄數爲65535,默認系統爲1024

echo "session required /lib64/security/pam_limits.so" >>/etc/pam.d/login
echo -ne "
* soft nofile 65534
* hard nofile 65534
" >>/etc/security/limits.conf



#添加iptables

rm -rf /etc/sysconfig/iptables
touch /etc/sysconfig/iptables
cat << EOF >> /etc/sysconfig/iptables
此段加入你的iptables規則
EOF

service iptables restart



#根據硬件優化Linux性能

cat << EOF >> /etc/sysctl.conf
# Add

#開啓SYN Cookies,當出現SYN等待隊列溢出時,啓用cookies來處理
net.ipv4.tcp_syncookies = 1

#表示SYN隊列的長度,默認爲1024,加大隊列長度爲8192,能夠容納更多等待鏈接的網絡鏈接數。
net.ipv4.tcp_max_syn_backlog = 65536

#每一個網絡接口接收數據包的速率比內核處理這些包的速率快時,容許送到隊列的數據包的最大數目
net.core.netdev_max_backlog =  262144

net.ipv4.tcp_fin_timeout = 30

#當keepalive起用的時候,TCP發送keepalive消息的頻度。缺省是2小時
net.ipv4.tcp_keepalive_time = 1200

#redis設置
net.core.somaxconn = 262144
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_timestamps = 0

#參數的值決定了內核放棄鏈接以前發送SYN+ACK包的數量
net.ipv4.tcp_synack_retries = 2

#在內核放棄創建鏈接以前發送SYN包的數量
net.ipv4.tcp_syn_retries = 2

#啓用timewait快速回收
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
#系統中最多有多少個TCP套接字不被關聯到任何一個用戶文件句柄上。這個限制僅僅是爲了防止簡單的DoS攻擊,不能過度依靠它或者人爲地減少這個值,更應該增長這個值(若是增長了內存以後)
net.ipv4.tcp_max_orphans = 3276800

#容許系統打開的端口範圍
net.ipv4.ip_local_port_range = 1024  65535


#增長系統文件描述符限制
fs.file-max = 65535

#容許更多的PIDs (減小滾動翻轉問題); may break some programs 32768
kernel.pid_max = 65536

# 增長TCP最大緩衝區大小
net.ipv4.tcp_rmem = 4096 4096 16777216
net.ipv4.tcp_wmem = 4096 4096 16777216
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.eth0.send_redirects = 0
net.ipv4.conf.all.send_redirects = 0


#2012-8-30
#net.ipv4.ip_conntrack_max=1048576
#net.ipv4.netfilter.ip_conntrack_max=1048576
net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_wait=120
net.ipv4.netfilter.ip_conntrack_tcp_timeout_close_wait=60
net.ipv4.netfilter.ip_conntrack_tcp_timeout_fin_wait=120
net.ipv4.neigh.default.gc_thresh1=10240
net.ipv4.neigh.default.gc_thresh2=40960
net.ipv4.neigh.default.gc_thresh3=81920

#timewait的數量
net.ipv4.tcp_max_tw_buckets =6000

EOF



#刷新sysctl.conf

複製代碼 代碼以下:
/sbin/sysctl -p



#禁用ipv6

複製代碼 代碼以下:
echo -ne "alias net-pf-10 off\noptions ipv6 disable=1" >>/etc/modprobe.conf
/sbin/chkconfig --level 35 ip6tables off



#關閉 selinux

複製代碼 代碼以下:
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config



#將同步好的時間寫到CMOS裏

複製代碼 代碼以下:
sed -i 's#SYNC_HWCLOCK=no#SYNC_HWCLOCK=yes#' /etc/sysconfig/ntpd



#設置同步時間

複製代碼 代碼以下:
echo "0 6 * * * /usr/sbin/ntpdate 192.168.0.172;/sbin/hwclock -w; >/dev/null 2>&1" >>/var/spool/cron/root
service crond restart



#修改系統啓動級別

複製代碼 代碼以下:
sed -i 's/id:5:initdefault:/id:3:initdefault:/g' /etc/inittab



#禁止ctrl+alt+del

複製代碼 代碼以下:
sed -i "s/ca::ctrlaltdel:\/sbin\/shutdown -t3 -r now/#ca::ctrlaltdel:\/sbin\/shutdown -t3 -r now/"  /etc/inittab



二:
獲取相關開源程序:
Nginx 官方當前穩定版爲 nginx-1.2.4 ,我測試環境使用版本爲nginx-1.3.3
pcre-8.31
nginx_upstream_check_module
ngx_cache_purge-1.6
請自行從網絡下載

安裝步驟:

#新建WWW用戶組和WWW用戶

複製代碼 代碼以下:
groupadd www
useradd -g www www -s /bin/false



#建立相應的目錄

複製代碼 代碼以下:
mkdir -p /data/html/www
mkdir -p /data/proxy_temp_dir
mkdir -p /data/proxy_cache_path
mkdir -p /data/logs
chown -R www:www /data/proxy_cache_path
chown -R www:www /data/proxy_temp_dir
chown -R www:www /data/html/
chown -R www:www /data/logs



#安裝內核和openssl

複製代碼 代碼以下:
yum -y install openssl-devel kernel-devel



#安裝Pcre

複製代碼 代碼以下:
tar zxvf pcre-8.31.tar.gz
cd pcre-8.31
./configure --prefix=/usr/local/pcre
make
make install



#安裝nginx

複製代碼 代碼以下:
tar zxvf ngx_cache_purge-1.6.tar.gz
tar zxvf nginx-1.3.3.tar.gz
tar zxvf nginx_upstream_check_module.tar.gz
cd nginx-1.3.3
patch -p1 < /root/nginx_keepalived_install/nginx_upstream_check_module/check_1.2.2+.patch
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_realip_module --with-http_gzip_static_module --with-openssl=/usr/ --with-pcre=/root/nginx_keepalived_install/pcre-8.31 --add-module=/root/nginx_keepalived_install/ngx_cache_purge-1.6 --add-module=/root/nginx_keepalived_install/nginx_upstream_check_module
make
make install
cp /root/nginx_keepalived_install/cut_nginx_log.sh /usr/local/nginx/sbin/
chmod +x /usr/local/nginx/sbin/cut_nginx_log.sh
echo -ne "00 00 * * * /bin/bash  /usr/local/nginx/sbin/cut_nginx_log.sh" >>/var/spool/cron/root
service crond restart
chown -R www:www /usr/local/nginx/
cp /root/nginx_keepalived_install/nginx /etc/rc.d/init.d/
chmod +x /etc/rc.d/init.d/nginx
chkconfig nginx on





到這裏Nginx安裝完畢,目前Nginx全部的配置都是默認配置,我貼下我案例中的NGINX配置,若有錯誤請大牛們指導.

Nginx.conf

複製代碼 代碼以下:

user  www  www;
worker_processes 8;
worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;
worker_rlimit_nofile 204800;

error_log  /data/logs/error.log;

pid        logs/nginx.pid;


events {
    worker_connections  240800;
    use epoll;
}


http {
    include   nginx_load_balance.conf;
    #include    proxy.conf;
    include       mime.types;
    default_type  application/octet-stream;
    server_names_hash_bucket_size 128;

    #log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
             #'$status $body_bytes_sent "$http_referer" '
             #'"$http_user_agent" $http_x_forwarded_for';
    #access_log  /data/logs/access.log  access;

    sendfile        on;
    tcp_nopush     on;
    tcp_nodelay on;
    server_tokens off;
    keepalive_timeout 60;
    client_header_buffer_size 4k;
    #large_client_header_buffers 4 32k;
    client_max_body_size 10m;

    client_header_timeout  120s;
    client_body_timeout    120s;
    send_timeout           120s;

    gzip  off;
    gzip_min_length 1k;
    gzip_buffers 4 16k;
    output_buffers   1 512k;
    postpone_output  1460;
    #gzip_http_version 1.1;
    gzip_comp_level 4;
    gzip_types text/plain text/css text/javascript text/xml application/x-javascript application/xml application/xml+rss;
    gzip_vary on;

    server {
        listen       80;
        server_name  localhost;

        location / {
            rewrite ^ http://www.test.com$request_uri?;
      #root   /data/html/www;
            #index  index.html index.htm;
        }

        error_page  404              /data/html/www/404.html;

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location /status {
        stub_status on;
  access_log  off;
        }
  location /nstatus {
        check_status;
        access_log off;
        #allow SOME.IP.ADD.RESS;
        #deny all;
        }

    }
    include  vhost/*.conf;
}



nginx_load_balance.conf

複製代碼 代碼以下:
    upstream dx {
    ip_hash;
    server 192.168.0.11:80;
    server 192.168.0.12:80;
    server 192.168.0.13:80;
    server 192.168.0.14:80;
    server 192.168.0.15:80;
    check interval=3000 rise=2 fall=8 timeout=3000 type=http;
    check_http_send "GET / HTTP/1.0\r\n\r\n";
    check_http_expect_alive http_2xx http_3xx http_4xx;
    #server 192.168.0.30:80; backup;
    }


    upstream lt {
    ip_hash;
    server 192.168.1.11:80;
    server 192.168.1.12:80;
    server 192.168.1.13:80;
    server 192.168.1.14:80;
    server 192.168.1.15:80;
    check interval=3000 rise=2 fall=8 timeout=3000 type=http;
    check_http_send "GET / HTTP/1.0\r\n\r\n";
    check_http_expect_alive http_2xx http_3xx http_4xx;
    #server 192.168.1.30:80; backup;
    }



proxy.conf

複製代碼 代碼以下:
proxy_temp_path   /data/proxy_temp_dir;   #指定臨時文件目錄
proxy_cache_path  /data/proxy_cache_path levels=1:2 keys_zone=cache_one:2000m inactive=1d max_size=1g;
client_body_buffer_size  512k; #增長緩衝區代理緩衝客戶端請求的最大字節數
proxy_connect_timeout    60;   #增長鏈接後端服務器超時時間
proxy_read_timeout       60;   #增長後端服務器響應請求超時時間
proxy_send_timeout       60;   #增長後端服務器發送數據超時時間
proxy_buffer_size        32k;   #增長代理請求緩存區大小
proxy_buffers           4 64k;  #增長
proxy_busy_buffers_size 128k;   #增長系統繁忙時可申請的proxy_buffers大小
proxy_temp_file_write_size 128k;  #增長proxy緩存臨時文件的大小
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;   #增長故障轉移,若是後端的服務器返回50二、50四、執行超時等錯誤,自動將請求轉發到upstream負載均衡池中的另外一臺服務器,實現故障轉移。
proxy_cache cache_one;  #增長使用web緩存區cache_one



以上是Nginx配置,下面是vhost中網站配置
xxxx_com.conf

複製代碼 代碼以下:
server
{
listen       192.168.0.1;
server_name  xxx.com;

access_log  /data/logs/dx.log  dx;

location /
     {
      proxy_next_upstream http_502 http_504 error timeout invalid_header;
     # proxy_cache cache_one;
     # proxy_cache_valid  200 304 12h;
     # proxy_cache_key $host$uri$is_args$args;
     proxy_set_header Host $http_host;
     #proxy_set_header X-Real-IP $remote_addr;
     # proxy_set_header X-Forwarded-For $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_headers_hash_max_size 51200;
      proxy_headers_hash_bucket_size 6400;

      proxy_pass http://dx;

      #if ($request_uri ~* "^/upload/") {
      #add_header Cache-Control 'max-age=86400';
      #}

      location ~* \.(gif|jpg|jpeg|png|flv|swf|ico)$
      {
      proxy_set_header Host $http_host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_pass http://dx;
      add_header Cache-Control 'max-age=86400';
      }

      location ~* \.(js)$
      {
      proxy_set_header Host $http_host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_pass http://dx;
      add_header Cache-Control 'max-age=600';
      }

      #expires      -1;
      add_header Cache-Control 'no-store, no-cache, must-revalidate';
      add_header Pragma no-cache;
      }

  location ~ /purge(/.*)
    {
     allow            127.0.0.1;
     allow            192.168.0.0/16;
     deny            all;
     #proxy_cache_purge    cache_one   $host$1$is_args$args;
    }

    location ~ .*\.(php|jsp|cgi|asp|aspx|flv|swf|xml)?$
    {
         proxy_set_header Host $http_host;
         #proxy_set_header X-Forwarded-For  $remote_addr;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_pass http://dx;
    }

}

server
{
listen       192.168.1.1;
server_name xxxx.com;

access_log  /data/logs/lt.log  lt;

location /
     {
      proxy_next_upstream http_502 http_504 error timeout invalid_header;
      #proxy_cache cache_one;
      #proxy_cache_valid  200 304 12h;
      #proxy_cache_key $host$uri$is_args$args;
      proxy_set_header Host $http_host;
      #proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_headers_hash_max_size 51200;
      proxy_headers_hash_bucket_size 6400;
      proxy_pass http://lt;

      #if ($request_uri ~* "^/upload/") {
      #add_header Cache-Control 'max-age=86400';
      #}

      location ~* \.(gif|jpg|jpeg|png|flv|swf|ico)$
      {
      proxy_set_header Host $http_host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_pass http://lt;
      add_header Cache-Control 'max-age=86400';
      }

      location ~* \.(js)$
      {
      proxy_set_header Host $http_host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_pass http://lt;
      add_header Cache-Control 'max-age=600';
      }

      #expires      -1;
      add_header Cache-Control 'no-store, no-cache, must-revalidate';
      add_header Pragma no-cache;
      }

  location ~ /purge(/.*)
    {
     allow            127.0.0.1;
     allow            192.168.0.0/16;
     deny            all;
     #proxy_cache_purge    cache_one   $host$1$is_args$args;
    }

    location ~ .*\.(php|jsp|cgi|asp|aspx|flv|swf|xml)?$
    {
         proxy_set_header Host $http_host;
         #proxy_set_header X-Forwarded-For  $remote_addr;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_pass http://lt;
    }

}



至此,一套完整的Nginx反向代理所有結束.


網站沒法打開排查1:ping域名看解析是否正常且是否連通.2:配置本機Hosts指向後端單機IIS查看網站是否正常訪問.3:檢查前端Nginx進程和端口是否存在,ps -ef |grep nginxnetstat -an |grep 80系統相關配置NginxNginx目錄/usr/local/nginx//usr/local/nginx/conf/nginx.conf Nginx主配置文件/usr/local/nginx/conf/nginx_load_balance.conf Nginx反向代理輪詢配置文件/usr/local/nginx/conf/proxy.conf Nginx緩存配置相關/usr/local/nginx/conf/vhost/ Nginx虛擬主機配置目錄Snmp/etc/snmp/snmpd.conf日誌切割/root/scripts/ 全部日誌切割腳本都在這個目錄crontab -l 列出計劃任務crontab -e 編輯計劃任務系統相關操做Nginx重啓Nginx service nginx restart重載Nginx配置文件 service nginx reload檢測Nginx配置語法是否正確 /usr/local/nginx/sbin/nginx -t關閉Nginx service nginx stop啓動Nginx service nginx startSnmp重啓Snmp service snmpd restart關閉Snmp service snmpd stop啓動Snmp service snmpd start

相關文章
相關標籤/搜索