Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ
îðèãèíàëüíîãî äîêóìåíòà
: http://itpm.msu.su/manual/ko/vhosts/mass.html
Äàòà èçìåíåíèÿ: Sat Feb 5 01:50:17 2005 Äàòà èíäåêñèðîâàíèÿ: Mon Oct 1 22:43:54 2012 Êîäèðîâêà: ISO8859-5 Ïîèñêîâûå ñëîâà: ï ï ï ï ï ï ï ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï |
Apache HTTP Server Version 2.0
ÐÜ É?Ì-ÄÒ ÎÖÖÔÔÅ 1.3ÏÅÌ- ÄûÇ?Ð× ÀÅË?Ø?ÍÊÖ?È? ØÏÐÂÐ?ÐÈÇÞ Ì-ÊåÍÊ×ßÄÒ ÉöÉÐË ÌÃÈý×áÄé.
Ä÷ÍÕÐ× httpd.conf
ÏÅ ÄéÐÍÀ? ÀÀÐÜ Ì-ÇÞ ÊåÍÑ×á
<VirtualHost>
ÌÍÌ×ÅùÐË ÈÉÐÜ ÐæÄéÈù Ï?ÁòÌ-
ÌÃÈý×ßÄÒ ÉöÉÐÜ ÅÅÏ?ÐÜ ÅÙ ÀÝÐÜÄé:
NameVirtualHost 111.22.33.44
<VirtualHost 111.22.33.44>
ServerName www.customer-1.com
DocumentRoot /www/hosts/www.customer-1.com/docs
ScriptAlias /cgi-bin/ /www/hosts/www.customer-1.com/cgi-bin
</VirtualHost>
<VirtualHost 111.22.33.44>
ServerName www.customer-2.com
DocumentRoot /www/hosts/www.customer-2.com/docs
ScriptAlias /cgi-bin/ /www/hosts/www.customer-2.com/cgi-bin
</VirtualHost>
# ÉéÊÈ ÉéÊÈ ÉéÊÈ
<VirtualHost 111.22.33.44>
ServerName www.customer-N.com
DocumentRoot /www/hosts/www.customer-N.com/docs
ScriptAlias /cgi-bin/ /www/hosts/www.customer-N.com/cgi-bin
</VirtualHost>
ÁòÊË ÀÃÃôÐÊ Ñ?Ð?ÐÞ <VirtualHost>
ÌÃÑ? È?ÅÞÈ? ÅÏÐ?ÐÈÇÞ ÓÃÈ?×ßÅÅÇß ÄûÓÌ×ßÄÒ ÀÝÐÜÄé.
ÁçÇ?Èù ÈÉÐÊ ÐõÑÅÐÜ ÐæÄé:
ÄìÑÅÐÊ À? ÀÅË?Ø?ÍÊÖ?ÊÀÇÞ ÄéÈ? ÇÞÁçÖÔÐßÐË Ë÷Ïû×â Ì? Î?ÄéÄÒ ÑÅÐÜÄé. ÁçÇ?Ã? ÈÕÏü ÈÉÐÊ ÀÅË?Ø?ÍÊÖ?È? Ë÷Ïû×áÄéÈù ÖÔÐßÁòÌ?ÐêÈ? Äé ÍñÉ?È?ÁòÆ?É?ÏÅ Ì-ÇÞ ÄéÈ? ÇÞÁçÖÔÐßÐË Ë÷Ïû×â Ì? Î?Äé. ÖÔÐÜ×ÑÃ? fifoÇÞ ÇÞÁçÈ? ÊÈÃËÀý, ÉîÄÒ ÖýÏÅÌ- ÇÞÁçÈ? ÓÃÈ?×ßÏ? Ã?Ä?ÄÒ ÉöÉÐÜ (ÕûÀø ÅþÐË È?ÐË Ì?ÅÅ ÐæÄé) Ä? ÃÄÄé.
ÀÅË?Ø?ÍÊÖ?ÄÒ IP ÑæÌâÏÝ HTTP ÏôÓËÐ× Host:
×üÄ? Ñ?ÊÈÇÞ Ñ?Ð××áÄé. ÁòÊËÐ?ÐÈÇÞ ÄûÇ?Ð×
ÅÏÐ? ÀÅË?Ø?ÍÊÖ? ÁòÌ?ÐÊ ÐêÅÏÐÈÇÞ ÀÅË?Ø?ÍÊÖ? Ñ?ÊÈÈ? ÏôÓËÐ×
ÖÔÐßÀöÇÞÏÅ Ö?×ä×áÄé. ÐÜÄÒ ÄûÊÞÊà mod_vhost_alias
È?
Ë÷Ïû×ßÏ? ÍÁÀä ×èÀñ×â Ì? ÐæÑ?ÈÈ, ÎÖÖÔÔÅ 1.3.6 ÐÜ×ßÈ? Ë÷Ïû×áÄéÈù
mod_rewrite
È? Ë÷Ïû×èÎï ×áÄé. ÐÜ ÅÞ È?Åò
È?ÅÞ ÁòÊËÐ?ÐÈÇÞ Ì-É?ÏÅ Ö?×äÅ×Ñ? ÎÚÄÒÄé. ÐÜ ÉöÉÐË Ë÷Ïû×ßÇÑÈù
ÎÖÖÔÔÅÈ? ÁÈÌÊ×ßÀý ÔÔÖÔÐß×âÆ? Ö?×ä×èÎï ×áÄé.
ÅÏÐ? ÀÅË?Ø?ÍÊÖ?È? ÐßÉíÐ?ÐÞ ÀÅË?Ø?ÍÊÖ?ÓÃÇà ÊÈÐÜÀä×ßÇÑÈù
Ï?Ç?ÀÅÑ?È? `ÌãÏ?Îï' ×áÄé. ÀÅÐõ ÑïÏô×á ÀÝÐÊ ÎÖÖÔÔÅÀÅ ÐêÁòÒ?ÑÆ
URL ÅþÐË ÈÈÅùÆ? Ë÷Ïû×â Ì-É?ÈýÐÜÄé. Ì-É?ÈýÐÊ
ServerName
Ñ?ÍÓÎþÇÞ ÌÃÑ?×ßÈ÷, CGIÏÅÄÒ
SERVER_NAME
Ø?ÀöÊ?Ì?ÇÞ ÑæÎþÑ?Äé. Í××ðÑï Í×Ñ?
Ì-É?ÈýÐÊ UseCanonicalName
ÌÃÑ?ÏÅ ÄîÇØÄé.
UseCanonicalName Off
ÐÜÈù ÏôÓËÐ× Host:
×üÄ? ÃËÏûÐÜ Ì-É?ÈýÐÜ ÅØÄé. UseCanonicalName DNS
ÐÜÈù
ÀÅË?Ø?ÍÊÖ?Ð× IP ÑæÌâÈ? Ï?DNS ÀÛË?×ßÏ? Ì-É?ÈýÐË ÎÛÎÖÃÍÄé.
Ð?ÐêÄÒ ÐÜÈ?ÁòÉí ÅÏÐ? ÀÅË?Ø?ÍÊÖ?ÏÅÌ- Ë÷Ïû×ßÀý, ØÔÐêÄÒ IPÁòÉí
ÀÅË?Ø?ÍÊÖ?ÏÅÌ- Ë÷Ïû×áÄé. Host:
×üÄ?ÀÅ Î?ÀÕÃ?
DNS ÀÛË?ÐÜ Í×Öà×ßÏ? ÎÖÖÔÔÅÀÅ Ì-É?ÈýÐË ÎÛÎÖÃËÑ? È?×ßÈù
ServerName
ÐÈÇÞ ÌÃÑ?×á À?ÐË ÄûÍÕ Ë÷Ïû×áÄé.
ÄéÈ? `ÌãÐß' ÀÝÐÊ (DocumentRoot
ÇÞ ÌÃÑ?×ßÈ÷,
CGIÏÅÄÒ DOCUMENT_ROOT
Ø?ÀöÊ?Ì?ÇÞ ÑæÎþÑ?ÄÒ)
É?Ì-Ç÷Ö?ÐÜÄé. ÐßÉíÐ?ÐÞ ÀöÏü core È?ÅòÐÜ ÐÜ ÌÃÑ?ÐË Ë÷Ïû×ßÏ?
URIÏÅ ×èÄ÷×ßÄÒ ÖÔÐßÈýÐË Ó?Ñ?ÈÈ, Ì-É?È? ÅÏÐ? ÀÅË?Ø?ÍÊÖÓÐË ×âÆ?ÄÒ ÄéÈ?
È?ÅòÐÜ (mod_vhost_alias
Ã? mod_rewrite
)
ÄéÈ? ÉöÉÐÈÇÞ ÐÜÇÁ ÐëÎ?ÐË ×áÄé. ÅÞ È?Åò È?ÅÞ
DOCUMENT_ROOT
Ø?ÀöÊ?Ì?È? Ë÷Ïû×ßÑ? ÎÚÐÈÉ×ÇÞ
CGIÃ? SSI É?Ì-ÀÅ ÐÜ À?ÐË Ë÷Ïû×áÄéÈù ÐïÈ?ÅØ ÀñÀ?È? Î?ÐË Ì?
ÐæÄé.
Ð? ÅÏÁò ÐÐ× ÀÅË?Ø?ÍÊÖ?
ÌÃÑ?ÐË mod_vhost_alias
È? Ë÷Ïû×ßÏ? Ä? ÐßÉíÐ?ÐÈÇÞ
ÁÈ×?×ïÄé.
# Host: ×üÄ?ÏÅÌ- Ì-É?ÈýÐË ÎÛÎÖÃÍÄé
UseCanonicalName Off
# ÓÉÉ?ÒÀ ×ÚÅõÈ? Ë÷Ïû×ßÏ? ÐÜ ÇÞÁçÈ? ÀÅË?Ø?ÍÊÖ?ÊÀÇÞ Ã?Ä- Ì? ÐæÄé
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog logs/access_log vcommon
# ÏôÓËÐË ÓÃÈ?×ßÁòÐ?×è ÖÔÐßÈýÏÅ Ì-É?ÈýÐË Ö?×ä×áÄé
VirtualDocumentRoot /www/hosts/%0/docs
VirtualScriptAlias /www/hosts/%0/cgi-bin
ÐÜ ÌÃÑ?ÏÅÌ- UseCanonicalName Off
È?
UseCanonicalName DNS
ÇÞ Ê?Àö×ßÁòÈÈ ×ßÈù IPÁòÉí
ÀÅË?Ø?ÍÊÖ?ÀÅ ÅØÄé. ÀÅË?Ø?ÍÊÖ?Ð× IP ÑæÌâÈ? ÀÅÑ?Àý
ÖÔÐßÈýÏÅ ÓïÀÅ×â Ì-É?ÈýÐË ÎÛ Ì? ÐæÄé.
ISP Ø?ÖôÐÜÑ? Ì-É?È? Ð?×è Ð?Ð× ÌÃÑ?ÐË Ì?Ñ?×ïÄé. ÑÆÁí Ä?
ÊÉÐò×á ÌÃÑ?ÐË Ë÷Ïû×ßÈù www.user.isp.com
Ð× É?Ì-È?
/home/user/
ÏÅ ÅÞÄÒ ÍÔÐÈÇÞ Ì-É?ÈýÐ× ÐßÊÞÈ? ÀÅÑ?Àý
ÖÔÐßÈýÐË ÈÈÅù Ì? ÐæÄé. ÐÜ ÌÃÑ?ÐÊ
cgi-bin
ÐË À? ÀÅË?Ø?ÍÊÖ?ÀÅ Å?ÇÞ ÀÅÑ?Ñ?ÎÚÀý
È?Å÷ ÀÅË?Ø?ÍÊÖ?ÀÅ ÀÀÐÜ Ë÷Ïû×áÄé.
# ÁòÊËÐ?ÐÞ ÃËÏûÐÊ Ð?ÏÝ ÀÀÄé. ÁçÈ?Àý
# ÖÔÐßÈýÏÅ Ì-É?ÈýÐ× ÐßÊÞÈ? Ö?×ä×áÄé
VirtualDocumentRoot /www/hosts/%2/docs
# ×ßÃ?Ð× cgi-bin Å?ÇÊÕôÈ?
ScriptAlias /cgi-bin/ /www/std-cgi/
mod_vhost_alias
É?Ì-ÏÅÄÒ Ä? ÊÉÐò×á
VirtualDocumentRoot
ÌÃÑ?Ð× ÏÉÀÅ ÐæÄé.
Ä? ÊÉÐò×á ÌÃÑ?Ð× ÏÉÇÞ ÎÖÖÔÔÅÐ× ÐßÉíÐ?ÐÞ
<VirtualHost>
Ñ?ÍÓÎþÈ? Ë÷Ïû×ßÏ? Ï?Ç?
ÀÅË?Ø?ÍÊÖ? ÌÃÑ?Ð× É?Ð?È? ÑÆÐ×â Ì? ÐæÄé. ÏÉÈ? ÅùÎþ, ÄéÐÍÀ?
ÀÀÐÊ ÌÃÑ?ÐÊ Ø?ÖôÐÜÑ? ÀýÀÄÏÅ IP ÑæÌâ ×áÀÃ, Ë?Î?Ð?ÐÞ
ÀýÀÄÏÅÀä ÄéÈ? IP ÑæÌâ ×áÀÃÈ? ÊÞÏ?×áÄé. ÉÀÇà ÐÜÐ?ÓÃÇÃ
<VirtualHost>
ÌÃÑ? ÌÍÌ×ÏÅ È?ÅÞ É-ÐË Ì?ÅÅ
ÐæÄé.
UseCanonicalName Off
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
<Directory /www/commercial>
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /www/homepages>
Options FollowSymLinks
AllowOverride None
</Directory>
<VirtualHost 111.22.33.44>
ServerName www.commercial.isp.com
CustomLog logs/access_log.commercial vcommon
VirtualDocumentRoot /www/commercial/%0/docs
VirtualScriptAlias /www/commercial/%0/cgi-bin
</VirtualHost>
<VirtualHost 111.22.33.45>
ServerName www.homepages.isp.com
CustomLog logs/access_log.homepages vcommon
VirtualDocumentRoot /www/homepages/%0/docs
ScriptAlias /cgi-bin/ /www/std-cgi/
</VirtualHost>
ÓÉÉ?ÒÀ ÏÉÏÅÌ- Ã?ÄÒ ÌÃÑ?ÐË À?ÄìØ? IPÁòÉí ÀÅË?Ø?ÍÊÖ?ÇÞ ÉéÂì Ì? ÐæÄéÀý ÈË×ïÄé. Êâ×ðØ?ÅÅ ÁçÇÁ ÌÃÑ?ÐÊ ÈÕ ÏôÓËÈÆÄé DNSÈ? Ó?ÎÖÎï×ßÉ×ÇÞ ÈÕÏü ÊåØÏÐÂÐ?ÐÜÄé. ÐÜÈ?ÄûÍÕ IP ÑæÌâÇÞ ÖÔÐßÍÓÍÊÕëÐË ÁÈÌÊ×ßÀý ÀÀÐÊ ÉöÍÔÐÈÇÞ ÇÞÁçÈ? Ì?Ñ?×ßÈù É?Ñ?È? ×èÀñ×â Ì? ÐæÄé. ÎÖÖÔÔÅÄÒ Ì-É?ÈýÐË ÄéÇú ×ÚÏôÀÅ Î?ÎþÑ?Àý, DNS ÀÛË?ÅÅ ×ßÑ? ÎÚÀä ÅØÄé.
# IP ÑæÌâÈ? Ï?DNS ÀÛË?×ßÏ? Ì-É?ÈýÐË ÎÛÎÖÃÍÄé
UseCanonicalName DNS
# ÇÞÁçÈ? Ã?Ä- Ì? ÐæÅÅÇß IP ÑæÌâÈ? Ö?×ä×áÄé
LogFormat "%A %h %l %u %t \"%r\" %s %b" vcommon
CustomLog logs/access_log vcommon
# ÖÔÐßÈýÏÅ IP ÑæÌâÈ? Ö?×ä×áÄé
VirtualDocumentRootIP /www/hosts/%0/docs
VirtualScriptAliasIP /www/hosts/%0/cgi-bin
Ð? ÏÉÅùÐÊ ÎÖÖÔÔÅ É?Ð? 1.3.6 ÐÜØÔÏÅ Ö?×äÅØ
mod_vhost_alias
ÐË Ë÷Ïû×áÄé.
mod_vhost_alias
ÀÅ Î?ÄÒ ÎÖÖÔÔÅ É?Ð?ÐË Ë÷Ïû×áÄéÈù
ÐÜÉÜ ÈË×ïÅýÐÜ mod_rewrite
È? Ë÷Ïû×ßÏ?, Äì
Host:-×üÄ?ÁòÉí ÀÅË?Ø?ÍÊÖ?ÈÈÐË, ÁÈ×?×â Ì? ÐæÄé.
Æ× ÇÞÁçÏÅ À?×ßÏ? ÑæÐ××â ÑÅÐÜ ÐæÄé. ÎÖÖÔÔÅ 1.3.6ÏÅÌ-
ÇÞÁç×?ÍÔ Ñ?ÍÓÎþ %V
ÀÅ Ö?×äÅ×Î?Àý, É?Ð? 1.3.0
- 1.3.3ÏÅÌ- ÐÜ ÁòÄÙÐË %v
ÏÙÌ×ÐÜ ÄûÍÕ ×ïÄé. ÁçÇ?Ã?
É?Ð? 1.3.4ÏÅÄÒ ÐÜÇÁ ÁòÄÙÐÜ Î?Äé. ÎþÆÂ ÎÖÖÔÔÅ É?Ð?ÏÅÌ-ÅÅ
.htaccess
ÖÔÐßÏÅÌ- UseCanonicalName
Ñ?ÍÓÎþÈ? Ë÷Ïû×â Ì? ÐæÐÈÉ×ÇÞ ÇÞÁçÏÅ ÐÜË?×á ÃËÏûÐÜ ÁòÇßÅÙ Ì? ÐæÄé.
ÁçÇ?É×ÇÞ ÀÅÐõ ÑÑÐÊ ÉöÉÐÊ %{Host}i
Ñ?ÍÓÎþÈ?
Ë÷Ïû×ßÏ? Host:
×üÄ?È? Ñ?Ñ? ÇÞÁçÏÅ ÃÂÁòÄÒ ÀÝÐÜÄé.
Æ×, ÐÜ ÉöÉÐÊ %V
ÄÒ Ö?×ä×ßÑ?ÎÚÄÒ :port
È?
ÅêÏÅ ÓïÀÅ×â Ì? ÐæÄé.
mod_rewrite
È?
Ë÷Ïû×á À?Äì×á ÅÏÐ? ÀÅË?Ø?ÍÊÖ?ÄéÐÍÐÊ ÓÉÉ?ÒÀ ÏÉÏÝ ÀÀÐÊ ÐßÐË ×ßÄÒ
httpd.conf
ÏÉÐÜÄé. ÓÃÐÍ ÐÉíÐÊ ÓÉÉ?ÒÀ ÏÉÏÝ
ÀÕÐ× ÊåÍÑ×ßÑ?ÈÈ, ÐÜÐ? É?Ð?À?Ð× Ø?Ø?ÌÊÀ? mod_rewrite
Ð×
Ð?Ð×á ÅÏÐëÐË Ð?×è Ì?Ñ?Å×Î?Äé. Ã?ÈãÑ? ÐÉíÐÊ Í×Ñ? ÐëÎ?ÐË
×ßÄÒ mod_rewrite
È? ÌÃÑ?×áÄé.
Ö?ÊÀØ? ÑæÐ××èÎï ×â Ë÷×çÐÜ ÐæÄé. ÁòÊËÐ?ÐÈÇÞ
mod_rewrite
ÄÒ (mod_alias
Åþ) ÄéÈ?
URI É?Ï? È?Åò ÐÜÐ?ÏÅ Í××ðÅØÄé. ÁçÇÅÌ- ÄéÈ? URI É?Ï? È?ÅòÅùÀ?
ÀÀÐÜ ÅÏÐë×â ÀÝÐË ÀýÇÑ×ßÏ? mod_rewrite
È? ÌÃÑ?×èÎï ×áÄé.
Æ×, ÅÏÐ? ÀÅË?Ø?ÍÊÖ?ÏÅÌ- ScriptAlias
À? ÀÀÐÊ
ÁòÄÙÐË Ð?×èÌ-ÄÒ Ö?ÊÀ×á ÐëÎ?ÐÜ ×ÚÏô×ßÄé.
# Host: ×üÄ?ÏÅÌ- Ì-É?ÈýÐË Î?ÄÒÄé
UseCanonicalName Off
# splittable logs
LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon
CustomLog logs/access_log vcommon
<Directory /www/hosts>
# ScriptAlias ÍÔÐÈÇÞ CGI Í××ðÐË À-Ñ?×â Ì? Î?ÁòÆ?É?ÏÅ
# Ï?ÁòÏÅ ExecCGIÈ? Ë÷Ïû×áÄé
Options FollowSymLinks ExecCGI
</Directory>
# ÐÜÑ? ÎþÇÑÏþ ÊÞÊàÐÜÄé
RewriteEngine On
# Host: ×üÄ?ÏÅÌ- ÀÅÑ?ÏÒ Ì-É?ÈýÏÅÄÒ ÄûÌâÉ?ÐêÀÅ ÅêÌ?Ï?ÐæÐË Ì? ÐæÄé
RewriteMap lowercase int:tolower
## ÐßÉí É?Ì-È? ÈåÐ? ÓÃÈ?×áÄé:
# Alias /icons/ ÀÅ ÅÏÐë×ßÅÅÇß - ÄéÈ? aliasÏÅ Äû×èÌ-ÅÅ ÉíÊÉ
RewriteCond %{REQUEST_URI} !^/icons/
# CGIÀÅ ÅÏÐë×ßÅÅÇß
RewriteCond %{REQUEST_URI} !^/cgi-bin/
# Ö?ÊÀ×á ÐëÎ?
RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/docs/$1
## ÐÜÑ? CGIÈ? ÓÃÈ?×áÄé - MIME typeÐË À-Ñ?×èÎï ×áÄé
RewriteCond %{REQUEST_URI} ^/cgi-bin/
RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1 [T=application/x-httpd-cgi]
# ÃÅ!
mod_rewrite
È?
Ë÷Ïû×á Ø?ÖôÐÜÑ? ÍÓÍÊÕëÄéÐÍÐÊ ÅÞÉ?ÒÀ ÏÉÏÝ ÀÀÐÊ ÐßÐË ×áÄé.
RewriteEngine on
RewriteMap lowercase int:tolower
# CGIÀÅ ÅÏÐë×ßÅÅÇß
RewriteCond %{REQUEST_URI} !^/cgi-bin/
# RewriteRuleÐÜ ÅÏÐë×ßÅÅÇß Ø?ÍÊÖ?ÈýÐÜ ÏÓÉéÈ?Ñ? ÀÛË÷×áÄé
RewriteCond ${lowercase:%{SERVER_NAME}} ^www\.[a-z-]+\.isp\.com$
# ÀÅË?Ø?ÍÊÖ?ÈýÐË URI ÎåÏÅ ÊéÐÞÄé
# [C]ÄÒ ÐÜ ÀñÀ?È? ÀÅÑ?Àý ÄéÐÍ Ð÷ÐëÌÊÐË Ì?×ð×äÐË Æö×áÄé
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]
# ÐÜÑ? Í×Ñ? ÖÔÐßÈýÐË ÈÈÅ÷Äé
RewriteRule ^www\.([a-z-]+)\.isp\.com/(.*) /home/$1/$2
# Ð?ÓÌ CGI Å?ÇÊÕôÈ?È? Ñ?Ð××áÄé
ScriptAlias /cgi-bin/ /www/std-cgi/
ÄéÐÍÐÊ mod_rewrite
Ð× ÀýÁî ÁòÄÙÐË Ë÷Ïû×ßÏ?
ÊÀÅÅÐ× ÌÃÑ?ÖÔÐßÐË ÀÅÑ?Àý ÀÅË?Ø?ÍÊÖ?Ð× É?Ì-Ç÷Ö?È? ÎÛÎÖÃÍÄé.
Ä? Ð?Ï?×ßÑ?ÈÈ Ä? ÊÉÐò×á ÌÃÑ?ÐÜ ×ÚÏô×ßÄé.
vhost.map
ÖÔÐßÐÊ ÄéÐÍÀ? ÀÀÄé:
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
# Ð?ÏÝ ÀÀÐÜ aliasÅùÐË ÓÃÈ?×áÄé
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