亚洲韩日午夜视频,欧美日韩在线精品一区二区三区,韩国超清无码一区二区三区,亚洲国产成人影院播放,久草新在线,在线看片AV色

您好,歡迎來到思海網(wǎng)絡(luò),我們將竭誠為您提供優(yōu)質(zhì)的服務(wù)! 誠征網(wǎng)絡(luò)推廣 | 網(wǎng)站備案 | 幫助中心 | 軟件下載 | 購買流程 | 付款方式 | 聯(lián)系我們 [ 會(huì)員登錄/注冊 ]
促銷推廣
客服中心
業(yè)務(wù)咨詢
有事點(diǎn)擊這里…  531199185
有事點(diǎn)擊這里…  61352289
點(diǎn)擊這里給我發(fā)消息  81721488
有事點(diǎn)擊這里…  376585780
有事點(diǎn)擊這里…  872642803
有事點(diǎn)擊這里…  459248018
有事點(diǎn)擊這里…  61352288
有事點(diǎn)擊這里…  380791050
技術(shù)支持
有事點(diǎn)擊這里…  714236853
有事點(diǎn)擊這里…  719304487
有事點(diǎn)擊這里…  1208894568
有事點(diǎn)擊這里…  61352289
在線客服
有事點(diǎn)擊這里…  531199185
有事點(diǎn)擊這里…  61352288
有事點(diǎn)擊這里…  983054746
有事點(diǎn)擊這里…  893984210
當(dāng)前位置:首頁 >> 技術(shù)文章 >> 文章瀏覽
技術(shù)文章

Apache虛擬主機(jī)的配置

添加時(shí)間:2013-6-5 9:58:52  添加: 思海網(wǎng)絡(luò) 

一、使用 mod_vhost_alias

1、簡單的動(dòng)態(tài)虛擬主機(jī)

# 從 Host: 頭中取得服務(wù)器名字 Server Name

UseCanonicalName Off

# 這里的日志格式,可以在將來通過第一個(gè)參數(shù)域來分隔不同的虛擬主機(jī)的日志

LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon

CustomLog logs/access_log vcommon

# 在返回請求的文件名的路徑中包含進(jìn)服務(wù)器名字: server name

VirtualDocumentRoot /www/hosts/%0/docs

VirtualAlias /www/hosts/%0/cgi-bin

2、更為有效的基于 IP 地址的虛擬主機(jī)

# 從 IP 地址反解析得到服務(wù)器名字(server name)

UseCanonicalName DNS

# 在日志中包含 IP 地址,便于后續(xù)分發(fā)

LogFormat "%A %h %l %u %t \"%r\" %s %b" vcommon

CustomLog logs/access_log vcommon

# 在文件路徑中包含 IP 地址

VirtualDocumentRootIP /www/hosts/%0/docs

VirtualAliasIP /www/hosts/%0/cgi-bin

二、使用 mod_rewrite

1、使用 mod_rewrite 實(shí)現(xiàn)簡單的動(dòng)態(tài)虛擬主機(jī)

# 從 Host: 頭獲取服務(wù)器名字

UseCanonicalName Off

# 可分割的日志

LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon

CustomLog logs/access_log vcommon

<Directory /www/hosts>

# ExecCGI is needed here because we can't force

# CGI execution in the way that Alias does

Options FollowSymLinks ExecCGI

</Directory>

# 接下來是關(guān)鍵部分

RewriteEngine On

# a ServerName derived from a Host: header may be any case at all RewriteMap lowercase int:tolower

## 首先處理普通文檔:

# 允許變名 /icons/ 起作用 - 其他變名類同

RewriteCond %{REQUEST_URI} !^/icons/

# 允許 CGIs

RewriteCond %{REQUEST_URI} !^/cgi-bin/

# 開始“變戲法”

RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/docs/$1

## 現(xiàn)在處理 CGIs - 我們需要強(qiáng)制使用一個(gè) MIME 類型

RewriteCond %{REQUEST_URI} ^/cgi-bin/

RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1 [T=application/x-httpd-cgi]

# 好了!

2、使用獨(dú)立的虛擬主機(jī)配置文件 vhost.map

vhost.map 文件包含了類似下面的內(nèi)容:

www.customer-1.com /www/customers/1

www.customer-2.com /www/customers/2

# ...

www.customer-N.com /www/customers/N

http.conf 包含了:

RewriteEngine on

RewriteMap lowercase int:tolower

# 定義映像文件

RewriteMap vhost txt:/www/conf/vhost.map

# 和上面的例子一樣,處理變名

RewriteCond %{REQUEST_URI} !^/icons/

RewriteCond %{REQUEST_URI} !^/cgi-bin/

RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$

# 這里做基于文件的重新映射

RewriteCond ${vhost:%1} ^(/.*)$

RewriteRule ^/(.*)$ %1/docs/$1

RewriteCond %{REQUEST_URI} ^/cgi-bin/

RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$

RewriteCond ${vhost:%1} ^(/.*)$

RewriteRule ^/(.*)$ %1/cgi-bin/$1

關(guān)鍵字:Apache、虛擬主機(jī)、服務(wù)器

分享到:

頂部 】 【 關(guān)閉
版權(quán)所有:佛山思海電腦網(wǎng)絡(luò)有限公司 ©1998-2024 All Rights Reserved.
聯(lián)系電話:(0757)22630313、22633833
中華人民共和國增值電信業(yè)務(wù)經(jīng)營許可證: 粵B1.B2-20030321 備案號(hào):粵B2-20030321-1
網(wǎng)站公安備案編號(hào):44060602000007 交互式欄目專項(xiàng)備案編號(hào):200303DD003  
察察 工商 網(wǎng)安 舉報(bào)有獎(jiǎng)  警警  手機(jī)打開網(wǎng)站