Nginx-安裝-運行訪問頁面


1、安裝依賴

yum -y install gcc openssl-devel pcre-devel zlib-devel

 

 

2、解壓文件

tar -zxvf nginx-1.8.1.tar.gz

3、configure配置

 

 

 

進入解壓后的源碼目錄,然后執行configure命令進行配置。此時在/usr/soft/目錄下可以看到生成的nginx目錄。安裝好后,會在/usr/soft下生成nginx目錄(這是我編譯前指定的),這個目錄就是nginx的軟件了。

[root@asus soft]# ./nginx-1.8.1/configure --prefix=/usr/soft/nginx
[root@asus /]# cd /usr/soft/nginx
[root@asus nginx]# ll

 

 

 4、編譯並安裝

[root@asus nginx]# make && make install

 

5、啟動命令

[root@asus nginx]# ./sbin/nginx

6、關閉防火牆或者添加防火牆放行端口

這里只演示關閉防火牆命令:centos-6系統命令和centos-7命令不一樣。

centos-6:

[root@asus nginx]# service iptables stop

7、瀏覽器訪問

默認80端口,地址欄輸入:http://192.168.111.240/

 


免責聲明!

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



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