搭建nginx服務(wù)器
編譯啟動(dòng)
搭建nginx服務(wù)器
先安裝編譯所需要的包:
yuminstall-ygcc-c++gccmakepcrepcre-develzlibzlib-developensslopenssl-devel
再去nginx官網(wǎng)下載安裝包:
nginx的安裝包下載地址:nginx.org/
將包移動(dòng)到/usr/local/src
解壓包:tarzxvf/usr/local/src/包名
編譯:
./configure\
--prefix=/usr/local/nginx\
--pid-path=/var/run/nginx/nginx.pid\
--lock-path=/var/lock/nginx.lock\
--error-log-path=/var/log/nginx/error.log\
--http-log-path=/var/log/nginx/access.log\
--with-http_gzip_static_module\
--http-client-body-temp-path=/var/temp/nginx/client\
--http-proxy-temp-path=/var/temp/nginx/proxy\
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi\
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi\
--http-scgi-temp-path=/var/temp/nginx/scgi
編譯:直接執(zhí)行make命令make
安裝:再執(zhí)行makeinstall
啟動(dòng):啟動(dòng)nginx。
先創(chuàng)建/var/temp/nginx目錄否則nginx啟動(dòng)報(bào)錯(cuò)。(-p循環(huán)創(chuàng)建)
root@localhostsbin#mkdir/var/temp/nginx-p
(因?yàn)榫幾g時(shí)把文件安裝到了/usr/local/nginx下)
進(jìn)入/usr/local/nginx/sbin目錄下執(zhí)行nginx命令:root@localhostsbin#./nginx
檢驗(yàn):查看進(jìn)程:psaux|grepnginx
有進(jìn)程啟動(dòng),安裝成功
關(guān)閉nginx:root@localhostsbin#./nginx-sstop
刷新nginx的配置:root@localhostsbin#./nginx-sreload
Tags:編譯啟動(dòng),搭建nginx服務(wù)器
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。