From: SKeeper <alt-skeeper@yandex.ru>
To: ALT Linux sysadmin discuss <sysadmins@lists.altlinux.org>
Subject: Re: [Sysadmins] Настройка vhosts на apache2 (branch 4.1)
Date: Fri, 26 Sep 2008 15:36:26 +0400
Message-ID: <48DCC93A.4040002@yandex.ru> (raw)
In-Reply-To: <48DCA31D.8040700@solin.spb.ru>
[-- Attachment #1: Type: text/plain, Size: 1358 bytes --]
Aleksey Avdeev пишет:
> SKeeper пишет:
>> Желудков Д.В. пишет:
>>> Есть ли внятный талмуд или инструкция по настройке хотя бы одного
>>> name based виртуального хоста на локалхост? Имеющийся опыт настройки
>>> в bsd системах и ArchLinux не могу использовать, так как структура
>>> конфигов довольно сильно изменена, а настроить надо в сжатые сроки.
>>> Подойдет даже очень сжатая инструкция :)
>> В /etc/httpd2/conf/sites-avialable/vhosts.conf вставляете кусок вида:
>>
>> <VirtualHost virt-host-name:80>
> ^^^^^^^^^^^^^^^^^
>> ServerAdmin your@mail
>> DocumentRoot "/var/www/vhosts/virt-host-directory"
>> ServerName 127.0.0.1
>> ServerAlias www.virt-host-name
>> ErrorLog "/var/log/httpd2/virt-host-name-error_log"
>> CustomLog /var/log/httpd2/virt-host-name-access_log common
>> </VirtualHost>
>
> В данном случаи получился vhost использующий оба механизма (по имени
> и ip).
>
> Чтобы vhost был доступен по данному имени с любых ip (и открытых
> портов):
>
> <VirtualHost *>
> ServerName <имя vhost>
> ServerAlias <альтернативное имя vhost>
> ...
> </VirtualHost>
Просто если вставляю такой кусок, то по запросу на <имя vhost>
открывается не то, что лежит в /var/www/vhosts/virt-host-directory, а то
что лежит в /var/www/apache2/html/. В чем может быть проблема? В аттаче
то как пробовал писать
[-- Attachment #2: vhosts.conf.mini --]
[-- Type: text/plain, Size: 1840 bytes --]
#
# Summary: Use name-based virtual hosting for *:80
# Provides: NameVirtualHost
#
#
# 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.
#
# 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 all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot "/www/docs/dummy-host.example.com"
# ServerName dummy-host.example.com
# ServerAlias www.dummy-host.example.com
# ErrorLog "/var/log/httpd2/dummy-host.example.com-error_log"
# CustomLog "/var/log/httpd2/dummy-host.example.com-access_log common"
#</VirtualHost>
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host2.example.com
# DocumentRoot "/www/docs/dummy-host2.example.com"
# ServerName dummy-host2.example.com
# ErrorLog "/var/log/httpd2/dummy-host2.example.com-error_log"
# CustomLog "/var/log/httpd2/dummy-host2.example.com-access_log common"
#</VirtualHost>
<VirtualHost *>
ServerName moodle.local
ServerAdmin skeeper86@mail.ru
DocumentRoot "/var/www/vhosts/moodle"
ServerAlias www.moodle.local
ErrorLog "/var/log/httpd2/moodle.local-error_log"
CustomLog /var/log/httpd2/moodle.local-access_log common
</VirtualHost>
next prev parent reply other threads:[~2008-09-26 11:36 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-26 6:31 "Желудков Д.В."
2008-09-26 7:30 ` SKeeper
2008-09-26 7:41 ` Dmitriy Kruglikov
2008-09-26 7:48 ` Denis Klimov
2008-09-26 8:50 ` "Желудков Д.В."
2008-09-26 9:45 ` SKeeper
2008-09-26 9:49 ` "Желудков Д.В."
2008-09-26 10:19 ` Aleksey Avdeev
2008-09-26 11:32 ` SKeeper
2008-09-26 8:53 ` Aleksey Avdeev
2008-09-26 9:55 ` Timur Batyrshin
2008-09-26 10:23 ` Aleksey Avdeev
2008-09-26 10:51 ` "Желудков Д.В."
2008-09-26 11:12 ` Aleksey Avdeev
2008-09-26 11:36 ` SKeeper [this message]
2008-09-26 11:44 ` Boris Savelev
2008-09-26 11:54 ` Aleksey Avdeev
2008-09-26 13:31 ` "Желудков Д.В."
2008-09-26 14:08 ` Aleksey Avdeev
2008-09-26 14:38 ` "Желудков Д.В."
2008-09-26 14:50 ` Aleksey Avdeev
2008-09-26 16:35 ` Aleksey Avdeev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48DCC93A.4040002@yandex.ru \
--to=alt-skeeper@yandex.ru \
--cc=sysadmins@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux sysadmins discussion
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
public-inbox-index sysadmins
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sysadmins
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git