Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ
îðèãèíàëüíîãî äîêóìåíòà
: 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 Version 2.2
ÐÜ É?Ì-ÄÒ ÐêÑæ É?Ð×Å×ÄÒ ÀÅË?Ø?ÍÊÖ? Ñ?É?ÏÅ ÄôÐË ×ßÇÑÀý ÎÂÏ?ÑÃÄé. Ë?ØÂÐÊ ÐÜÈ?ÁòÉíÐÜÃ? IPÁòÉí ÀÅË?Ø?ÍÊÖ?È? Õû×è ×á Ì-É?ÏÅÌ- Ï?Ç? Ð?Ë÷ÐÜÖ?È? Ì-ÊåÍÊ×ßÇÑÄÒ ÀöÏüÐÜÄé. ×á ×ÑÇßÍÓ Ì-É? ÅêÏÅÌ- Ï?Ç? Ì-É?È? Ë÷Ïû×ßÏ? Ë÷ÐÜÖ?È? ÏþÏÅ×ßÄÒ ÀöÏüÈ? ÄéÇù É?Ì-ÅÅ À? Ã?ÏÓ ÀÝÐÜÄé.
_default_
ÀÅË?Ø?ÍÊÖ?
Ë÷Ïû×ßÁòServerPath
Ñ?ÍÓÎþ Ë÷Ïû×ßÁòÌ-É?ÏÅ IP ÑæÌâÀÅ ×áÀà ÐæÀý, DNSÏÅÌ- Ï?Ç? ÑæÌâ(CNAMES)ÀÅ
ÐÜ ÔÔ×ËÕÝÈ? ÀÅÈ?ÕÂÄé. ÐÜ ÔÔ×ËÕÝÏÅÌ- www.example.com
À?
www.example.org
Ð× Ð?Ì-É?È? Í××ð×ßÀý ÍÝÄé.
ÎÖÖÔÔÅ Ì-É?ÏÅ ÀÅË?Ø?ÍÊÖ? ÌÃÑ?ÐË
×áÄéÀý Áç Ø?ÍÊÖ?ÈýÏÅ Äû×á 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 ÑæÌâÃ? Ö?Ö?ÇÞ ÄéÈ? ÃËÏûÐË Ì-ÊåÍÊ×ßÇÑÄÒ ÀöÏüÐÜÄé.
Ï?ÁòÌ- ÌÃÈý×á ÉöÉÐÊ 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
ÐÜ Ì-ÊåÍÊ×áÄé.
Ì-É? ÔÔ×ËÕÝÏÅ 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 ÑæÌâ ÄûÍÕ *
ÐË
Ë÷Ïû×ßÏ? Ì-É?ÀÅ È?Å÷ ÑæÌâÏÅ ÅÏÐß×ßÀä ÅÏÐë×â Ì?
ÐæÄé.
ÀÀÐÊ 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>
Ì-É?ÄÒ À?À? 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
)
ÏôÓËÐÜ ÅùÎþÏÐÈù ÑæÌ-É?ÀÅ ÐæÄÒ ÀöÏü ÑæÌ-É?ÀÅ Ì-ÊåÍÊ×áÄé.
Ì-É?ÄÒ À?À? 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>
ÑæÌâÑï ÈþÈþÐÊ ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?ÇÞ, ÄéÈ? ÀÝÐÊ 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>
_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É?ÏÅ Ñ?Ñ?×ßÑ?ÎÚÐÊ ÑæÌâÏÅ Äû×á ÏôÓËÐÊ ÁòÊË ÀÅË?Ø?ÍÊÖ?ÀÅ Ì-ÊåÍÊ×ßÀý, ÄéÈ? Ñ?Ñ?×ßÑ?ÎÚÐÊ ÑæÌâÏÝ Ö?Ö?È? ÀÅÑ? ÏôÓËÐÊ Ñæ Ì-É?ÀÅ Ì-ÊåÍÊ×áÄé.
(ÐÜÈ?ÁòÉíÐ× ÓÉÉ?ÒÀ ÏÉÏÅÌ-) Ø?ÍÊÖ?Èý
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ÁòÉí ÀÅË?Ø?ÍÊÖ?È? Õû×á) Ë?ÇÞÏþ ÑæÌâÏÝ (ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?È? Õû×á) ÐÜÐ? ÑæÌâ È?ÅÞ ÀÅË?Ø?ÍÊÖ?ÏÅ Ñ?Áé×â Ì? ÐæÄé.
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ÐË È?ÅÞ Ë÷Ïû×â Ì? ÐæÄé.