 |
Виртуальные хосты в Apache ??????????? ?????
???? ?????? Apache ????? ??????????? ??????? ? ?????????? ?????? (?? ????? ?????????? ????? ????????? ????????? ???????? Apache, ???? ??? ?????????? ?? ??????????? ???????????? - ? ???? ?????? ????? ?????? ????????? User/Group). ???????? ??????? ????? ??????????? ? ?????? VirtualHost. ???????, ??????? ?????? ?? ????? ????????? ?? ? ????? ??????? VirtualHost, ????????????? ?????? ?? ???????? ???????? ?????. ???????? ????? ? ???????????? ????? ????? ???? ?? ?????? IP ?????? (???????? ??????????? ???????????? ????? ?? ??????????? ?????? "_default_", ??????? ????? "?????????????" ?? ???? ??? ???????????? ???????) ??? ????? (???????? ?????? ??? ????????, ??????? ???????? ????????? "Host:" ? ???????; ???????, ??? ?????? ?????? ?? ????????; ??. ????? ????????? ServerPath). ??? ????????????? TLS/SSL ?????? ???????????? ???????? ?? ?????. ?????? ?????? ????? ???? ???????????? ????? ????? ????????? (????? V ? ????????) ??? ?????? DFL. ????? ??????????? ????????? - DocumentRoot, ??????? ?????? ???????? ????????? ?????????? URI ? ???????? ???????? ???????. ?????? ????? ???????????? ????????? ServerAdmin, ServerName ? ??????? ????????? ????????.
??? ??????????? ???????? ?? ?????? IP ?????? ??? ??????????? ??????? ????? (?????? VirtualHost) ???????????? IP ????? ??????? (??? ????), ??????????????, ?????? ???? ?????? ????? ????????? IP ?????. ? ????????? ?????? ????????????? ????????? IP ????? (? ????? ??????, ??? ??????? ???????????? ???????? ??? ????????????? ? IP ?????).
??? ??????????? ???????? ?? ?????? ????? ????????? NameVirtualHost (? ???????? ??????) ??????????? ??????????? ???? ? ?????????? ??????/?????: ??????? ?? ???? ????? ????? ?????????????? ?????? ????? ???????????????? ???????????? ???????; ???? NAT ??? ?????? ????????????? ??????? ??????? ?? ?????? IP ?????, ?? ? ????????? ?????????? ??????? ????? ?????. ? ???????? ?????? ????? ???????????? ?????? ("*" ??? "*:80"). ??? ?????? ???????? ?????????? ????????????? ???????????? ????????? Listen. ???????? ?????? VirtualHost ?????? ??????????????? ????????? NameVirtualHost. ? ?????? VirtualHost ?????????? ??????????? ??????? ServerName ? DocumentRoot. ????????? ServerAlias ????????? ?????? ?????????????? ????? ????? ??? ???????????? ?????.
??? ????????? ??????? ?????? ????????? ????????????? ?? ???????? ????? ? ???? ?????????? ? ????????? NameVirtualHost. ???? ?????????????, ?? ?? ?????????? ?????? VirtualHost, ? ?????????? ??????? ?????? ???????? ?????. ? ??? ?? ???? ?? ??????, ? ??????? ??????? ????????? ServerName (??? ServerAlias), ??????????????? ????????? ??????? "Host:". ???? ???????????? ?? ??????? ("_default_" ????????????? ??????), ?? ???????????? ?????? ?????????? ??????.
?????? vhost_alias ???????????? ??? ??????????? ????????? ??????????? ????????.
??????????? URI ? ????? ??????
??? ????????? ??????? ?????? ?????? ????? ?????????? ??????????? ????, ? ???????? ?? ?????????. ??????????????? ?????? VirtualHost ?????????? ?????????????? ?????????. ? ?????????? ?????? ????????? ????? URI ???????????? ? ???????? DocumentRoot ???????????? ?????, ???? ? ???????????? ?????? ??????????? ? ?????????? ???????. ?????????? ?????? ? ???????? DocumentRoot ?????????????? ??????, ???? ????????? ????? (????????? Options) FollowSymLinks ??? SymLinksIfOwnerMatch.
????????? AcceptPathInfo ????????? ???????? ????, ??? ???????? ????????? ? ??????? ???? ? URI. ????????? ErrorDocument ????????? ?????????? ??????? ?? ?????????????? ????.
?????? userdir ????????? ?????????? ??????? ? ???????? ???????? ????????????, ??????? ???? ???????????? ??? ????????? URL ???? http://www.company.ru/~username/ (?? ????????? - public_html). ????????????? ??????? "UserDir disabled", ? ????? "UserDir enabled ???-????????????", ????? ????????? ???? ?????? ?????? ????????????, ? ?? ???? ??????, ??????? root (? ????? ?? ???????? ???? ?????? ? ??????).
?????? alias ????????? ?????????? URL ? ????????? ????? ???????? ??????? ? ?????????????? ??????? (????????? ?????? alias ?????????????? ????? Location, ?? ?? Directory; ????????? Redirect ?????????????? ?? ??????? ?????? ???????? Alias, ??????? ????? ?????????????? ??????????????? ?? ??????? ??????????):
• SV Alias ?????? ???-????????-???-????? (?????? ? URL (% ????????????), ????????????? ?? ??????, ????? ????????? ?? ????, ???????????? ? ???-????????-???-????? (?.?. ??? DocumentRoot); ?????? ? ???-????????-???-????? ?????? ???? ???????? ????????)
• SV AliasMatch ??????????-????????? ???-????????-???-????? (?????????? Alias, ?? ????????? ???????????? ? ???????????? ? ?????????? ??????????; ????? ??????????? ?????????, ??????????? ? ??????, ???????????? ??? ??????????? ???????? ? ?.?. ????????? ? ?????? ????? ($1 ? ?.?.))
• SVDFLA Redirect [?????? ] ?????? ?????-URL (?????????????? %-??????????????? ????????? URL (??????) ? ???????????????? (?????-URL); ??????? ???????????? ????????? ?? ?????? ? ????? URL, ??????? ?? ?????? ?????????; ?????? ?.?. ?????????? ???????; ?????? (?? ????????? temporary - ??? 302) ?????????? ??? ????????:
o permanent - ?????? ????????? ???????? (301)
o temp - ?????? ????????? ???????? (302)
o seeother - ?????? ??????? (303)
o gone - ?????? ?????? (410) (? ???? ?????? ????? URL ?.?. ??????)
o ????? ???????? ????
• SV RedirectMatch [?????? ] regex url (?????????? Redirect, ?? ????????? ???????????? ?? ?? ?????????? ?????, ? ?? ???????????? URL ?? ??????? ??????????? ?????????; ??????, ??????????????? ????????????? ? ???????, ?????????? ? ??????????? ?????????? ? ?.?. ????????????)
• RedirectPermanent - ?????????? Redirect permanent
• RedirectTemp - ?????????? Redirect temp
• SV ScriptAlias ?????? ???-????????-???-????? (?????????? ????????? Alias, ?? ????????????? ???????? ?????????? ??? ?????????? CGI)
• SV ScriptAliasMatch regex ???-????????-???-????? (?????????? ????????? AliasMatch, ?? ????????????? ???????? ?????????? ??? ?????????? CGI)
?????? dir ???????????? ??????????? ????? ????????, ?????????? ? URL, ? ?????? ?????????? ?????:
• SVDA DirectorySlash On|Off (?? ????????? - On; ????????? ????????????? ??????????? ??????????? ??????? ? ???????? (??? ???????????? '/') ? ??????????)
• SVDA DirectoryIndex local-url ... (?????? ??? ????? (?????? ???????????? ?????????????? ????????), ? ??????? ????? ??????? ????????? ?????? ???????? (?? ????????? - index.html); ?????? ?????????? ?????? ????????? ?????? ? ????? ?? ?????? ? ????????)
?????? speling ???????? ??????????????? ???????? ? URL (????????? SVDFLA CheckSpelling Off|On): ?????? ? ??????????/????????? ???????, ??????? ?????? ???????, ??????? ?????? ???????, ???????????? 2 ????????, ?????? ?????? ???????). ?????????????? ?????????? ??? (?????? ????) ???????????? ? ???? ????????? ???????????????.
?????? rewrite.
|
|