日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
Linux中配置NginxWeb服務(wù)器過(guò)程

linux系統(tǒng)環(huán)境:CentOS 7

創(chuàng)新互聯(lián)提供高防主機(jī)、云服務(wù)器、香港服務(wù)器、IDC機(jī)房托管

需要軟件:nginx-1.3.16.tar.gz  libevent-2.0.21-stable.tar.gz  Pcre 和 pcre-devel

nginx下載地址:http://nginx.org/download/nginx-1.3.16.tar.gz

libevent下載地址:http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz

Project 1:安裝Nginx及配置環(huán)境

Step 1:安裝pcre-devel,以及建立nginx用戶

# yum install pcre-devel

# groupadd -r nginx

# useradd -r -g nginx -M nginx

Step 2:解壓縮nginx的源碼并安裝

# tar -zxvf nginx-1.3.16.tar.gz -C /usr/local/src/

# cd /usr/local/src/nginx-1.3.16/

# ./configure \

--conf-path=/etc/nginx/nginx.conf \

--error-log-path=/var/log/nginx/error.log \

--http-log-path=/var/log/nginx/access.log \

--pid-path=/var/run/nginx/nginx.pid \

--lock-path=/var/lock/nginx.lock \

--user=nginx \

--group=nginx \

--with-http_ssl_module \

--with-http_flv_module \

--with-http_stub_status_module \

--with-http_gzip_static_module \

--http-client-body-temp-path=/var/tmp/nginx/client/ \

--http-proxy-temp-path=/var/tmp/nginx/proxy/ \

--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ \

--with-pcre

# make && make install

# mkdir -p /var/tmp/nginx/client

Step 3:啟動(dòng)Nginx服務(wù)并在客戶端做測(cè)試

# /usr/local/nginx/sbin/nginx

在瀏覽器上輸入本機(jī)ip

Project 2:實(shí)現(xiàn)虛擬主機(jī)

Step 1:準(zhǔn)備工作

# ifconfig eth0:0 192.168.111.20

建立兩個(gè)站點(diǎn)目錄

# mkdir /website1

# mkdir /website2

建立兩個(gè)存放日志的目錄

# mkdir /var/log/nginx/website1

# mkdir /var/log/nginx/website2

創(chuàng)建兩個(gè)測(cè)試頁(yè)

# echo "This is website1" >/website1/index.html

# echo "This is website2" >/website2/index.html

Step 2:修改配置文件,原有的配置文件中默認(rèn)有一個(gè)server節(jié)點(diǎn),修改一下,然后再添加一個(gè)server節(jié)點(diǎn)

server {

listen 192.168.111.10:80;

server_name localhost;

#charset koi8-r;

access_log /var/log/nginx/website1/access.log;

error_log /var/log/nginx/website1/error.log;

location / {

root /website1;

index index.html index.htm;

}

error_page 404 /404.html;

# redirect server error pages to the static page /50x.html

#

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root html;

}

}

server {

listen 192.168.111.20:80;

server_name localhost;

#charset koi8-r;

access_log /var/log/nginx/website2/access.log;

error_log /var/log/nginx/website2/error.log;

location / {

root /website2;

index index.html index.htm;

}

error_page 404 /404.html;

# redirect server error pages to the static page /50x.html

#

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root html;

}

}

此文件在Nginx安裝目錄下的conf里面的nginx.conf里面修改

Step 3:s使用 ./nginx -s reload重新裝在配置

在終端里面進(jìn)入到nginx目錄下的sbin,然后使用: ./nginx -s reload 命令進(jìn)行重新裝載配置


當(dāng)前標(biāo)題:Linux中配置NginxWeb服務(wù)器過(guò)程
地址分享:http://www.5511xx.com/article/djijeeo.html