今天就跟大家聊聊有關(guān)怎么在Linux系統(tǒng)中安裝Nginx,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
創(chuàng)新互聯(lián)建站主要從事網(wǎng)站設(shè)計(jì)制作、成都做網(wǎng)站、網(wǎng)頁(yè)設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)精河,10年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專業(yè),歡迎來(lái)電咨詢建站服務(wù):18980820575
1、安裝編譯文件及庫(kù)文件
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
2、安裝PCRE,Nginx的rewrite的偽靜態(tài)匹配規(guī)則需要用到正則表達(dá)式,PCRE就是起到這個(gè)作用。
下載地址:wgethttp://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
如果wget沒(méi)有安裝的話,需要先安裝wget,yum -y install wget. wget是Linux環(huán)境下的下載工具。wget命令的使用見(jiàn)此文章
3、解壓pcre安裝包:tar -zxvf pcre-8.35.tar.gz
4、進(jìn)入安裝目錄,編譯安裝
cd pcre-8.35
./configure
make && make install
5、查看pcre版本
pcre-config --version
6、下載Nginx
wgethttp://nginx.org/download/nginx-1.6.2.tar.gz
7、解壓并進(jìn)入安裝包
8、編譯安裝
./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.35
make
make install
9、查看Nginx版本
10、Nginx配置
1)、創(chuàng)建Nginx 運(yùn)行使用的用戶
/usr/sbin/groupadd www
/usr/sbin/useradd-g www www
2)、配置nginx.conf ,將/usr/local/webserver/nginx/conf/nginx.conf替換為以下內(nèi)容
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
3)、檢查nginx.conf配置文件的正確性
/usr/local/webserver/nginx/sbin/nginx -t
4)、關(guān)于Nginx連接數(shù)的配置,請(qǐng)參看網(wǎng)址:Nginx中worker connections問(wèn)題的解決方法
看完上述內(nèi)容,你們對(duì)怎么在Linux系統(tǒng)中安裝Nginx有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。
網(wǎng)頁(yè)名稱:怎么在Linux系統(tǒng)中安裝Nginx
URL分享:http://bm7419.com/article16/pscggg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供電子商務(wù)、移動(dòng)網(wǎng)站建設(shè)、關(guān)鍵詞優(yōu)化、面包屑導(dǎo)航、網(wǎng)站制作、手機(jī)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
移動(dòng)網(wǎng)站建設(shè)知識(shí)