ubuntu 編譯安裝 nginx

來源:互聯網
上載者:User
更新源:apt-get update
升級軟體:apt-get upgrade
更新系統:apt-get dist-upgrade
apt-get install openssl
apt-get install libssl-dev
yum -y install openssl openssl-devel
groupadd www-data
useradd -g www-data www-data
以上亂扯可能會用到
下載 zlib pcre openssl
./configure --prefix=/usr/local/tengine --user=www-data --group=www-data --with-zlib=/home/zlib-1.2.8 --with-pcre=/home/pcre-8.36 --with-openssl=/home/openssl-1.0.1k
(這裡的 zlib pcre 和 openssl 都是下載的 檔案解壓後的路徑)
Configuration summary
+ using PCRE library: /home/pcre-8.36
+ using OpenSSL library: /home/openssl-1.0.1k
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using zlib library: /home/zlib-1.2.8
+ jemalloc library is disabled
nginx path prefix: "/usr/local/tengine"
nginx binary file: "/usr/local/tengine/sbin/nginx"
nginx configuration prefix: "/usr/local/tengine/conf"
nginx configuration file: "/usr/local/tengine/conf/nginx.conf"
nginx pid file: "/usr/local/tengine/logs/nginx.pid"
nginx error log file: "/usr/local/tengine/logs/error.log"
nginx http access log file: "/usr/local/tengine/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx dso module path: "/usr/local/tengine/modules/"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
要啟動nginx,直接執行/usr/local/nginx/sbin/nginx命令即可。一旦nginx啟動後,便可以通過nginx加-s參數調用來控制它。使用的文法格式為:
nginx -s signal
其中signal可以為如下參數的一種:
* stop 快速關閉
* quit 優雅的關閉
* reload 重新載入設定檔
* reopen 重新開啟log檔案
修改PATH 變數 使 替換 #/usr/local/nginx/sbin/nginx # nginx
修改 /etc/profile 最後添加一行
export PATH=/usr/local/tengine/sbin:$PATH
//重啟
source /etc/profile
添加開機啟動
echo "/usr/local/tengine/sbin/nginx" >>/etc/rc.local

以上就介紹了ubuntu 編譯安裝 nginx,包括了方面的內容,希望對PHP教程有興趣的朋友有所協助。

  • 相關文章

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.