日日操夜夜添-日日操影院-日日草夜夜操-日日干干-精品一区二区三区波多野结衣-精品一区二区三区高清免费不卡

公告:魔扣目錄網(wǎng)為廣大站長提供免費(fèi)收錄網(wǎng)站服務(wù),提交前請做好本站友鏈:【 網(wǎng)站目錄:http://www.ylptlb.cn 】, 免友鏈快審服務(wù)(50元/站),

點(diǎn)擊這里在線咨詢客服
新站提交
  • 網(wǎng)站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會員:747

目錄
  • 前言
  • 一、卸載NGINX
    • 1、停止Nginx軟件
    • 2、查找根下所有名字包含nginx的文件
    • 3、執(zhí)行命令 rm -rf *刪除nignx安裝的相關(guān)文件
    • 4、其他設(shè)置
  • 二、開始安裝NGINX
    • a、安裝所需插件
      • 1、安裝gcc
      • 2、pcre、pcre-devel安裝
      • 3、zlib安裝
      • 4、安裝openssl
    • b、安裝nginx
      • 1、下載nginx安裝包
      • 2、把壓縮包解壓到usr/local/java
      • 3、切換到cd /usr/local/java/nginx-1.9.9/下面
      • 4、切換到/usr/local/nginx安裝目錄
      • 5、配置nginx的配置文件nginx.conf文件,主要也就是端口
      • 6、啟動nginx服務(wù)
      • 8、訪問你的服務(wù)器IP
      • 9、nginx常用命令
  • 總結(jié)

前言

在開局配置Nginx時有可能會配置錯誤,報各種錯誤代碼。看不懂或者懶得去看這個報錯時,其實(shí)最簡單的方式是卸載并重裝咯。今天就帶大家一起學(xué)習(xí)下,如何徹底卸載nginx程序。

一、卸載NGINX

卸載nginx程序的詳細(xì)步驟

1、停止Nginx軟件

/usr/local/nginx/sbin/nginx -s stop

 如果不知道nginx安裝路徑,可以通過執(zhí)行ps命令找到nginx程序的PID,然后kill其PID

完全卸載nginx以及安裝的超詳細(xì)步驟

2、查找根下所有名字包含nginx的文件

find / -name nginx

完全卸載nginx以及安裝的超詳細(xì)步驟

3、執(zhí)行命令 rm -rf *刪除nignx安裝的相關(guān)文件

說明:全局查找往往會查出很多相關(guān)文件,但是前綴基本都是相同,后面不同的部分可以用*代替,以便快速刪除~

[root@qll251 ~]# rm -rf /usr/local/sbin/nginx
[root@qll251 ~]# rm -rf /usr/local/nginx
[root@qll251 ~]# rm -rf /usr/src/nginx-1.11.1
[root@qll251 ~]# rm -rf /var/spool/mail/nginx

4、其他設(shè)置

如果設(shè)置了Nginx開機(jī)自啟動的話,可能還需要下面兩步

  • chkconfig nginx off
  • rm -rf /etc/init.d/nginx

刪除之后,便可重新安裝nginx了 

二、開始安裝NGINX

a、安裝所需插件

1、安裝gcc

gcc是linux下的編譯器在此不多做解釋,感興趣的小伙伴可以去查一下相關(guān)資料,它可以編譯 C,C++,Ada,Object C和Java等語言

命令:查看gcc版本 

gcc -v

完全卸載nginx以及安裝的超詳細(xì)步驟

一般阿里云的centOS7里面是都有的,沒有安裝的話會提示命令找不到,

安裝命令:

yum -y install gcc

2、pcre、pcre-devel安裝

pcre是一個perl庫,包括perl兼容的正則表達(dá)式庫,nginx的http模塊使用pcre來解析正則表達(dá)式,所以需要安裝pcre庫。

安裝命令:

yum install -y pcre pcre-devel

完全卸載nginx以及安裝的超詳細(xì)步驟

3、zlib安裝

zlib庫提供了很多種壓縮和解壓縮方式nginx使用zlib對http包的內(nèi)容進(jìn)行g(shù)zip,所以需要安裝

安裝命令:

yum install -y zlib zlib-devel

4、安裝openssl

openssl是web安全通信的基石,沒有openssl,可以說我們的信息都是在裸奔。。。。。。

安裝命令:

yum install -y openssl openssl-devel

b、安裝nginx

1、下載nginx安裝包

wget http://nginx.org/download/nginx-1.9.9.tar.gz 

2、把壓縮包解壓到usr/local/java

tar -zxvf nginx-1.9.9.tar.gz

3、切換到cd /usr/local/java/nginx-1.9.9/下面

執(zhí)行三個命令:

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
 
make
 
make install

4、切換到/usr/local/nginx安裝目錄

完全卸載nginx以及安裝的超詳細(xì)步驟

5、配置nginx的配置文件nginx.conf文件,主要也就是端口

 
#user  nobody;
worker_processes  4;
worker_rlimit_nofile 65535;
 
#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
 
#pid        logs/nginx.pid;
 
 
events {
    worker_connections  65535;
	#use epoll;
	#accept_mutex off;
	#multi_accept off;
}
 
 
http {
    include       mime.types;
    default_type  application/octet-stream;
 
    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';
 
    #access_log  logs/access.log  main;
 
    sendfile       on;
    #tcp_nopush     on;
	#tcp_nodelay    on;
 
    #keepalive_timeout  0;
    keepalive_timeout  65;
	#send_timeout 10s;
    #types_hash_max_size 2048;
    #client_header_buffer_size 4k;
    #client_max_body_size 8m;
	
	proxy_connect_timeout 300;
    proxy_send_timeout 300;
    proxy_read_timeout 300;
    proxy_buffer_size 64k;
    proxy_buffers 4 64k;
    proxy_busy_buffers_size 128k;
    proxy_temp_file_write_size 128k;
 
    #gzip  on;
	
	upstream test123456 {
		ip_hash;
		server 192.168.0.192:8081;
		server 192.168.0.144:8081;
		server 192.168.0.203:8081;
    }
	
	upstream testjk123456 {
		#ip_hash;
		server 192.168.0.192:8081;
		server 192.168.0.144:8081;
		server 192.168.0.203:8081;
    }
 
    
 
 
    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;
 
    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}
 
 
    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;
 
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;
 
    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;
 
    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;
 
    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}
	
	server {
        listen       443 ssl;
        server_name  test.jjtech.cn;
		ssl_certificate      /usr/local/java/ng.crt;
        ssl_certificate_key  /usr/local/java//ng.key;
    
        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;
    
        #ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;
		
		ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:ECDH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!eNULL:!MD5:!DSS:!EXP:!ADH:!LOW:!MEDIUM;
		proxy_ssl_server_name on;
 
        #charset koi8-r;
		charset utf-8;
 
        #access_log  logs/host.access.log  main;
		#rewrite ^(.*)$ https://${server_name}$1 permanent;
		
		location /h5 {
            root   /usr/local/java;
            index  index.html index.htm;
        }
		
		location ~ ^/h5.*\.(css|jpeg|jpg|gif|js)$ {
            root   /usr/local/java;
        }
        
		
		location /bz {
            proxy_pass http://test123456/;
			proxy_send_timeout 18000;
			proxy_read_timeout 18000;
			proxy_connect_timeout 18000;
			
			proxy_set_header Upgrade $http_upgrade;
			proxy_set_header Connection  "upgrade";
	
        }
		
		location /api {
            proxy_pass http://testjk123456/;
			proxy_send_timeout 18000;
			proxy_read_timeout 18000;
			proxy_connect_timeout 18000;
			proxy_set_header Upgrade $http_upgrade;
			proxy_set_header Connection  "upgrade";
        }
		
		location / {
		   proxy_pass http://test123456/$request_uri;
		   proxy_set_header Upgrade $http_upgrade;
		   proxy_set_header Connection  "upgrade";
		 }
		 
		 location /apilogin {
		   proxy_pass http://test123456/$request_uri;
		   proxy_set_header Upgrade $http_upgrade;
		   proxy_set_header Connection  "upgrade";
		 }
		
		
		
        
        #error_page  404              /404.html;
 
        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
 
        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}
 
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}
 
        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }
 
}

可以按照自己服務(wù)器的端口使用情況來進(jìn)行配置

ESC鍵,wq!強(qiáng)制保存并退出

6、啟動nginx服務(wù)

切換目錄到/usr/local/nginx/sbin下面

完全卸載nginx以及安裝的超詳細(xì)步驟

 啟動nginx命令:

./nginx

8、訪問你的服務(wù)器IP

顯示

完全卸載nginx以及安裝的超詳細(xì)步驟

 說明安裝和配置都沒問題OK了

9、nginx常用命令

1.啟動nginx命點(diǎn):./nginx 

2.重啟nginx命令:./nginx -s reload

3. 停止 nginx 命令: ./nginx -s stop  或 ./nginx -s quit

4. 關(guān)閉nginx進(jìn)程:

ps -ef|grep nginx

命令 kill -9 8725 (進(jìn)程號 上面的)   則關(guān)閉nginx 

分享到:
標(biāo)簽:卸載 安裝 服務(wù)器 步驟 詳細(xì)
用戶無頭像

網(wǎng)友整理

注冊時間:

網(wǎng)站:5 個   小程序:0 個  文章:12 篇

  • 51998

    網(wǎng)站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會員

趕快注冊賬號,推廣您的網(wǎng)站吧!
最新入駐小程序

數(shù)獨(dú)大挑戰(zhàn)2018-06-03

數(shù)獨(dú)一種數(shù)學(xué)游戲,玩家需要根據(jù)9

答題星2018-06-03

您可以通過答題星輕松地創(chuàng)建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學(xué)四六

運(yùn)動步數(shù)有氧達(dá)人2018-06-03

記錄運(yùn)動步數(shù),積累氧氣值。還可偷

每日養(yǎng)生app2018-06-03

每日養(yǎng)生,天天健康

體育訓(xùn)練成績評定2018-06-03

通用課目體育訓(xùn)練成績評定