Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ
îðèãèíàëüíîãî äîêóìåíòà
: http://www.arcetri.astro.it/manual/ko/vhosts/name-based.html
Äàòà èçìåíåíèÿ: Mon Jan 21 19:44:30 2013 Äàòà èíäåêñèðîâàíèÿ: Fri Feb 28 07:26:25 2014 Êîäèðîâêà: ISO8859-5 Ïîèñêîâûå ñëîâà: ï ï ï ï ï ï ï ï ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï |
Apache HTTP Server Version 2.2
ÐÜ É?Ì-ÄÒ ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?È? Ë÷Ïû×ßÄÒ ÀöÏüÏÝ ÉöÉÐË ÌÃÈý×áÄé.
IPÁòÉí ÀÅË?Ø?ÍÊÖ?ÄÒ Ï?Àñ×á IP ÑæÌâÈ? ÀÅÑ?Àý Ì-ÊåÍÊ×â ÀÅË?Ø?ÍÊÖ?È? ÀñÑ?×áÄé. ÁçÇÅÌ- À? Ø?ÍÊÖ?ÄÒ Ì-ÇÞ ÄéÈ? IP ÑæÌâÈ? ÀÅÑ?Îï ×áÄé. ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?Ð× ÀöÏü Ì-É?ÄÒ Õ?Æ?ÐÜÎ?Ö?ÀÅ HTTP ×üÄ?ÇÞ Ø?ÍÊÖ?ÈýÐË ÎÛÇÑÑæÁö ÉéÆ?Äé. ÐÜÇÁ ÉöÉÐÈÇÞ ×á IP ÑæÌâÇÞ Ï?Ç? ÄéÈ? Ø?ÍÊÖ?È? Ì-ÊåÍÊ×â Ì? ÐæÄé.
ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?ÄÒ DNS Ì-É?ÀÅ À? Ø?ÍÊÖ?ÈýÐÜ ÏÓÉéÈ? IP ÑæÌâÇÞ ÄûÐÐ×ßÅÅÇß ÀÅË?Ø?ÍÊÖ?È? ÌÃÑ?×ßÀý, ÄéÈ? Ø?ÍÊÖ?ÈýÐË ÁÈÊÀ×â Ì? ÐæÅÅÇß ÎÖÖÔÔÅ Ð?Ì-É?È? ÌÃÑ?×ßÁòÈÈ ×ßÈùÅ×É×ÇÞ Ä? À?Äì×ßÄé. ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?ÄÒ Æ× Ï?Ç? IP ÑæÌâÀÅ ×ÚÏôÎ?Äé. ÁçÇ?É×ÇÞ Ö?ÊÀØ? IPÁòÉí ÀÅË?Ø?ÍÊÖ?È? ÌÁÕÓ×â ÐÜÐ?ÀÅ Î?ÄéÈù ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?È? Ë÷Ïû×èÎï ×áÄé. IPÁòÉí ÀÅË?Ø?ÍÊÖ?È? Ë÷Ïû×èÎï×â ÐÜÐ?ÇÞÄÒ:
À?ÇÓÅØ È?Åò | À?ÇÓÅØ Ñ?ÍÓÎþ |
---|---|
ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?È? Ë÷Ïû×ßÇÑÈù Ì-É?ÄÒ Ï?ÀñÐË ÉîÐË
IP ÑæÌâÈ? (ÎÖÈÆ Ö?Ö?ÅÅ) Ñ?×èÎï ×áÄé. ÐÜÄÒ NameVirtualHost
Ñ?ÍÓÎþÇÞ ÀÅÄÙ×ßÄé.
ÐßÉíÐ?ÐÈÇÞ Ì-É?Ð× È?Å÷ IP ÑæÌâÈ? Ë÷Ïû×áÄéÈù
NameVirtualHost
Ð×
ÎÖÁäÈåÖ?ÇÞ *
È? Ë÷Ïû×áÄé. Ï?Ç? Ö?Ö?È? Ë÷Ïû×â
(ÏÉÈ? ÅùÎþ, SSLÐË Ë÷Ïû×â) ÀøØÉÐÜÆ?Èù *:80
À?
ÀÀÐÜ ÎÖÁäÈåÖ?ÏÅ Ö?Ö?È? ÓïÀÅ×èÎï ×áÄé. NameVirtualHost
Ñ?ÍÓÎþÏÅ IP ÑæÌâÈ?
Ð?ÎþÑæÎ?ÄéÀý Ì-É?ÀÅ ÐêÅÏÐÈÇÞ Áç IP ÑæÌâÈ? ÁòÄéÈ?Ñ? ÎÚÐÍÐË
ÑæÐ××ßÆ?. ÐêÌÌ×á ÃËÏûÐÊ ÎÖÖÔÔÅÀÅ
Ë÷Ïû×â ÑæÌâÏÝ Ö?Ö? ÌÃÑ?×ßÁòÈ? Ò?Àý×ßÆ?. Æ×, Ï?ÁòÌ-
Ñ?Ñ?×á IP ÑæÌâÄÒ Ì-É?Ð× ÃçÖ?Ï? ÐÞÕÝÖôÐÜÍÊÐÜÎþÎï ×áÄé.
ÄéÐÍ ÄìÀøÄÒ Ì-ÊåÍÊ×ßÇÑÄÒ Ø?ÍÊÖ?ÊÀÇÞ <VirtualHost>
ÊýÇßÐË
ÈÈÅõÄÒ ÐßÐÜÄé. <VirtualHost>>
Ñ?ÍÓÎþÐ× ÎÖÁäÈåÖ?ÄÒ
NameVirtualHost
Ñ?ÍÓÎþÐ×
ÎÖÁäÈåÖ?(ÏÉÈ? ÅùÎþ, IP ÑæÌâÃ? È?Å÷ ÑæÌâÈ? Æö×ßÄÒ *
)ÏÝ
ÀÀÎÖÎï ×áÄé. <VirtualHost>>
ÊýÇß ÎØÏÅÄÒ
ÓæÌâ×á Ì-ÊåÍÊ×â Ø?ÍÊÖ?È? Ñ?Ñ?×ßÄÒ ServerName
Ñ?ÍÓÎþÏÝ Ø?ÍÊÖ?Ð×
ÃËÏûÐÜ ÖÔÐßÍÓÍÊÕë ÎþÅ?ÏÅ ÐæÄÒÑ?È? Ñ?Ñ?×ßÄÒ DocumentRoot
Ñ?ÍÓÎþÀÅ ×ÚÏô×ßÄé.
ÁòÑÈÏÅ Ë÷Ïû×ßÄ? Ð?Ì-É?ÏÅ ÀÅË?Ø?ÍÊÖ?È? ÓïÀÅ×áÄéÈù
ÁòÑÈÏÅ Ë÷Ïû×ßÄ? Ø?ÍÊÖ?ÏÅ Äû×á <VirtualHost>
ÊýÇßÅÅ ÓïÀÅ×èÎï
×áÄé. ÐÜ ÊýÇßÏÅ Ö?×ä×ßÄÒ ServerName
À? DocumentRoot
ÄÒ Ð?ÓÌ ServerName
À? DocumentRoot
ÏÝ ÀÀÎÖÎï ×áÄé.
ÌÃÑ?ÖÔÐßÏÅÌ- ÐÜ ÀÅË?Ø?ÍÊÖ?È? ÀÅÐõ ÈåÐ? Ð?ÐÈÈù ÁòÊË Ø?ÍÊÖ?ÀÅ
ÅØÄé.
ÏÉÈ? ÅùÎþ www.domain.tld
ÅÅÈîÐÞÐË Ì-ÊåÍÊ×ßÀý
ÐæÎ?ÄÒÅ? ÀÀÐÊ IP ÑæÌâÏÅ
www.otherdomain.tld
Æ? ÀÅË?Ø?ÍÊÖ?È? ÓïÀÅ×ßÀý
ÍÝÄéÀý ÀÅÑ?×ßÐê. httpd.conf
ÏÅ ÄéÐÍÀ? ÀÀÐÜ
ÓïÀÅ×ßÈù ÅØÄé:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>
<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>
NameVirtualHost
ÏÝ
<VirtualHost>
Ñ?ÍÓÎþ Åá È?ÅÞ *
ÄûÍÕ Ñ?Ñ? IP ÑæÌâÈ? Ñ?Ñ?×â
Ì?ÅÅ ÐæÄé. ÏÉÈ? ÅùÎþ, ÐÜÇÁÍÔÐÈÇÞ ×á IP ÑæÌâÏÅ Ï?Ç? ÐÜÈ?ÁòÉí
ÀÅË?Ø?ÍÊÖ?ÅùÐË ÅÉÈ?Àý, ÄéÈ? ÑæÌâÏÅ IPÁòÉí Ø?ÐÊ ÐÜÈ?ÁòÉí
ÀÅË?Ø?ÍÊÖ?ÅùÐË ÅÉÈÁ Ì? ÐæÄé.
ÎþÆ Ì-É?ÄÒ Ï?Ç? ÐÜÈ?ÐÈÇÞ Ñ?Ìã×â Ì? ÐæÁö ÉéÆ?Äé. ÐÜÄÒ
<VirtualHost>
ÌÍÌ× ÎØÏÅ ServerAlias
Ñ?ÍÓÎþÈ? Ë÷Ïû×ßÏ? ÀÅÄÙ×ßÄé. ÏÉÈ? ÅùÎþ Ð?Ð× ÓÉÉ?ÒÀ <VirtualHost>
ÊýÇßÏÅÌ-
ServerAlias
Ñ?ÍÓÎþÈ?
Ë÷Ïû×ßÈù Ï-ÀÕ×á ÐÜÈ?ÐÈÇÞ ÀÀÐÊ Ð?Ë÷ÐÜÖ?È? ÊÌ Ì? ÐæÄé:
ServerAlias domain.tld *.domain.tld
domain.tld
ÅÅÈîÐÞÏÅ ÐæÄÒ È?Å÷ Ø?ÍÊÖ?ÏÅ Äû×á
ÏôÓËÐË www.domain.tld
ÀÅË?Ø?ÍÊÖ?ÀÅ Ì-ÊåÍÊ×áÄé.
ÐÜÈ?ÐË ÑéÆ? ÏÝÐßÅõÔ?Åõ É?Ðê *
ÏÝ ?
È?
Ë÷Ïû×â Ì? ÐæÄé. ÉÀÇà ServerName
ÐÜÃ? ServerAlias
ÏÅ
ÐÜÈ?ÐË Ð?ÎþÑæÎ?ÄéÀý ÃÅÐÜ ÎÖÄßÄé. ÈåÐ? ÐÜ ÐÜÈ?ÅùÐÜ Ì-É?Ð×
IP ÑæÌâÇÞ ÄûÐÐ×ßÅÅÇß DNS Ì-É?È? ÎÛÈÒÀä ÌÃÑ?×èÎï ×áÄé.
ÈÆÑ?ÈÇÐÈÇÞ <<VirtualHost>>
ÎØÏÅ ÄéÈ?
Ñ?ÍÓÎþÅùÐË Ë÷Ïû×ßÏ? ÀÅË?Ø?ÍÊÖ?È? ÐêÌÌØ? ÌÃÑ?×â Ì? ÐæÄé.
ÄûÊÞÊàÐ× Ñ?ÍÓÎþÈ? Ë÷Ïû×â Ì? ÐæÐÈÈ÷, À?ÇÓÅØ ÀÅË?Ø?ÍÊÖ?Ð× ÌÃÑ?ÈÈÐË
Ê?Àö×áÄé. ÎþÆ Ñ?ÍÓÎþÀÅ Ë÷ÏûÀÅÄÙ×áÑ? ÎÛÇÑÈù Ñ?ÍÓÎþÐ× Ë÷ÏûÐõÌâÈ?
Ø?ÐÞ×ßÆ?. (<<VirtualHost>>
ÎØÐÜ ÎÖÄá)
ÑæÌ-É?ÌÃÑ?ÏÅÌ- Ñ?Ñ?×á ÌÃÑ? Ñ?ÍÓÎþÄÒ ÀÅË?Ø?ÍÊÖ?ÏÅ
ÀÀÐÊ ÌÃÑ? Ñ?ÍÓÎþÀÅ Î?ÄÒ ÀöÏüÏÅÈÈ Ë÷ÏûÅØÄé.
ÏôÓËÐË ÉîÐÈÈù Ì-É?ÄÒ ÈåÐ? NameVirtualHost
ÏÅÌ- Ñ?Ñ?×á IP
ÑæÌâÐÞÑ? ÀÛË÷×áÄé. ÁçÇÈÄéÈù Áç IP ÑæÌâÈ? ÀÅÑ? <VirtualHost>
ÌÍÌ×ÅùÏÅÌ- ÏôÓË×á Ø?ÍÊÖ?ÈýÀ? ÐßÔÅ×ßÄÒ ServerName
ÐÜÃ?
ServerAlias
È? Ó?ÄÒÄé. Ó?ÐÈÈù Áç ÌÃÑ?ÐË Ë÷Ïû×áÄé.
Ð?Ð×á ÀÅË?Ø?ÍÊÖ?È? Ó?Ñ?È?×ßÈù, IP ÑæÌâÏÅ ×èÄ÷×ßÄÒ
ÀÅË?Ø?ÍÊÖ?ÅùÑï ÓÉÉ?ÒÀ ÀÝÐË Ë÷Ïû×áÄé.
ÀñÀ?Ð?ÐÈÇÞ ÓÃÐÍÏÅ Ã?ÏÒ ÀÅË?Ø?ÍÊÖ?ÀÅ ÁòÊË
ÀÅË?Ø?ÍÊÖ?ÀÅ ÅØÄé. IP ÑæÌâÀÅ NameVirtualHost
Ñ?ÍÓÎþÏÅ ×èÄ÷×ßÈù,
ÑæÌ-É?Ð× DocumentRoot
ÄÒ
ÐÄûÇÞ Ë÷Ïû×ßÑ? ÎÚÄÒÄé. Ö?Ñ? ÀÅË?Ø?ÍÊÖ?ÏÅ
×èÄ÷×ßÑ?ÎÚÄÒ ÏôÓËÐË ÌÃÑ?×ßÇÑÈù ÌÃÑ?ÐË <VirtualHost>
ÏÅ ÄóÀý ÌÃÑ?ÖÔÐßÏÅÌ-
ÈåÐ? Ã?ÏÐÅÅÇß ×ßÈù ÅØÄé.
ÐÜÉÜ Ð?Î?ÅýÐÜ ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?ÀÅ ÏÓÉéÇÞ ÅÏÐë×ßÁòÐ?×è ×ÚÏô×á Ñ?ÊÈÈ? ÊÈÃËÑ?ÎÚÄÒ Õ?Æ?ÐÜÎ?Ö?ÀÅ ÐæÄé. ÐÜÇÁ Õ?Æ?ÐÜÎ?Ö?ÄÒ ×çË? ÏôÓË×á IP ÑæÌâÏÅ Äû×è ÓÉÉ?ÒÀÇÞ Ã?ÏÐÄÒ ÀÅË?Ø?ÍÊÖ? (ÓæÓÚÐ× ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?)ÀÅ Ì-ÊåÍÊ×áÄé.
Ï?ÁòÌ- ÏÐÇÅÅ×Î?ÐÍÐÊ Í×Ñ?ÇÞ Ë?Ä÷Ø? ÏÐÇÅÅØ ÀÝÐË Æö×áÄé.
ÏÐÄÓÃ? ÐÜÇÁ ÊúÆ?ÏüÐ?È? Ë÷Ïû×â ÐßÐÊ ÀÕÐ×Î?Äé. ÏôÑ?
ÊúÆ?ÏüÐ?ÄÒ È?ÅÞ ÐÜÈ?ÁòÉí ÀÅË?Ø?ÍÊÖ?ÏÅ ×ÚÏô×á Host
×üÄ?È? ÊÈÃÍÄé.
ÐÜ É?Ñ?ÄÒ ÎðÀ? ÀÕÓïÐõÍÊÇÄÑ?ÈÈ ServerPath
Ñ?ÍÓÎþÇÞ ×èÀñ×â Ì? ÐæÄé:
ÌÃÑ? ÏÉ:
NameVirtualHost 111.22.33.44
<VirtualHost 111.22.33.44>
ServerName www.domain.tld
ServerPath /domain
DocumentRoot /web/domain
</VirtualHost>
ÐÜÀä É?ÍÌ ÆöÐÞÀÅ? "/domain
"ÇÞ ÍÓÐë×ßÄÒ
URIÏÅ Äû×á ÏôÓËÐÊ ÀÅË?Ø?ÍÊÖ? www.domain.tld
ÀÅ
Ì-ÊåÍÊ×áÄé. Ñÿ, Host:
×üÄ?È? ÊÈÃËÄÒ Õ?Æ?ÐÜÎ?Ö?ÄÒ
http://www.domain.tld/
ÈÈÐÈÇÞÅÅ Ñ?Áé×â Ì? ÐæÑ?ÈÈ,
http://www.domain.tld/domain/
ÐÈÇÞÄÒ È?Å÷
Õ?Æ?ÐÜÎ?Ö?ÀÅ ÖôÐÜÑ?ÏÅ Ñ?Áé×â Ì? ÐæÄé.
ÐÜÈ? Ð?×è ÓæÓÚÐ× ÀÅË?Ø?ÍÊÖ?ÏÅ ÐæÄÒ ÖôÐÜÑ?ÏÅ
http://www.domain.tld/domain/
ÐÈÇÞ ÀÅÄÒ ÈÅÕ?È?
ÃæÄÒÄé. ÁçÈ?Àý ÀÅË?Ø?ÍÊÖ? ÖôÐÜÑ?ÏÅÌ-ÄÒ Ë?ÄûÈÅÕ? (ÏÉÈ? ÅùÎþ,
"file.html
" ÐÜÃ? "../icons/image.gif
")
Ø?ÐÊ ("http://www.domain.tld/domain/misc/file.html
"ÐÜÃ?
"/domain/misc/file.html
"À? ÀÀÐÜ) ÎåÏÅ
/domain/
ÐÜ ÊéÐÊ ÈÅÕ?ÈÈÐË Ë÷Ïû×áÄé.
ÑÆÁí ÁäÔ?ÐÜ ×ÚÏô×ßÑ?ÈÈ ÐÜ ÁäÔ?ÐË Å?È?Èù ÄûÊÞÊàÐ× ÀöÏü ÏôÑ? ÀÝÐÜÃ? ÏÐÇÅÅØ ÀÝÐÜÃ? À?ÀøÎ?ÐÜ È?Å÷ ÊúÆ?ÏüÐ?ÇÞ ÖôÐÜÑ?È? ÊÌ Ì? ÐæÄé.