apache2 + vhost trouble
Wingman 15 апреля, 2006 - 05:11
Не работают вхосты хоть убей %((
APACHE2_OPTS="-D PHP5 -D SSL -D DEFAULT_VHOST -f /etc/apache2/httpd.conf"
Есть 3 вхоста.
00_default_vhost.conf
### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
# CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
#</VirtualHost>
#
# The First Virtual Host is also your DEFAULT Virtual Host.
# This means any requests that do not match any other vhosts will
# goto this virtual host.
#
<IfDefine DEFAULT_VHOST>
<VirtualHost *:80>
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/localhost/htdocs"
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www/localhost/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
<IfModule peruser.c>
# this must match a Processor
ServerEnvironment apache apache
# these are optional - defaults to the values specified in httpd.conf
MinSpareProcessors 4
MaxProcessors 20
</IfModule>
</VirtualHost>
</IfDefine>
01_linux.dragomiroff.ru
<VirtualHost linux.dragomiroff.ru:80>
ServerAdmin
DocumentRoot /var/www/linux.d.r/htdocs
ServerName linux.dragomiroff.ru
ErrorLog @rel_logfiledir@/linux.dragomiroff.ru-error_log
CustomLog @rel_logfiledir@/linux.dragomiroff.ru-access_log common
</VirtualHost>
02_wingman.org.ru
<VirtualHost wingman.org.ru:80>
ServerAdmin
DocumentRoot /var/www/wingman.org.ru/htdocs
ServerName wingman.org.ru
ErrorLog @rel_logfiledir@/wingman.org.ru-error_log
CustomLog @rel_logfiledir@/lwingman.org.ru-access_log common
</VirtualHost>
Не пашут. Серв пишет "The requested URL / was not found on this server."
В логах только
[Sat Apr 15 05:04:12 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2) [Sat Apr 15 05:04:13 2006] [notice] Digest: generating secret for digest authentication ... [Sat Apr 15 05:04:13 2006] [notice] Digest: done [Sat Apr 15 05:04:13 2006] [notice] Apache configured -- resuming normal operations [Sat Apr 15 05:05:18 2006] [error] [client 87.245.146.2] File does not exist: /usr/htdocs [Sat Apr 15 05:05:18 2006] [error] [client 87.245.146.2] File does not exist: /usr/htdocs [Sat Apr 15 05:08:17 2006] [error] [client 87.245.146.2] File does not exist: /usr/htdocs
Причём логи вхостов даже не создаются
Насколько я понимаю, он лезет в /usr/htdocs, но НИ В ОДНОМ конфиге эта дира не указана, везде /var/www
Итак, шозанахъ? Хелп =(
»
- Для комментирования войдите или зарегистрируйтесь

# mv 01_linux.dragomiroff.ru
# mv 01_linux.dragomiroff.ru 01_linux.dragomiroff.ru.conf
# mv 02_wingman.org.ru 02_wingman.org.ru.conf
может еще и ssl отключить ( на время проверки)
да и...
ServerAdmin
DocumentRoot /var/www/linux.d.ru/htdocs
Allow from all
ServerName linux.dragomiroff.ru
ErrorLog @rel_logfiledir@/linux.dragomiroff.ru-error_log
CustomLog @rel_logfiledir@/linux.dragomiroff.ru-access_log common
_________________
Blame!
Бестолку, в
Бестолку, в точности то же самое, и с отключенным ssl. Убрал остальные вхосты, оставил только 00_default - всё равно лезет в /usr/htdocs
Потёр все конфиги, ща ре-емержну апачку...
_________________
---------------------
Gentoo 2005.1 Celeron 2.13 GHz MemTotal: 2009684 kB
HLDSx2, Bnetd, apache, mysql, pgsql, nagios, smb, named, squid
Сдвинулись с
Сдвинулись с мёртвой точки...
всё те же 3 вхоста.
С локалхоста Links'ом работает как надо.
links 192.168.0.3 открывает внутрисетевой ресурс;
links linux.dragomiroff.ru открывает цмс, висящую на linux.dragomiroff.ru
links wingman.org.ru открывает phpinfo на wingman.org.ru
C других же компов открывается следующее:
links 87.245.146.13 открывает phpinfo с wingman.org.ru (должен быть тот же ресурс, что на 192.168.0.3)
links linux.dragomiroff.ru links 87.245.146.13 открывает phpinfo с wingman.org.ru
links wingman.org.ru открывает правильно свой phpinfo
В вхостах везде стоит
Бред блин +(
_________________
---------------------
Gentoo 2005.1 Celeron 2.13 GHz MemTotal: 2009684 kB
HLDSx2, Bnetd, apache, mysql, pgsql, nagios, smb, named, squid
Re: Сдвинулись с
.
_________________
---------------------
Gentoo 2005.1 Celeron 2.13 GHz MemTotal: 2009684 kB
HLDSx2, Bnetd, apache, mysql, pgsql, nagios, smb, named, squid
Всё,
Всё, поднялось... Ларчик просто открывался, надо чаще курить маны =) нужно было писать
Проблема была в следующем:
вместо
вхосты определяются по опции ServerName, а VirtualHost - интерфейс, на корором слушает апач
_________________
---------------------
Gentoo 2005.1 Celeron 2.13 GHz MemTotal: 2009684 kB
HLDSx2, Bnetd, apache, mysql, pgsql, nagios, smb, named, squid