Несколько сайтов (VirtualHost) на Apache
-
- Сообщения: 16
- Зарегистрирован: Ср ноя 12, 2008 2:51 pm
- Контактная информация:
Несколько сайтов (VirtualHost) на Apache
Уважаемые гуру, подскажите пожалуста как можно организовать сайт + веб интерфейс биллинга. А именно интересует вход на сайт типа: stranichka.net, вход на биллинг billing.stranichka.net (или если в локалке то, к примеру, http://192.168.0.1 - сайт и http://192.168.0.1/billing/ - биллинг соответсенно.)
Re: Несколько сайтов (VirtualHost) на Apache
1 настройки аппачи
2 файл .хтдокс
2 файл .хтдокс
-
- Сообщения: 16
- Зарегистрирован: Ср ноя 12, 2008 2:51 pm
- Контактная информация:
Re: Несколько сайтов (VirtualHost) на Apache
httpd.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://www.apache.org/docs/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
#ServerAlias silver.priv stats.silver.priv
#
# 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>
#Alias /silver/ "/usr/local/www/joomla/"
DocumentRoot /usr/local/www/joomla/
# ServerAdmin silver@blabla.net
# ServerName silver.priv
# ServerAlias silver.priv
DocumentRoot /usr/local/www/joomla/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
# ErrorLog /var/logs/com-error_log
# CustomLog /var/logs/com-access_log common
<Directory /usr/local/www/joomla/>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
options +Includes
options +Indexes
</Directory>
#</VirtualHost>
#Abills version 0.4. Default ABillS port is 9443
Listen 9443
#Alias for web report
Alias /reports/ "/usr/local/abills/webreports"
<Directory "/usr/local/abills/webreports">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Main server config
<VirtualHost _default_:9443>
ServerName abills
ServerAlias /abills "/usr/local/abills/cgi-bin/"
DocumentRoot /usr/local/abills/cgi-bin/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
#ServerName http://www.example.com:9443
#ServerAdmin admin@example.com
ErrorLog /var/log/abills-error.log
#TransferLog /var/log/abills-access.log
CustomLog /var/log/abills-access_log common
<IfModule ssl_module>
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/abills/Certs/server.crt
SSLCertificateKeyFile /usr/local/abills/Certs/server.key
<FilesMatch "\.(cgi)$">
SSLOptions +StdEnvVars
</FilesMatch>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /var/log/abills-ssl_request.log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</IfModule>
# User interface
<Directory '/usr/local/abills/cgi-bin/'>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
<IfModule ssl_module>
SSLOptions +StdEnvVars
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_CGI_AUTHORIZATION:%1]
#Anti TRACE
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
Options Indexes ExecCGI SymLinksIfOwnerMatch
</IfModule>
AddHandler cgi-script .cgi
Options Indexes ExecCGI FollowSymLinks
AllowOverride none
DirectoryIndex index.cgi
Order allow,deny
Allow from all
<Files ~ "\.(db|log)$">
Order allow,deny
Deny from all
</Files>
#For hotspot solution
ErrorDocument 404 "/abills/"
directoryIndex "/abills" index.cgi
</Directory>
#Admin interface
<Directory '/usr/local/abills/cgi-bin/admin/'>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
<IfModule ssl_module>
SSLOptions +StdEnvVars
</IfModule>
AddHandler cgi-script .cgi
Options Indexes ExecCGI FollowSymLinks
AllowOverride none
DirectoryIndex index.cgi
order deny,allow
allow from all
</Directory>
</VirtualHost>
файл .хтдокс -? нету...
### 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://www.apache.org/docs/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
#ServerAlias silver.priv stats.silver.priv
#
# 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>
#Alias /silver/ "/usr/local/www/joomla/"
DocumentRoot /usr/local/www/joomla/
# ServerAdmin silver@blabla.net
# ServerName silver.priv
# ServerAlias silver.priv
DocumentRoot /usr/local/www/joomla/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
# ErrorLog /var/logs/com-error_log
# CustomLog /var/logs/com-access_log common
<Directory /usr/local/www/joomla/>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
options +Includes
options +Indexes
</Directory>
#</VirtualHost>
#Abills version 0.4. Default ABillS port is 9443
Listen 9443
#Alias for web report
Alias /reports/ "/usr/local/abills/webreports"
<Directory "/usr/local/abills/webreports">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Main server config
<VirtualHost _default_:9443>
ServerName abills
ServerAlias /abills "/usr/local/abills/cgi-bin/"
DocumentRoot /usr/local/abills/cgi-bin/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
#ServerName http://www.example.com:9443
#ServerAdmin admin@example.com
ErrorLog /var/log/abills-error.log
#TransferLog /var/log/abills-access.log
CustomLog /var/log/abills-access_log common
<IfModule ssl_module>
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/abills/Certs/server.crt
SSLCertificateKeyFile /usr/local/abills/Certs/server.key
<FilesMatch "\.(cgi)$">
SSLOptions +StdEnvVars
</FilesMatch>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /var/log/abills-ssl_request.log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</IfModule>
# User interface
<Directory '/usr/local/abills/cgi-bin/'>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
<IfModule ssl_module>
SSLOptions +StdEnvVars
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_CGI_AUTHORIZATION:%1]
#Anti TRACE
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
Options Indexes ExecCGI SymLinksIfOwnerMatch
</IfModule>
AddHandler cgi-script .cgi
Options Indexes ExecCGI FollowSymLinks
AllowOverride none
DirectoryIndex index.cgi
Order allow,deny
Allow from all
<Files ~ "\.(db|log)$">
Order allow,deny
Deny from all
</Files>
#For hotspot solution
ErrorDocument 404 "/abills/"
directoryIndex "/abills" index.cgi
</Directory>
#Admin interface
<Directory '/usr/local/abills/cgi-bin/admin/'>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
<IfModule ssl_module>
SSLOptions +StdEnvVars
</IfModule>
AddHandler cgi-script .cgi
Options Indexes ExecCGI FollowSymLinks
AllowOverride none
DirectoryIndex index.cgi
order deny,allow
allow from all
</Directory>
</VirtualHost>
файл .хтдокс -? нету...
Re: Несколько сайтов (VirtualHost) на Apache
дык через виртуал хостс и разруливается... хошь по ип, хошь - по имени...Dmitiry_Silverston писал(а):Уважаемые гуру, подскажите пожалуста как можно организовать сайт + веб интерфейс биллинга. А именно интересует вход на сайт типа: stranichka.net, вход на биллинг billing.stranichka.net (или если в локалке то, к примеру, http://192.168.0.1 - сайт и http://192.168.0.1/billing/ - биллинг соответсенно.)
Любой тупик - это тщательно замаскированный выход.
Re: Несколько сайтов (VirtualHost) на Apache
А если нехотите чтобы пароли выших юзеров потырили нужно https заюзать.
-
- Сообщения: 16
- Зарегистрирован: Ср ноя 12, 2008 2:51 pm
- Контактная информация:
Re: Несколько сайтов (VirtualHost) на Apache
Зделал так:
### 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://www.apache.org/docs/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 silver.priv
#ServerAlias silver.priv stats.silver.priv
#
# 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 silver.priv:80>
Alias /silver.priv/ "/usr/local/www/joomla/"
DocumentRoot /usr/local/www/joomla/
ServerAdmin silver@blabla.net
ServerName silver.priv
ServerAlias silver.priv
DocumentRoot /usr/local/www/joomla/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
# ErrorLog /var/logs/com-error_log
# CustomLog /var/logs/com-access_log common
<Directory /usr/local/www/joomla/>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
options +Includes
options +Indexes
</Directory>
</VirtualHost>
#Abills version 0.4. Default ABillS port is 9443
Listen 9443
#Alias for web report
Alias /reports/ "/usr/local/abills/webreports"
<Directory "/usr/local/abills/webreports">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Main server config
<VirtualHost stats.silver.priv:9443>
ServerName silver.abills.priv
ServerAlias /abills "/usr/local/abills/cgi-bin/"
DocumentRoot /usr/local/abills/cgi-bin/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
#ServerName http://www.example.com:9443
#ServerAdmin admin@example.com
ErrorLog /var/log/abills-error.log
#TransferLog /var/log/abills-access.log
CustomLog /var/log/abills-access_log common
<IfModule ssl_module>
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/abills/Certs/server.crt
SSLCertificateKeyFile /usr/local/abills/Certs/server.key
<FilesMatch "\.(cgi)$">
SSLOptions +StdEnvVars
</FilesMatch>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /var/log/abills-ssl_request.log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</IfModule>
# User interface
<Directory '/usr/local/abills/cgi-bin/'>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
<IfModule ssl_module>
SSLOptions +StdEnvVars
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_CGI_AUTHORIZATION:%1]
#Anti TRACE
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
Options Indexes ExecCGI SymLinksIfOwnerMatch
</IfModule>
AddHandler cgi-script .cgi
Options Indexes ExecCGI FollowSymLinks
AllowOverride none
DirectoryIndex index.cgi
Order allow,deny
Allow from all
<Files ~ "\.(db|log)$">
Order allow,deny
Deny from all
</Files>
#For hotspot solution
ErrorDocument 404 "/abills/"
directoryIndex "/abills" index.cgi
</Directory>
#Admin interface
<Directory '/usr/local/abills/cgi-bin/admin/'>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
<IfModule ssl_module>
SSLOptions +StdEnvVars
</IfModule>
AddHandler cgi-script .cgi
Options Indexes ExecCGI FollowSymLinks
AllowOverride none
DirectoryIndex index.cgi
order deny,allow
allow from all
</Directory>
</VirtualHost>
Потом начал получать сообщения об ошибке после перезапуска апача: Cannot resolve host name....
Прикрутил hosts:
127.0.0.1 localhost silver.priv
127.0.0.1 localhost stats.silver.priv
Теперь вроде всё резолвится, но кажется проблемы с DNS:
# nslookup
> silver.priv
Server: 127.0.0.1
Address: 127.0.0.1#53
** server can't find silver.priv: NXDOMAIN
> stats.silver.priv
Server: 127.0.0.1
Address: 127.0.0.1#53
** server can't find stats.silver.priv: NXDOMAIN
>
По ссылкам silver.priv и stats.silver.priv никуда не заходит, по айпишникам так же.
### 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://www.apache.org/docs/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 silver.priv
#ServerAlias silver.priv stats.silver.priv
#
# 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 silver.priv:80>
Alias /silver.priv/ "/usr/local/www/joomla/"
DocumentRoot /usr/local/www/joomla/
ServerAdmin silver@blabla.net
ServerName silver.priv
ServerAlias silver.priv
DocumentRoot /usr/local/www/joomla/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
# ErrorLog /var/logs/com-error_log
# CustomLog /var/logs/com-access_log common
<Directory /usr/local/www/joomla/>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
options +Includes
options +Indexes
</Directory>
</VirtualHost>
#Abills version 0.4. Default ABillS port is 9443
Listen 9443
#Alias for web report
Alias /reports/ "/usr/local/abills/webreports"
<Directory "/usr/local/abills/webreports">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Main server config
<VirtualHost stats.silver.priv:9443>
ServerName silver.abills.priv
ServerAlias /abills "/usr/local/abills/cgi-bin/"
DocumentRoot /usr/local/abills/cgi-bin/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
#ServerName http://www.example.com:9443
#ServerAdmin admin@example.com
ErrorLog /var/log/abills-error.log
#TransferLog /var/log/abills-access.log
CustomLog /var/log/abills-access_log common
<IfModule ssl_module>
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/abills/Certs/server.crt
SSLCertificateKeyFile /usr/local/abills/Certs/server.key
<FilesMatch "\.(cgi)$">
SSLOptions +StdEnvVars
</FilesMatch>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /var/log/abills-ssl_request.log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</IfModule>
# User interface
<Directory '/usr/local/abills/cgi-bin/'>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
<IfModule ssl_module>
SSLOptions +StdEnvVars
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_CGI_AUTHORIZATION:%1]
#Anti TRACE
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
Options Indexes ExecCGI SymLinksIfOwnerMatch
</IfModule>
AddHandler cgi-script .cgi
Options Indexes ExecCGI FollowSymLinks
AllowOverride none
DirectoryIndex index.cgi
Order allow,deny
Allow from all
<Files ~ "\.(db|log)$">
Order allow,deny
Deny from all
</Files>
#For hotspot solution
ErrorDocument 404 "/abills/"
directoryIndex "/abills" index.cgi
</Directory>
#Admin interface
<Directory '/usr/local/abills/cgi-bin/admin/'>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
<IfModule ssl_module>
SSLOptions +StdEnvVars
</IfModule>
AddHandler cgi-script .cgi
Options Indexes ExecCGI FollowSymLinks
AllowOverride none
DirectoryIndex index.cgi
order deny,allow
allow from all
</Directory>
</VirtualHost>
Потом начал получать сообщения об ошибке после перезапуска апача: Cannot resolve host name....
Прикрутил hosts:
127.0.0.1 localhost silver.priv
127.0.0.1 localhost stats.silver.priv
Теперь вроде всё резолвится, но кажется проблемы с DNS:
# nslookup
> silver.priv
Server: 127.0.0.1
Address: 127.0.0.1#53
** server can't find silver.priv: NXDOMAIN
> stats.silver.priv
Server: 127.0.0.1
Address: 127.0.0.1#53
** server can't find stats.silver.priv: NXDOMAIN
>
По ссылкам silver.priv и stats.silver.priv никуда не заходит, по айпишникам так же.
Re: Несколько сайтов (VirtualHost) на Apache
в httpd.conf добавте следующее:
Далее в /usr/local/apache2/htdocs/stat положите index.html следующего содержания:
Это нужно для того, чтобы если юзер зайдет на stat.local.lan по http, то его переадресует на https. Это можно сделать и с помощью модуля rewrite, но я сделал так.
Далее создаем или правим файл ssl.conf
Вот собственно и все. При условии, что установлен openssl. Ну и естественно stat.local.lan.ua должно резольвится на ip вашего сервера биллинга.
Код: Выделить всё
Listen *:80
<IfModule mod_ssl.c>
Include conf/ssl.conf
</IfModule>
ServerName local.lan.ua
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
# Virtual hosts
NameVirtualHost *
<VirtualHost *>
ServerName local.lan.ua
</VirtualHost>
<VirtualHost *>
ServerName stat.local.lan.ua
ServerAlias www.stat.local.lan.ua
DocumentRoot /usr/local/apache2/htdocs/stat
ServerAdmin admin@local.lan.ua
ErrorLog /usr/local/apache2/logs/error_log
CustomLog /usr/local/apache2/logs/access_log common
</VirtualHost>
Код: Выделить всё
<html>
<head><meta http-equiv="Refresh" content="0;URL=https://stat.local.lan.ua/">
</head>
<body onload="window.open('https://stat.local.lan.ua/','_top')">
</body>
</html>
Далее создаем или правим файл ssl.conf
Код: Выделить всё
Listen *:443
<VirtualHost stat.local.lan.ua:443>
DocumentRoot "/usr/abills/cgi-bin"
ServerName stat.local.lan.ua
ServerAdmin admin@local.lan.ua
ErrorLog /usr/local/apache2/logs/secure_ssl_error_log
TransferLog /usr/local/apache2/logs/secure_ssl_access_log
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/apache2/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/apache2/ssl.key/server.key
<Directory "/usr/abills/cgi-bin/">
SSLOptions +StdEnvVars
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_CGI_AUTHORIZATION:%1]
Options Indexes ExecCGI SymLinksIfOwnerMatch
</IfModule>
AddHandler cgi-script .cgi
Options Indexes ExecCGI FollowSymLinks
AllowOverride none
DirectoryIndex index.cgi
Order allow,deny
Allow from all
</Directory>
#Admin interface
<Directory "/usr/abills/cgi-bin/admin">
AddHandler cgi-script .cgi
Options Indexes ExecCGI FollowSymLinks
AllowOverride none
DirectoryIndex index.cgi
order deny,allow
allow from all
</Directory>
</VirtualHost>
-
- Сообщения: 16
- Зарегистрирован: Ср ноя 12, 2008 2:51 pm
- Контактная информация:
Re: Несколько сайтов (VirtualHost) на Apache
Ну например htdocs/stat нету, вместо него стандартно: DocumentRoot "/usr/local/www/apache22/data"sopov писал(а):в /usr/local/apache2/htdocs/stat положите index.html
А сам сайт куда ложить?
Re: Несколько сайтов (VirtualHost) на Apache
Ничего страшного что нету, просто исправте пути под себя. У вас сайт будет крутится на одной машине с биллингом? Если да, то не очень хорошая затея, но всеже примерно вот так должны выглядеть виртуальные хосты:
Но еще раз обращу ваше внимание на то, что эти имена должны резольвиться вашим dns.
Собственно здесь виртуальный хост stat.local.lan.ua только для редиректа на https. А вот за непосредственно вход в биллинг отвечает конфиг ssl.conf листинг которого приведен мною выше. Внем собственно и описывается виртуальный хост для абиллс. Также у вас должны быть созданы сертификаты. Вобщем как запустить эту связку смотрите тут http://abills.net.ua/wiki/doku.php/abil ... che_ssl:ru
Код: Выделить всё
# Virtual hosts
NameVirtualHost *
<VirtualHost *>
ServerName localhost.lan.ua
</VirtualHost>
<VirtualHost *>
ServerName local.lan.ua
ServerAlias www.local.lan.ua
DocumentRoot /usr/local/www ###Сюда кладете сайт или исправте путь под себя
ServerAdmin admin@local.lan.ua
ErrorLog /var/log/www/error.log
CustomLog /var/log/www/access.log common
</VirtualHost>
####Дальше идут примеры как создать еще имена
<VirtualHost *>
ServerName ftp.local.lan.ua
ServerAlias www.ftp.local.lan.ua
DocumentRoot /usr/local/www/deny
ServerAdmin admin@local.lan.ua
ErrorLog /var/log/www/other/error.log
CustomLog /var/log/www/other/access.log common
</VirtualHost>
<VirtualHost *>
ServerName stat.local.lan.ua
ServerAlias www.stat.local.lan.ua
DocumentRoot /usr/local/apache2/htdocs/stat
ServerAdmin admin@local.lan.ua
ErrorLog /usr/local/apache2/logs/error_log
CustomLog /usr/local/apache2/logs/access_log common
</VirtualHost>
Собственно здесь виртуальный хост stat.local.lan.ua только для редиректа на https. А вот за непосредственно вход в биллинг отвечает конфиг ssl.conf листинг которого приведен мною выше. Внем собственно и описывается виртуальный хост для абиллс. Также у вас должны быть созданы сертификаты. Вобщем как запустить эту связку смотрите тут http://abills.net.ua/wiki/doku.php/abil ... che_ssl:ru
-
- Сообщения: 16
- Зарегистрирован: Ср ноя 12, 2008 2:51 pm
- Контактная информация:
Re: Несколько сайтов (VirtualHost) на Apache
Да, именно сервер один. На нём хотелось бы совместить биллнг и небольшой сайтик (порталку), т.к. сеть небольшая и кол-во пользователей интернета не будет больше 100. С SSL пока не разобрался, да и apach22 стал выделыватся, откатил до версии 1.3.
Делая по принципу:
Получал Cannot resolve host name....
Пришлось приручать DNS, с которым до сих пор борюсь... Но не в этом дело, вполне бы устроило заходить к примеру так:
http://192.168.0.1 - сайт и http://192.168.0.1/abills/ - биллинг (Что б не мучатся подымать днс, тем более что шлюз в сети не мой сервер)...
Думал зделать таким образом: путь к сайту описанный в апаче /usr/local/www/, в этом каталоге сам сайт и каталог abills (/usr/local/www/abills/) сам биллинг.
Набираем http://192.168.0.1 - попадаем на сайт, добавляем /abills/ - попадаем в биллинг.
Только вот как это скрутить всё в httpd.conf?
(Если учесть что у меня щас сайт лежит DocumentRoot /usr/local/www/joomla/, а биллинг DocumentRoot /usr/local/abills/cgi-bin/)
А за идею с SSL и настроенным DNS большое спасибо! Это будет следующими шагами для занятия в свободное время.
Делая по принципу:
Код: Выделить всё
# Virtual hosts
NameVirtualHost *
<VirtualHost *>
ServerName localhost.lan.ua
</VirtualHost>
<VirtualHost *>
ServerName local.lan.ua
ServerAlias www.local.lan.ua
DocumentRoot /usr/local/www ###Сюда кладете сайт или исправте путь под себя
ServerAdmin admin@local.lan.ua
ErrorLog /var/log/www/error.log
CustomLog /var/log/www/access.log common
</VirtualHost> и т.д.
Пришлось приручать DNS, с которым до сих пор борюсь... Но не в этом дело, вполне бы устроило заходить к примеру так:
http://192.168.0.1 - сайт и http://192.168.0.1/abills/ - биллинг (Что б не мучатся подымать днс, тем более что шлюз в сети не мой сервер)...
Думал зделать таким образом: путь к сайту описанный в апаче /usr/local/www/, в этом каталоге сам сайт и каталог abills (/usr/local/www/abills/) сам биллинг.
Набираем http://192.168.0.1 - попадаем на сайт, добавляем /abills/ - попадаем в биллинг.
Только вот как это скрутить всё в httpd.conf?
(Если учесть что у меня щас сайт лежит DocumentRoot /usr/local/www/joomla/, а биллинг DocumentRoot /usr/local/abills/cgi-bin/)
А за идею с SSL и настроенным DNS большое спасибо! Это будет следующими шагами для занятия в свободное время.
Re: Несколько сайтов (VirtualHost) на Apache
Ну тогда настройте по инструкции, там как раз ваш вариант.