linux下快速安裝nginx__linux

來源:互聯網
上載者:User
一、安裝nginx 
    1、在nginx官方網站下載一個包,下載地址是: http://nginx.org/en/download.html  
    2、WinSCP(ftp上傳工具).exe FTP 上傳工具上傳達到CentOS中 
    3、我是先建一個目錄,把要用的到的安裝包放到一起. 
    #mkdir /home/ 
    #tar zxf nginx-1.4.1.tar.gz 
    #cd nginx-1.4.1 
    4、安裝pcre開發包 
    #yum install -y pcre-devel 
    5、如果安裝出現在下面的錯誤是缺少編譯環境。安裝編譯源碼所需的工具和庫 
    ./configure: error: C compiler cc is not found 
    #yum install gcc gcc-c++ ncurses-devel perl 
    6、安裝cmake,從http://www.cmake.org下載源碼並編譯安裝 
    #yum -y install make gcc gcc-c++ ncurses-devel 
    #yum -y install zlib zlib-devel 
    7、如果需要ssl功能需要openssl庫 
    #yum -y install openssl openssl--devel 
    8、安裝nginx 
    #cd nginx-1.4.1 
    #./configure --prefix=/opt/nginx 
    #make 
    #make install 
    9、啟動服務 
    #/opt/nginx/sbin/nginx  -c /opt/nginx/conf/nginx.conf 
    10、停止服務 
     #/opt/nginx/sbin/nginx -s stop 
    11、查看連接埠佔用情況 
    #netstat -tunlp 
    12、如果其它機器無法訪問,解決方案如下: 
    #/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT 
    然後儲存: 
    #/etc/rc.d/init.d/iptables save 
    重啟防火牆 
    #/etc/init.d/iptables restart
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.