LINUX.ORG.RU
решено ФорумAdmin

[gentoo] apache

 


0

0

Всех приветствую. Стоит задача настроить apache на gentoo. Имеются конфиг, которые не как немогу настроить для работы с парой доменов.

00_default_vhost.conf

# Virtual Hosts
#
# 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.2/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.

<IfDefine DEFAULT_VHOST>
# see bug #178966 why this is in here

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80

# Use name-based virtual hosting.
NameVirtualHost *:80

# When virtual hosts are enabled, the main host defined in the default
# httpd.conf configuration will go away. We redefine it here so that it is
# still available.
#
# If you disable this vhost by removing -D DEFAULT_VHOST from
# /etc/conf.d/apache2, the first defined virtual host elsewhere will be
# the default.
<VirtualHost *:80>
	ServerName localhost
	Include /etc/apache2/vhosts.d/default_vhost.include

	<IfModule mpm_peruser_module>
		ServerEnvironment apache apache
	</IfModule>
</VirtualHost>
</IfDefine>

# vim: ts=4 filetype=apache

Нужно настроить для работы с доменами domen1.ru domen2.ru domen3.ru у каждого своя директория. Буду очень благодарен за помощь.


# cat 01_host1_vhost.conf
<VirtualHost *:80>
        ServerName host1.localhosting
        ServerAdmin root@localhost

        DocumentRoot "/var/www/host1.localhosting/htdocs"
        <Directory "/var/www/host1.localhosting/htdocs">
                Options Indexes FollowSymLinks
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>

        <IfModule alias_module>
                ScriptAlias /cgi-bin/ "/var/www/host1.localhosting/cgi-bin"
        </IfModule>

        <Directory "/var/www/host1.localhosting/cgi-bin">
                Options none
                AllowOverride None
                Order allow,deny
                Allow from all
        </Directory>


        <IfModule mpm_peruser_module>
                ServerEnvironment apache apache
        </IfModule>
</VirtualHost>
Deleted
()

>не как немогу

не как немогу

не как немогу


не как немогу



....

Deleted
()

Создаёшь конфиги примерно такого содержания: 01_domen1.ru.conf:

<VirtualHost *:80>
        ServerName domen1.ru
        # Опционально, можно в этот файл добавить общие опции:
        Include /etc/apache2/vhosts.d/default_vhost.include
        DocumentRoot "/var/www/domen1.ru/htdocs/"
        <Directory "/var/www/domen1.ru/htdocs/">
                AllowOverride all
                Order Allow,Deny
                Allow from all
        </Directory>
</VirtualHost>

Первый .conf файл по алфавиту в /etc/apache2/vhosts.d будет виртульным хостом по-умолчанию.

Nao ★★★★★
()
Ответ на: комментарий от Nao

Создал три конфига 01_****.ru.conf 02_****.ru.conf 03_****.ru.conf. Все с содержанием как у тебя только еще в начало добавил Listen 80. Что с этой записью что без нее:

* Stopping apache2...
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Thu Dec 24 17:17:03 2009] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu Dec 24 17:17:03 2009] [warn] _default_ VirtualHost overlap on port 80, the first has precedence                                                   [ ok ]
* Starting apache2...
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Thu Dec 24 17:17:04 2009] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu Dec 24 17:17:04 2009] [warn] _default_ VirtualHost overlap on port 80, the first has precedence                                                   [ ok ]

И еще как поставить UTF8 кодировку?

ClanMax
() автор топика
Ответ на: комментарий от ClanMax

[code]
NameVirtualHost 192.168.0.1:80

<VirtualHost 192.168.0.1:80>
ServerName zadro4ka1.com
......
</VirtualHost>

<VirtualHost 192.168.0.1:80>
ServerName zadro4ka2.net
......
</VirtualHost>
[/code]

так ругаться не будет
то есть оно то и так работает, просто ругается
что за utf-8?

anonymous
()
Ответ на: комментарий от anonymous

<VirtualHost 192.168.0.1:80>

Это не помогает, пробовал

ClanMax
() автор топика
Ответ на: комментарий от ClanMax

>apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Доменное имя на машине настроено? Если нет, то добавь/исправь строчку в /etc/hosts вида
айпи-этой-машины хостнейм
и в /etc/conf.d/hostname:
HOSTNAME=«хостнейм»
затем
sudo /etc/init.d/hostname restart


[warn] _default_ VirtualHost overlap on port 80, the first has precedence

Похоже что нигде не указано NameVirtualHost *:80
Добавь её в /etc/apache2/httpd.conf перед Include /etc/apache2/modules.d/*.conf

Nao ★★★★★
()
Ответ на: комментарий от Nao

Все работает, но победить

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

так и не получилось

ClanMax
() автор топика
Ответ на: комментарий от Nao

Так и делал. Вообщем это не важно, огромное спасибо за помощь

ClanMax
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.