Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://www.arcetri.astro.it/manual/ko/vhosts/mass.html
Äàòà èçìåíåíèÿ: Mon Jan 21 19:44:30 2013
Äàòà èíäåêñèðîâàíèÿ: Fri Feb 28 05:33:51 2014
Êîäèðîâêà: ISO8859-5

Ïîèñêîâûå ñëîâà: ï ï ï ï ï ï ï ï ï ï ï ï ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï
ÄûÇ?Ð× ÀÅË?Ø?ÍÊÖ?È? ÅÏÐ?ÐÈÇÞ ÌÃÑ?×ßÁò - Apache HTTP Server
<-
Apache > HTTP Server > Documentation > Version 2.2 > ÀÅË?Ø?ÍÊÖ?

ÄûÇ?Ð× ÀÅË?Ø?ÍÊÖ?È? ÅÏÐ?ÐÈÇÞ ÌÃÑ?×ßÁò

ÀÅÄÙ×á Î?Îþ:  en  |  ko  |  tr 

ÐÜ É?Ì-ÄÒ ÓæÍÕÖ× É?Ï?ÐÜ ÎÖÄåÄßÄé. ÓæÁéÏÅ Ê?ÀöÅØ ÃËÏûÐÊ ÏÅÎþ É?Ì-È? Ò?Àý×ßÌÌÏô.

ÐÜ É?Ì-ÄÒ ÎÖÖÔÔÅ 1.3ÏÅÌ- ÄûÇ?Ð× ÀÅË?Ø?ÍÊÖ?È? ØÏÐÂÐ?ÐÈÇÞ Ì-ÊåÍÊ×ßÄÒ ÉöÉÐË ÌÃÈý×áÄé.

top

ÅÏÁò

Ä÷ÍÕÐ× 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> ÌÃÑ? È?ÅÞÈ? ÅÏÐ?ÐÈÇÞ ÓÃÈ?×ßÅÅÇß ÄûÓÌ×ßÄÒ ÀÝÐÜÄé. ÁçÇ?Èù ÈÉÐÊ ÐõÑÅÐÜ ÐæÄé:

  1. ÌÃÑ?ÖÔÐßÐÜ ÐëÎÖÑ?Ì- ÎÖÖÔÔÅÀÅ ËÅÈ? ÍÓÐë×ßÀý ÈîÈ?È?È? Ð?Àä Ë÷Ïû×áÄé.
  2. ÀÅË?Ø?ÍÊÖ?È? ÓïÀÅ×ßÁòÐ?×è ÖÔÐßÍÓÍÊÕëÏÅ Ð?Ä÷×á Å?ÇÊÕôÈ?È? ÈÈÅùÀý DNSÏÅ ×çÈåÐË ÓïÀÅ×ßÁòÈÈ ×ßÈùÅØÄé. Ñÿ, ÎÖÖÔÔÅÈ? Ð÷ÌÃÑ?×ßÀý Ð÷ÍÓÐë×â ×ÚÏôÀÅ Î?Äé.

ÄìÑÅÐÊ À? ÀÅË?Ø?ÍÊÖ?ÊÀÇÞ ÄéÈ? ÇÞÁçÖÔÐßÐË Ë÷Ïû×â Ì? Î?ÄéÄÒ ÑÅÐÜÄé. ÁçÇ?Ã? ÈÕÏü ÈÉÐÊ ÀÅË?Ø?ÍÊÖ?È? Ë÷Ïû×áÄéÈù ÖÔÐßÁòÌ?ÐêÈ? Äé ÍñÉ?È?ÁòÆ?É?ÏÅ Ì-ÇÞ ÄéÈ? ÇÞÁçÖÔÐßÐË Ë÷Ïû×â Ì? Î?Äé. ÖÔÐÜ×ÑÃ? fifoÇÞ ÇÞÁçÈ? ÊÈÃËÀý, ÉîÄÒ ÖýÏÅÌ- ÇÞÁçÈ? ÓÃÈ?×ßÏ? Ã?Ä?ÄÒ ÉöÉÐÜ (ÕûÀø ÅþÐË È?ÐË Ì?ÅÅ ÐæÄé) Ä? ÃÄÄé.

top

ÀÃÏô

ÀÅË?Ø?ÍÊÖ?ÄÒ 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 É?Ì-ÀÅ ÐÜ À?ÐË Ë÷Ïû×áÄéÈù ÐïÈ?ÅØ ÀñÀ?È? Î?ÐË Ì? ÐæÄé.

top

À?Äì×á ÅÏÐ? ÀÅË?Ø?ÍÊÖ?

Ð? ÅÏÁò ÐÐ× ÀÅË?Ø?ÍÊÖ? ÌÃÑ?ÐË 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 ÑæÌâÈ? ÀÅÑ?Àý ÖÔÐßÈýÏÅ ÓïÀÅ×â Ì-É?ÈýÐË ÎÛ Ì? ÐæÄé.

top

ÀÅË?ÐÈÇÞ Ø?ÍÊÖ?×ßÄÒ Ø?ÖôÐÜÑ? ÍÓÍÊÕë

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 ÌÃÑ?Ð× ÏÉÀÅ ÐæÄé.

top

×á Ì-É?ÏÅ Ï?Ç? ÀÅË?Ø?ÍÊÖ? ÍÓÍÊÕë Ë÷Ïû×ßÁò

Ä? ÊÉÐò×á ÌÃÑ?Ð× ÏÉÇÞ ÎÖÖÔÔÅÐ× ÐßÉíÐ?ÐÞ <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>

top

Ä? ØÏÐÂÐ?ÐÞ IPÁòÉí ÀÅË?Ø?ÍÊÖ?

ÓÉÉ?ÒÀ ÏÉÏÅÌ- Ã?ÄÒ ÌÃÑ?ÐË À?ÄìØ? 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

top

ÎÖÖÔÔÅ ÐÜÐ? É?Ð? Ë÷Ïû×ßÁò

Ð? ÏÉÅùÐÊ ÎÖÖÔÔÅ É?Ð? 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È? ÅêÏÅ ÓïÀÅ×â Ì? ÐæÄé.

top

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]

# ÃÅ!

top

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/

top

ÊÀÅÅÐ× ÀÅË?Ø?ÍÊÖ? ÌÃÑ?ÖÔÐß Ë÷Ïû×ßÁò

ÄéÐÍÐÊ 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

ÀÅÄÙ×á Î?Îþ:  en  |  ko  |  tr 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.