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

Ïîèñêîâûå ñëîâà: ï ï ï ï ï ï ï ï ð ï ð ï
ÀÅË?Ø?ÍÊÖ? ÏÉ - Apache HTTP Server
<-
Apache > HTTP Server > Documentation > Version 2.2 > ÀÅË?Ø?ÍÊÖ?

ÀÅË?Ø?ÍÊÖ? ÏÉ

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

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

ÐÜ É?Ì-ÄÒ ÐêÑæ É?Ð×Å×ÄÒ ÀÅË?Ø?ÍÊÖ? Ñ?É?ÏÅ ÄôÐË ×ßÇÑÀý ÎÂÏ?ÑÃÄé. Ë?ØÂÐÊ ÐÜÈ?ÁòÉíÐÜÃ? IPÁòÉí ÀÅË?Ø?ÍÊÖ?È? Õû×è ×á Ì-É?ÏÅÌ- Ï?Ç? Ð?Ë÷ÐÜÖ?È? Ì-ÊåÍÊ×ßÇÑÄÒ ÀöÏüÐÜÄé. ×á ×ÑÇßÍÓ Ì-É? ÅêÏÅÌ- Ï?Ç? Ì-É?È? Ë÷Ïû×ßÏ? Ë÷ÐÜÖ?È? ÏþÏÅ×ßÄÒ ÀöÏüÈ? ÄéÇù É?Ì-ÅÅ À? Ã?ÏÓ ÀÝÐÜÄé.

top

IP ÑæÌâ ×áÀÃÏÅ Ï?Ç? ÐÜÈ?ÁòÉí Ð?Ë÷ÐÜÖ? ÏþÏÅ×ßÁò.

Ì-É?ÏÅ IP ÑæÌâÀÅ ×áÀà ÐæÀý, DNSÏÅÌ- Ï?Ç? ÑæÌâ(CNAMES)ÀÅ ÐÜ ÔÔ×ËÕÝÈ? ÀÅÈ?ÕÂÄé. ÐÜ ÔÔ×ËÕÝÏÅÌ- www.example.comÀ? www.example.orgÐ× Ð?Ì-É?È? Í××ð×ßÀý ÍÝÄé.

Note

ÎÖÖÔÔÅ Ì-É?ÏÅ ÀÅË?Ø?ÍÊÖ? ÌÃÑ?ÐË ×áÄéÀý Áç Ø?ÍÊÖ?ÈýÏÅ Äû×á DNS ×çÈåÐÜ ÐêÅÏÐÜÇÞ ËÌÊÅ×Ñ? ÎÚÄÒÄé. ÉíÅõÍÓ DNSÏÅ IP ÑæÌâÈ? ÀÅÈ?ÕÀÄÒ ÐÜÈ?ÐÜ ÐæÎþÎï ×áÄé. ÎØÁçÇ?Èù ÎÖÉ?ÅÅ Ð?Ë÷ÐÜÖ?È? ÊÌ Ì? Î?Äé. ÀÛË÷×èÊÈÁò Ð?×è hosts ÖÔÐßÏÅ ×çÈåÐË ÓïÀÅ×â Ì? ÐæÑ?ÈÈ, ÐÜÄÒ hosts ×çÈåÐË ÀÅÑ? ÔÔ×ËÕÝÏÅÈÈ ÉíÏÅÅØÄé.

Ì-É? ÌÃÑ?

# ÎÖÖÔÔÅÀÅ Ö?Ö? 80ÐË ÁòÄéÈÀÄé
Listen 80

# È?Å÷ IP ÑæÌâÏÅÌ- ÀÅË?Ø?ÍÊÖ? ÏôÓËÐË ÁòÄéÈÀÄé
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /www/example1
ServerName www.example.com

# ÄéÈ? Ñ?ÍÓÎþÅùÅÅ ÐæÄé

</VirtualHost>

<VirtualHost *:80>
DocumentRoot /www/example2
ServerName www.example.org

# ÄéÈ? Ñ?ÍÓÎþÅùÅÅ ÐæÄé

</VirtualHost>

ÊÀ×?ÄÒ È?Å÷ ÑæÌâÈ? ÀÅÈ?ÕÀÉ×ÇÞ, ÑæÌ-É?ÄÒ ÎþÆ ÏôÓËÅÅ Ì-ÊåÍÊ×ßÑ? ÎÚÄÒÄé. www.example.comÐÜ ÌÃÑ?ÖÔÐßÏÅ ÓÃÐÍÐÈÇÞ Ã?ÏÐÉ×ÇÞ ÀÅÐõ Ã?ÐÊ ÏüÌÁÌ?Ð?È? ÀÅÑ?È÷, ÁòÊËØ?ÐÊ ÓÚÁò Ì-É?ÀÅ ÅØÄé. ÎþÆ ServerName Ñ?ÍÓÎþÏÅÅÅ ×èÄ÷Å×Ñ?ÎÚÄÒ ÏôÓËÐÊ ÓÉÉ?ÒÀ VirtualHostÀÅ Ì-ÊåÍÊ×áÄé.

ÑæÐ×

Ï?×áÄéÈù * ÄûÍÕ ÍÓÍÊÕëÐ× Í×Ñ? IP ÑæÌâÈ? Ë÷Ïû×â Ì? ÐæÄé. ÐÜ ÀöÏü VirtualHostÐ× ÎÖÁäÈåÖ?ÄÒ NameVirtualHostÐ× ÎÖÁäÈåÖ?ÏÝ ÐßÔÅ×èÎï ×áÄé:

NameVirtualHost 172.20.30.40

<VirtualHost 172.20.30.40>
# ËÇ? ...

ÁçÇ?Ã? ISPÏÅÌ- ÅÏÐ?ÐÈÇÞ IP ÑæÌâÈ? ÀÅÑ?ÏÐÄÒ Åþ IP ÑæÌâÈ? È?È?ÄÒ ÀöÏüÏÅÄÒ *È? Ë÷Ïû×ßÄÒ ÀÝÐÜ Ð?Ïû×ßÄé. *ÄÒ È?Å÷ IP ÑæÌâÏÅ ×èÄ÷×ßÉ×ÇÞ, IP ÑæÌâÀÅ Ê?ÀöÅ×ÎþÅÅ ÌÃÑ?ÐË Ê?Àö×â ×ÚÏôÀÅ Î?Äé.

ÀÕÐ× ÄûÊÞÊàÐ× ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ? ÌÃÑ?ÐÊ Ð?ÏÝ ÀÀÄé. ÏÉÏìÄÒ ÄéÈ? IP ÑæÌâÃ? Ö?Ö?ÇÞ ÄéÈ? ÃËÏûÐË Ì-ÊåÍÊ×ßÇÑÄÒ ÀöÏüÐÜÄé.

top

Ï?Ç? IP ÑæÌâÏÅÌ- ÐÜÈ?ÁòÉí Ø?ÍÊÖ?.

ÑæÐ×

Ï?ÁòÌ- ÌÃÈý×á ÉöÉÐÊ IP ÑæÌâÀÅ ÈþÀÃÆ?ÅÅ Ð?ÏûÀÅÄÙ×ßÄé.

Ì-É?ÄÒ IP ÑæÌâÀÅ ÅÞÀÃÐæÄé. ×ßÃ?ÏÅÌ- (172.20.30.40) "Ñæ" Ì-É? server.domain.comÐË Ì-ÊåÍÊ×ßÀý, ÄéÈ? ×ßÃ?ÏÅÌ- (172.20.30.50) Ï?Ç? ÀÅË?Ø?ÍÊÖ?È? Ì-ÊåÍÊ×â ÀÝÐÜÄé.

Ì-É? ÌÃÑ?

Listen 80

# 172.20.30.40ÏÅÌ- Í××ð×ßÄÒ "Ñæ"Ì-É?ÐÜÄé
ServerName server.domain.com
DocumentRoot /www/mainserver

# ÄéÈ? ÑæÌâÄé
NameVirtualHost 172.20.30.50

<VirtualHost 172.20.30.50>
DocumentRoot /www/example1
ServerName www.example.com

# ÄéÈ? Ñ?ÍÓÎþÅùÅÅ ÐæÄé ...

</VirtualHost>

<VirtualHost 172.20.30.50>
DocumentRoot /www/example2
ServerName www.example.org

# ÄéÈ? Ñ?ÍÓÎþÅùÅÅ ÐæÄé ...

</VirtualHost>

172.20.30.50ÐÜ ÎÖÄá ÑæÌâÏÅ Äû×á ÏôÓËÐÊ ÑæÌ-É?ÀÅ Ì-ÊåÍÊ×áÄé. Ø?ÍÊÖ?Èý Î?ÐÜ, Ñÿ Host: ×üÄ?Î?ÐÜ 172.20.30.50ÇÞ ÏôÓË×ßÈù www.example.comÐÜ Ì-ÊåÍÊ×áÄé.

top

(ÃËÊÞÏÝ ÏìÊÞ ÑæÌâÏÝ ÀÀÐÜ) ÄéÈ? IP ÑæÌâÇÞ ÀÀÐÊ ÃËÏûÐË Ì-ÊåÍÊ×ßÁò.

Ì-É? ÔÔ×ËÕÝÏÅ IP ÑæÌâÀÅ ÅÞÀà (192.168.1.1À? 172.20.30.40) ÐæÄé. ÔÔ×ËÕÝÄÒ ÃËÊÞ (ÐÞÖ?Æ?Ãí) ÃçÖ?Ï?À? ÏìÊÞ (ÐÞÕÝÃí) ÃçÖ?Ï? Ë÷ÐÜÏÅ Ð?ÔÅ×áÄé. ÃçÖ?Ï? ÉëÏÅÌ- server.example.comÐÊ ÏìÊÞ ÑæÌâÈ? (172.20.30.40) Ð×ÉÜ×ßÀý, ÃçÖ?Ï? ÃËÊÞÏÅÌ- ÀÀÐÊ ÐÜÈ?ÐË ÃËÊÞ ÑæÌâÇÞ (192.168.1.1) Ë÷Ïû×áÄé.

Ì-É?ÄÒ VirtualHost ÌÍÌ× ×áÀÃÇÞ ÃËÊÞÏÝ ÏìÊÞ ÐÐÄôÏÅ ÀÀÐÊ ÃËÏûÐË Ì-ÊåÍÊ×â Ì? ÐæÄé.

Ì-É? ÌÃÑ?

NameVirtualHost 192.168.1.1
NameVirtualHost 172.20.30.40

<VirtualHost 192.168.1.1 172.20.30.40>
DocumentRoot /www/server1
ServerName server.example.com
ServerAlias server
</VirtualHost>

ÐÜÑ? ÅÞ ÃçÖ?Ï?ÏÅÌ- ÅùÎþÏÒ ÏôÓËÐË ÀÀÐÊ VirtualHostÏÅÌ- Ì-ÊåÍÊ×áÄé.

ÑæÐ×:

ÃËÊÞ ÃçÖ?Ï?ÏÅÌ-ÄÒ ÏßÐ?×á Ø?ÍÊÖ?Èý server.example.com ÄûÍÕ ÐÜÈ? serverÅÅ ÀÅÄÙ×ßÄé.

Æ××á Ð?Ð× ÏÉÏÅÌ- IP ÑæÌâ ÄûÍÕ *ÐË Ë÷Ïû×ßÏ? Ì-É?ÀÅ È?Å÷ ÑæÌâÏÅ ÅÏÐß×ßÀä ÅÏÐë×â Ì? ÐæÄé.

top

Ï?Ç? Ö?Ö?ÏÅÌ- Ì-ÇÞ ÄéÈ? Ë÷ÐÜÖ? ÏþÏÅ×ßÁò.

ÀÀÐÊ IPÐ× Ï?Ç? Ö?Ö?ÏÅÌ- Ì-ÇÞ ÄéÈ? ÅÅÈîÐÞÐË Ì-ÊåÍÊ×áÄéÀý ÀÅÑ?×ßÐê. ÐÜÄÒ "NameVirtualHost" ÕÒÁçÏÅ Ö?Ö?È? Ñ?Ð××ßÈù ÀÅÄÙ×ßÄé. NameVirtualHost name:portÎ?ÐÜ <VirtualHost name:port>ÈÈ Ø?ÐÊ Listen Ñ?ÍÓÎþÈÈ Ë÷Ïû×ßÈù ÎØÅØÄé.

Ì-É? ÌÃÑ?

Listen 80
Listen 8080

NameVirtualHost 172.20.30.40:80
NameVirtualHost 172.20.30.40:8080

<VirtualHost 172.20.30.40:80>
ServerName www.example.com
DocumentRoot /www/domain-80
</VirtualHost>

<VirtualHost 172.20.30.40:8080>
ServerName www.example.com
DocumentRoot /www/domain-8080
</VirtualHost>

<VirtualHost 172.20.30.40:80>
ServerName www.example.org
DocumentRoot /www/otherdomain-80
</VirtualHost>

<VirtualHost 172.20.30.40:8080>
ServerName www.example.org
DocumentRoot /www/otherdomain-8080
</VirtualHost>

top

IPÁòÉí ÀÅË?Ø?ÍÊÖ?

Ì-É?ÄÒ À?À? www.example.comÀ? www.example.orgÏÅ ×èÄ÷×ßÄÒ ÅÞ IP ÑæÌâÈ? (172.20.30.40À? 172.20.30.50) ÀÅÑ?Äé.

Ì-É? ÌÃÑ?

Listen 80

<VirtualHost 172.20.30.40>
DocumentRoot /www/example1
ServerName www.example.com
</VirtualHost>

<VirtualHost 172.20.30.50>
DocumentRoot /www/example2
ServerName www.example.org
</VirtualHost>

<VirtualHost> Ñ?ÍÓÎþÇÞ Ñ?Ñ?×á ÑæÌâÏÅ ×èÄ÷×ßÑ?ÎÚÄÒ ÑæÌâÇÞ (ÏÉÈ? ÅùÎþ, localhost) ÏôÓËÐÜ ÅùÎþÏÐÈù ÑæÌ-É?ÀÅ ÐæÄÒ ÀöÏü ÑæÌ-É?ÀÅ Ì-ÊåÍÊ×áÄé.

top

Ö?Ö?ÁòÉíÀ? ipÁòÉíÐÜ Ø?×åÅØ ÀÅË?Ø?ÍÊÖ?

Ì-É?ÄÒ À?À? www.example.comÀ? www.example.orgÏÅ ×èÄ÷×ßÄÒ ÅÞ IP ÑæÌâÈ? (172.20.30.40À? 172.20.30.50) ÀÅÑ?Äé. À? IPÐ× 80É?À? 8080É? Ö?Ö?ÏÅ ÀÅË?Ø?ÍÊÖ?È? ÅÉÈÀÄé.

Ì-É? ÌÃÑ?

Listen 172.20.30.40:80
Listen 172.20.30.40:8080
Listen 172.20.30.50:80
Listen 172.20.30.50:8080

<VirtualHost 172.20.30.40:80>
DocumentRoot /www/example1-80
ServerName www.example.com
</VirtualHost>

<VirtualHost 172.20.30.40:8080>
DocumentRoot /www/example1-8080
ServerName www.example.com
</VirtualHost>

<VirtualHost 172.20.30.50:80>
DocumentRoot /www/example2-80
ServerName www.example.org
</VirtualHost>

<VirtualHost 172.20.30.50:8080>
DocumentRoot /www/example2-8080
ServerName www.example.org
</VirtualHost>

top

ÐÜÈ?ÁòÉíÀ? IPÁòÉíÐÜ Ø?×åÅØ ÀÅË?Ø?ÍÊÖ?

ÑæÌâÑï ÈþÈþÐÊ ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?ÇÞ, ÄéÈ? ÀÝÐÊ IPÁòÉí ÀÅË?Ø?ÍÊÖ?ÇÞ Ì-ÊåÍÊ×ßÀý ÍÝÄé.

Ì-É? ÌÃÑ?

Listen 80

NameVirtualHost 172.20.30.40

<VirtualHost 172.20.30.40>
DocumentRoot /www/example1
ServerName www.example.com
</VirtualHost>

<VirtualHost 172.20.30.40>
DocumentRoot /www/example2
ServerName www.example.org
</VirtualHost>

<VirtualHost 172.20.30.40>
DocumentRoot /www/example3
ServerName www.example3.net
</VirtualHost>

# IP-ÁòÉí
<VirtualHost 172.20.30.50>
DocumentRoot /www/example4
ServerName www.example4.edu
</VirtualHost>

<VirtualHost 172.20.30.60>
DocumentRoot /www/example5
ServerName www.example5.gov
</VirtualHost>

top

_default_ ÀÅË?Ø?ÍÊÖ? Ë÷Ïû×ßÁò

È?Å÷ Ö?Ö?ÏÅ Äû×á _default_ ÀÅË?Ø?ÍÊÖ?

ÎþÆ ÀÅË?Ø?ÍÊÖ?ÏÅÅÅ ×èÄ÷×ßÑ?ÎÚÐÊ IP ÑæÌâÏÝ Ö?Ö?ÏÅ Äû×á È?Å÷ ÏôÓËÐË ÓÃÈ?×ßÁò.

Ì-É? ÌÃÑ?

<VirtualHost _default_:*>
DocumentRoot /www/default
</VirtualHost>

default(ÁòÊË) ÀÅË?Ø?ÍÊÖ?Ð× Ö?Ö?ÇÞ ÏÝÐßÅõÔ?ÅõÈ? Ë÷Ïû×ßÏ? ÎþÆ ÏôÓËÅÅ ÑæÌ-É?ÇÞ È?ÀÅÅÅÇß ÈÈÅ÷Äé.

default ÀÅË?Ø?ÍÊÖ?ÄÒ ÐÄûÇÞ ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?ÀÅ Ë÷Ïû×ßÄÒ ÑæÌâ/Ö?Ö?ÇÞÐ× ÏôÓËÐË Ì-ÊåÍÊ×ßÑ? ÎÚÄÒÄé. ÎÛ Ì? Î?ÀÕÃ? Host: ×üÄ?ÀÅ ËÇ?ÅØ ÏôÓËÐÊ ×çË? ÓæÓÚÐ× ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?(ÌÃÑ?ÖÔÐßÏÅÌ- ÑæÌâ/Ö?Ö?ÀÅ ÓÃÐÍÐÈÇÞ Ã?ÏÒ ÀÅË?Ø?ÍÊÖ?)ÀÅ Ì-ÊåÍÊ×áÄé.

AliasMatchÃ? RewriteRuleÐË Ë÷Ïû×ßÏ? ÎþÆ ÏôÓËÐË Ö?Ñ? ÖôÐÜÑ?(Ø?ÐÊ ÍÊÕ?ÈÃÖ?)ÇÞ Ð÷ÐëÌÊ×â(rewrite) Ì? ÐæÄé.

Ï?Ç? Ö?Ö?ÏÅ Äû×á _default_ ÀÅË?Ø?ÍÊÖ?

Ð?Ð× ÀöÏüÏÝ ÀÀÑ?ÈÈ, Ì-É?ÄÒ Ï?Ç? Ö?Ö?È? ÁòÄéÈ?Àý 80É? Ö?Ö?ÏÅ Äû×èÌ- ÓïÀÅÇÞ _default_ ÀÅË?Ø?ÍÊÖ?È? Ë÷Ïû×ßÀý ÍÝÄé.

Ì-É? ÌÃÑ?

<VirtualHost _default_:80>
DocumentRoot /www/default80
# ...
</VirtualHost>

<VirtualHost _default_:*>
DocumentRoot /www/default
# ...
</VirtualHost>

80É? Ö?Ö?ÏÅ Äû×á default ÀÅË?Ø?ÍÊÖ?ÄÒ (ÉíÅõÍÓ ÏÝÐßÅõÔ?Åõ Ö?Ö?È? ÀÅÑ? ÁòÊË ÀÅË?Ø?ÍÊÖ? ÐÜÐ?ÏÅ Ã?ÏÝÎï ×áÄé) Ñ?Ñ?×ßÑ?ÎÚÐÊ IP ÑæÌâÇÞ ÊÈÃËÑ? È?Å÷ ÏôÓËÐË Ì-ÊåÍÊ×áÄé. ÑæÌ-É?ÄÒ ÐÄûÇÞ ÏôÓËÐË Ì-ÊåÍÊ×ßÑ? È?×áÄé.

×á Ö?Ö?ÏÅ Äû×á _default_ ÀÅË?Ø?ÍÊÖ?

80É? Ö?Ö?ÏÅ Äû×èÌ-ÈÈ default ÀÅË?Ø?ÍÊÖ?È? ÈÈÅùÀý ÍÝÄé.

Ì-É? ÌÃÑ?

<VirtualHost _default_:80>
DocumentRoot /www/default
...
</VirtualHost>

Ö?Ö? 80É?ÏÅ Ñ?Ñ?×ßÑ?ÎÚÐÊ ÑæÌâÏÅ Äû×á ÏôÓËÐÊ ÁòÊË ÀÅË?Ø?ÍÊÖ?ÀÅ Ì-ÊåÍÊ×ßÀý, ÄéÈ? Ñ?Ñ?×ßÑ?ÎÚÐÊ ÑæÌâÏÝ Ö?Ö?È? ÀÅÑ? ÏôÓËÐÊ Ñæ Ì-É?ÀÅ Ì-ÊåÍÊ×áÄé.

top

ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?È? IPÁòÉí ÀÅË?Ø?ÍÊÖ?ÇÞ ÏÕÁòÁò

(ÐÜÈ?ÁòÉíÐ× ÓÉÉ?ÒÀ ÏÉÏÅÌ-) Ø?ÍÊÖ?Èý www.example.orgÏÅ Äû×á ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?ÄÒ ÐêÍÕÐ× IP ÑæÌâÈ? ÀÅÑ?Îï ×áÄé. ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?Ð× ÐÜÐ? IP ÑæÌâÈ? ÔÃÍÜ×ßÄÒ ÃçÐãÌ-É?Ã? ×ÑÇßÍÓÏÝÐ× É?Ñ?È? ×××ßÁòÐ?×è ÏÕÁòÄÒ ÅÏÎØ Åá È?ÅÞÈ? Ì-ÊåÍÊ×ßÀý ÍÝÄé.

ÉöÉÐÊ VirtualHost Ñ?ÍÓÎþÏÅ Ë? IP ÑæÌâÈÈÐË (172.20.30.50) ÓïÀÅ×ßÈùÅ×É×ÇÞ ÍÁÄé.

Ì-É? ÌÃÑ?

Listen 80
ServerName www.example.com
DocumentRoot /www/example1

NameVirtualHost 172.20.30.40

<VirtualHost 172.20.30.40 172.20.30.50>
DocumentRoot /www/example2
ServerName www.example.org
# ...
</VirtualHost>

<VirtualHost 172.20.30.40>
DocumentRoot /www/example3
ServerName www.example.net
ServerAlias *.example.net
# ...
</VirtualHost>

ÐÜÑ? (IPÁòÉí ÀÅË?Ø?ÍÊÖ?È? Õû×á) Ë?ÇÞÏþ ÑæÌâÏÝ (ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?È? Õû×á) ÐÜÐ? ÑæÌâ È?ÅÞ ÀÅË?Ø?ÍÊÖ?ÏÅ Ñ?Áé×â Ì? ÐæÄé.

top

ServerPath Ñ?ÍÓÎþ Ë÷Ïû×ßÁò

ÅÞ ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?È? ÀÅÑ? Ì-É?ÀÅ ÐæÄé. ÏÓÉéÈ? ÀÅË?Ø?ÍÊÖ?È? ÌÁÕÓ×ßÁòÐ?×è Õ?Æ?ÐÜÎ?Ö?ÄÒ ÏÓÉéÈ? Host: ×üÄ?È? ÊÈÃËÎï ×áÄé. ÏÐÇÅÅØ HTTP/1.0 Õ?Æ?ÐÜÎ?Ö?ÀÅ ÐÜ ×üÄ?È? ÊÈÃËÑ? È?×ßÈù ÎÖÖÔÔÅÄÒ Õ?Æ?ÐÜÎ?Ö?ÀÅ ÎþÆ ÀÅË?Ø?ÍÊÖ?È? ÊÈÇÑÀý×ßÄÒÑ? ÎÛ Ì? Î?Äé (ÁçÇÅÌ- ÓæÓÚÐ× ÀÅË?Ø?ÍÊÖ?ÀÅ ÏôÓËÐË Ì-ÊåÍÊ×áÄé). ÏÐÇÅÅØ ÊúÆ?ÏüÐ?ÏÝ ÀÅÄÙ×á Ø?Ø?ÐË Ð?Ñ?×ßÁòÐ?×è ÓæÓÚÐ× ÀÅË?Ø?ÍÊÖ?È? ÈÈÅùÀý, Ï?ÁòÏÅ ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?Ð× URL Ñ?ÅÞË÷È? Ö?×ä×ßÄÒ ÈÅÕ? ÈåÇß ÖôÐÜÑ?È? ÅàÄé.

Ì-É? ÌÃÑ?

NameVirtualHost 172.20.30.40

<VirtualHost 172.20.30.40>
# primary vhost
DocumentRoot /www/subdomain
RewriteEngine On
RewriteRule ^/.* /www/subdomain/index.html
# ...
</VirtualHost>

<VirtualHost 172.20.30.40>
DocumentRoot /www/subdomain/sub1
ServerName www.sub1.domain.tld
ServerPath /sub1/
RewriteEngine On
RewriteRule ^(/sub1/.*) /www/subdomain$1
# ...
</VirtualHost>

<VirtualHost 172.20.30.40>
DocumentRoot /www/subdomain/sub2
ServerName www.sub2.domain.tld
ServerPath /sub2/
RewriteEngine On
RewriteRule ^(/sub2/.*) /www/subdomain$1
# ...
</VirtualHost>

ServerPath Ñ?ÍÓÎþÆ?É?ÏÅ URL http://www.sub1.domain.tld/sub1/ÏÅ Äû×á ÏôÓËÐÊ ×çË? subl-ÀÅË?Ø?ÍÊÖ?ÀÅ Ì-ÊåÍÊ×áÄé.
Õ?Æ?ÐÜÎ?Ö?ÀÅ ÏÓÉéÈ? Host: ×üÄ?È? ÊÈÃÍÄéÈù, URL http://www.sub1.domain.tld/ÏÅ Äû×á ÏôÓËÐÊ subl-ÀÅË?Ø?ÍÊÖ?ÏÅÌ-ÈÈ Ì-ÊåÍÊ×áÄé. ÈÈÎð Host: ×üÄ?È? ÊÈÃËÑ?ÎÚÐÈÈù Õ?Æ?ÐÜÎ?Ö?ÄÒ ÓæÓÚÐ× Ø?ÍÊÖ?ÏÅ ÐæÄÒ Ñ?ÊÈÖôÐÜÑ?È? ÊÈÀäÅØÄé.

Ï?ÁòÏÅ É?Ñ?ÀÅ ÐæÐÍÐË ÑæÐ××ßÆ?: Õ?Æ?ÐÜÎ?Ö?ÀÅ Host: ×üÄ?È? ÊÈÃËÑ?ÎÚÐÈÈù http://www.sub2.domain.tld/sub1/ÏÅ Äû×á ÏôÓËÅÅ subl-ÀÅË?Ø?ÍÊÖ?ÀÅ Ì-ÊåÍÊ×áÄé.

RewriteRule Ñ?ÍÓÎþÈ? Ë÷Ïû×ßÏ? ÏÓÉéÈ? Host: ×üÄ?È? ÊÈÃËÄÒ Õ?Æ?ÐÜÎ?Ö?ÄÒ (ÏÉÈ? ÅùÎþ, URL Ð?ÔÅË÷ÀÅ ÐæÀÕÃ? Î?ÄÒ) ÅÞ URLÐË È?ÅÞ Ë÷Ïû×â Ì? ÐæÄé.

ÀÅÄÙ×á Î?Îþ:  en  |  fr  |  ja  |  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.