CentOS7.5下安裝nginx --項目部署


1、安裝ngnix一些依賴包

[root@VM_39_157_centos ~]# yum -y install gcc gcc-c++ openssl-devel pcre-devel httpd-tools

2、下載nginx-1.16.0

[root@VM_39_157_centos ~]# wget http://nginx.org/download/nginx-1.16.0.tar.gz

3、解壓二進制包

[root@VM_39_157_centos ~]# tar -zxf nginx-1.16.0.tar.gz

4、執行配置文件,指定需要的模塊

[root@VM_39_157_centos nginx-1.14.0]# useradd nginx

[root@VM_39_157_centos nginx-1.14.0]# ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_mp4_module --with-http_flv_module

5、執行編譯和安裝

[root@VM_39_157_centos nginx-1.14.0]# make && make install

6、建立軟鏈接

ln -s /usr/local/nginx/sbin/nginx /usr/sbin

7、啟動nginx

[root@VM_39_157_centos ~]# nginx

8、查看nginx占用的端口

[root@VM_39_157_centos ~]# netstat -anptu | grep nginx

9、關閉nginx

[root@instance-mtfsf05r nginx-1.16.0]# nginx -s stop

10、查看nginx日版本

[root@instance-mtfsf05r nginx-1.16.0]# nginx -v

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM