欧美一区2区三区4区公司二百,国产精品婷婷午夜在线观看,自拍偷拍亚洲精品,国产美女诱惑一区二区

歡迎來到夢(mèng)飛科技

服務(wù)器租用

當(dāng)前優(yōu)惠活動(dòng):

Linux Nginx處事器怎么樣實(shí)現(xiàn)網(wǎng)站不區(qū)分巨細(xì)寫

假如你將跑在Windows下的項(xiàng)目(如:php)遷移到Linux下,由于Windows操縱系統(tǒng)中,文件名是不區(qū)分巨細(xì)寫的;而Linux系統(tǒng)是巨細(xì)寫敏感,會(huì)導(dǎo)致有些網(wǎng)頁呈現(xiàn)404環(huán)境。

辦理要領(lǐng)有或許4種:
1、 url rewrite
2、 perl模塊
3、 lua模塊
4、 ngx_http_lower_upper_case

第一種要領(lǐng)合用于有法則的可能較少的url需要轉(zhuǎn)換,假如有量并無法則的請(qǐng)用下面幾種要領(lǐng)

第二、三、四種要領(lǐng)前提是Linux系統(tǒng)當(dāng)?shù)匚募切懀览硎菍rl請(qǐng)求轉(zhuǎn)換成小寫來處理懲罰

perl模塊(不推薦!Nginx官網(wǎng)已申明perl模塊存在內(nèi)存裂痕的概),要領(lǐng)如下(《lnmp一鍵安裝包》安裝后執(zhí)行下面):

cd lnmp/src/nginx-1.4.4
make clean #排除已經(jīng)編譯出的nginx
# /usr/local/nginx/sbin/nginx -V #獲取已編譯參數(shù)
nginx version: nginx/1.4.4
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module --with-ld-opt='-ljemalloc'

在已經(jīng)編譯的參數(shù)后頭加上 --with-http_perl_module ,,如下:

./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module 
--with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module --with-ld-opt='-ljemalloc' 
--with-http_perl_module

大概會(huì)報(bào)如下錯(cuò)誤:

Can't locate ExtUtils/Embed.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.

./configure: error: perl module ExtUtils::Embed is required

辦理要領(lǐng)(CentOS):

yum -y install perl-devel perl-ExtUtils-Embed

再次編譯:

make clean
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module 
--with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module --with-ld-opt='-ljemalloc' 
--with-http_perl_module
make
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx$(date +%m%d)    #備份nginx原文件
service nginx stop
make install #直接安裝,假如只包圍nginx,會(huì)有報(bào)錯(cuò)
/usr/local/nginx/sbin/nginx -t

修改設(shè)置主文件(/usr/local/nginx/conf/nginx.conf):

        perl_set $url '
        sub {
                my $r = shift;
                my $re = lc($r->uri);
                return $re;
        }
        ';

修改虛擬主機(jī)設(shè)置文件(如:/usr/local/nginx/conf/vhost/demo.linuxeye.com.conf):

if ($uri ~ [A-Z]){
        rewrite ^(.*)$ $url last;
        }

lua模塊(推薦!)
lua-nginx-module來自大牛agentzh的開源項(xiàng)目,在Nginx中嵌入Lua語言,使之可以支持強(qiáng)大Lua語法,如下:

cd lnmp/src
wget http://luajit.org/download/LuaJIT-2.0.2.tar.gz
wget https://github.com/simpl/ngx_devel_kit/archive/v0.2.19.tar.gz #ngx_devel_kit
wget https://github.com/chaoslawful/lua-nginx-module/archive/v0.9.2.tar.gz #nginx_lua_module
tar xzf LuaJIT-2.0.2.tar.gz
tar xzf v0.2.19.tar.gz
tar xzf v0.9.2.tar.gz
cd LuaJIT-2.0.2
make && make install
export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.0


cd nginx-1.4.4
make clean #排除已經(jīng)編譯出的nginx
# /usr/local/nginx/sbin/nginx -V #獲取已編譯參數(shù)
nginx version: nginx/1.4.4
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module --with-ld-opt='-ljemalloc'

夢(mèng)飛科技 - 全球數(shù)據(jù)中心基礎(chǔ)服務(wù)領(lǐng)先供應(yīng)商

Copyright © 2003-2019 MFISP.COM. 國(guó)外服務(wù)器租用 IDC公司 版權(quán)所有 ? 粵ICP備11019662號(hào)

主站蜘蛛池模板: 贵溪市| 称多县| 梅河口市| 东台市| 石棉县| 清原| 文山县| 千阳县| 攀枝花市| 会同县| 额尔古纳市| 台中市| 永德县| 桦川县| 拉孜县| 克什克腾旗| 海淀区| 清丰县| 寻甸| 奉化市| 大英县| 富川| 长乐市| 廉江市| 庆阳市| 响水县| 林甸县| 安义县| 高邮市| 辽宁省| 喀什市| 巍山| 浦县| 鄂托克旗| 元朗区| 皮山县| 开远市| 太白县| 定结县| 青冈县| 凤冈县|