成人AV在线无码|婷婷五月激情色,|伊人加勒比二三四区|国产一区激情都市|亚洲AV无码电影|日av韩av无码|天堂在线亚洲Av|无码一区二区影院|成人无码毛片AV|超碰在线看中文字幕

nginx服務(wù)器配置

Linux6.2下所需軟件包:Gcc,make,glibpcre-8.32.zipnginx-1.3.10.tar .gz配置域名:解壓所需軟件包,編譯:unzip pcre-8.32.zipcd p

Linux6.2下

所需軟件包:

Gcc,make,glib

pcre-8.32.zip

nginx-1.3.10.tar .gz

配置域名:

解壓所需軟件包,編譯:

unzip pcre-8.32.zip

cd pcre-8.32

./configure

Make&&make install

tarzxvf nginx-1.3.10.tar.gz

cd nginx-1.3.10

./configure --with-http_stub_status_module --prefix=/opt/nginx Make&&make install

ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/

ls -l /usr/local/sbin/nginx

安裝apache 源碼包httpd-2.2.9.tar.gz ,啟動(dòng)apache 服務(wù). 創(chuàng)建所需訪問(wèn)網(wǎng)頁(yè)根目錄以及訪問(wèn)文件:

mkdir -p /web/www/baidu/htdocs

mkdir -p /web/www/sina/htdocs

echo "www.baidu.com" > /web/www/baidu/htdocs/index.html echo "www.sina.com" > /web/www/sina/htdocs/index.html

查找libpcre.so.l 文件:

,

進(jìn)入 /etc/ld.so.conf目錄下,修改配置文件:

輸入ldconfig 重新加載.

進(jìn)入nginx 主配置文件.

在97行左右下輸入配置文件:

server {

listen 80;

server_name www.baidu.com;

charset utf-8;

#access_log logs/baidu.access.log main;

location / {

root /web/www/baidu/htdocs;

index index.html index.htm;

}

}

server {

listen 80;

server_name www.sina.com;

charset utf-8;

#access_log logs/sina.access.log main;

location / {

root /web/www/sina/htdocs;

index index.html index.htm;

}

}

,

錄入保存后,輸入/opt/nginx/sbin/nginx -t進(jìn)行驗(yàn)證成功. 繼續(xù)輸入/opt/nginx/sbin/nginx啟動(dòng)服務(wù).

進(jìn)行訪問(wèn)測(cè)試:

進(jìn)入nginx 主配置文件.

修改配置文件,添加以下幾行:

server {

listen

80;

,

server_name www.baidu.com;

charset utf-8;

access_log logs/baidu.access.log main;

location / {

root /web/www/baidu/htdocs;

index index.html index.htm;

location ~/status{

stub_status on;

access_log off;

}

}

}

查找到nginx 進(jìn)程號(hào),殺死進(jìn)程。重新啟動(dòng)nginx 服務(wù)

重啟輸入www.baidu.com/status可進(jìn)行訪問(wèn)狀態(tài)統(tǒng)計(jì)

標(biāo)簽: