更新來源:apt-get update
升級軟體:apt-get upgrade
更新系統:apt-get dist-upgrade
apt-get install openssl
apt-get install libssl-dev
yum -y install opensslvel openlldede 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 Open sha1: using OpenSSL library
+ using zlib library: /home/zlib-1.2.8
+ jemalloc library is disabled
nginx path prefix: "/usr/local/tine /sbin/nginx"
nginx configuration prefix: "/usr/local/tengine/conf"
nginx configuration file: "/usr/local/tengine/conf/nginx.conf"
nginx pid local//usr. 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 ginx 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 重新開啟修改式變數 使 替換#/usr/local/nginx/sbin/nginx # nginx
修改/etc/profile 最後新增一行
export PATH=/usr/local/tengine/sbin:$Pprosource
新增開機啟動
echo "/usr/local/tengine/sbin/nginx" >>/etc/rc.local
以上就介紹了ubuntu 編譯安裝 nginx,包含了面向的內容,希望對PHP教學有興趣的朋友有幫助。