URL: https://ssl.opennet.ru/cgi-bin/openforum/vsluhboard.cgi
Форум: vsluhforumID8
Нить номер: 5248
[ Назад ]

Исходное сообщение
"Виртуальные хосты в папках пользователей"

Отправлено maz , 19-Сен-07 19:22 
Имеется локальная сеть с сервером на Linux и клиентами WinXP (сервер не видит интернета)
Есть Apache 2.2.4. Есть куча пользователей.
Хотелось бы настроить Apache таким образом чтобы набирая в браузере клиента
"http://mysite.net/~имя_пользователя" открывался сайт который находится в папке пользователя.(т.е. чтобы каждый пользователь мог писать свой свой сайт).

Я так понимаю что нужно настроить виртуальный хост в файле httpd-vhosts.conf
примерно таким образом

NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot /home/ИМЯ_ПОЛЬЗОВАТЕЛЯ/www/
    ServerName mysite.net
    ErrorLog /home/ИМЯ_ПОЛЬЗОВАТЕЛЯ/log/error_log
</VirtualHost>
Есть ли какой-то макрос, который брыл бы с URL имя пользователя и подставлял бы вместо ИМЯ_ПОЛЬЗОВАТЕЛЯ в виртуальном хосте?

И нужно ли что-то править в httpd-userdir.conf?


Содержание

Сообщения в этом обсуждении
"Виртуальные хосты в папках пользователей"
Отправлено b26_1999 , 19-Сен-07 19:38 
Работаем с Customer ID не именами пользователей. Попробуй по аналогии.

RewriteEngine On

  RewriteCond ${lowercase:%{REQUEST_FILENAME}} ^/(m)-([0-9]+)/$
  RewriteRule ^/(.*)-(.*)/$  /?custId=$2&page=Business-Features-Map [P,L]

  RewriteCond %{REQUEST_FILENAME} ^/([0-9]+)\/([0-9]+)/$
  RewriteRule ^/(.*)/(.*)/$ http://url.com/?page=Business-Customer&custId=$1&headingCode=$2 [P,L]


"Виртуальные хосты в папках пользователей"
Отправлено anonymous , 20-Сен-07 11:22 
mod_userdir

# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.  Be especially careful to use
# proper, forward slashes here.  On Windows NT, "Personal/My Website"
# is a more appropriate choice.
#
UserDir "My Documents/My Website"

#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
# You must correct the path for the root to match your system's configured
# user directory location, e.g. "C:/WinNT/profiles/*/My Documents/My Website"
# or whichever, as appropriate.
#
#<Directory "C:/Documents and Settings/*/My Documents/My Website">
#    AllowOverride FileInfo AuthConfig Limit
#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#    <Limit GET POST OPTIONS PROPFIND>
#        Order allow,deny
#        Allow from all
#    </Limit>
#    <LimitExcept GET POST OPTIONS PROPFIND>
#        Order deny,allow
#        Deny from all
#    </LimitExcept>
#</Directory>