|
|
|
| не могу понять... пытался разместить 2 сайта у себя дома на одном IP (127.0.0.1) и все время не получалось - по запросу 127.0.0.1 показывался только первый. В чем дело, объясните плиз! Что прописать в httpd.conf, чтобы сайт вызывался по одному IP-адресу?
Сечас настройки такие (для доп. хостов):
# Виртуальный контейнер для dc-news
<VirtualHost 127.0.0.2>
ServerName dc-news
ServerAdmin admin@localhost
DocumentRoot "D:/PHP-scripting/dc-news"
<Directory "D:/PHP-scripting/dc-news">
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog logs/dc-news.error.log
CustomLog logs/dc-news.log common
#RewriteLogLevel 3
#RewriteLog logs/dc-news.mod_rewrite.log
ScriptAlias /cgi-bin/ "D:/PHP-scripting/dc-news/cgi-bin/"
<Directory "D:/PHP-scripting/dc-news/cgi-bin">
Options ExecCGI
Order allow,deny
Allow from All
</Directory>
</VirtualHost>
# Виртуальный контейнер для lb-ru
<VirtualHost 127.0.0.3>
ServerName lb-ru
ServerAdmin admin@localhost
DocumentRoot "D:/PHP-scripting/LB-RU"
<Directory "D:/PHP-scripting/LB-RU">
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog logs/lb-ru.error.log
CustomLog logs/lb-ru.log common
#RewriteLogLevel 3
#RewriteLog logs/lb-ru.mod_rewrite.log
ScriptAlias /cgi-bin/ "D:/PHP-scripting/lb-ru/cgi-bin/"
<Directory "D:/PHP-scripting/dc-news/lb-ru">
Options ExecCGI
Order allow,deny
Allow from All
</Directory>
</VirtualHost>
|
| |
|
|
|
|
|
|
|
для: 1999
(15.10.2006 в 21:53)
| | >и все время не получалось - по запросу 127.0.0.1 показывался только первый.
Нужно не по IP к ним обращаться, а по именам. Ведь как Apache может понять: какой именно сайт Вы хотите увидеть, если обращаться по IP-адресу?
http://127.0.0.1
Нужно обращаться:
http://lb-ru
и
http://dc-news
|
И перед контейнерами виртуальных хостов добавить директиву:
NameVirtualHost 127.0.0.1
|
| |
|
|
|