Редирект портов 80, 443 -> 9443 и http/https
Редирект портов 80, 443 -> 9443 и http/https
Когда делаю сабж, усеру всё равно приходится явно указывать протокол https, иначе (http по дефолту) апач ругается типа протокол не поддерживается. Подозреваю, что настройками апача можно утрясти, а вот как не въеду
Re: Редирект портов 80, 443 -> 9443 и http/https
У меня редирект на 443 и все ок.ran писал(а):Когда делаю сабж, усеру всё равно приходится явно указывать протокол https, иначе (http по дефолту) апач ругается типа протокол не поддерживается. Подозреваю, что настройками апача можно утрясти, а вот как не въеду
Все по мануалу.ran писал(а):Ну видимо ещё и от настроек брузера зависит... Когда мозиллой из под линуха тоже всё ок, а когда эксплюрером из под выни нет.
А можешь часть конфига апача, касающуюся абиллся выложить?
Изменил на:
<IfModule dir_module>
DirectoryIndex "/abills" index.cgi
</IfModule>
и тут:
ErrorDocument 404 "/abills/"
Раскоментировал:
Include etc/apache22/extra/httpd-ssl.conf
и добавил:
#Abills version 0.3
# User interface
Alias /abills "/usr/abills/cgi-bin/"
<Directory "/usr/abills/cgi-bin">
<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
<Files ~ "\.(db|log)$">
Order allow,deny
Deny from all
</Files>
</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>
создал сертификат.
Все работает с эксплорера, мозиллы и оперы.
В апаче:
...
Listen 9443
...
#Abills version 0.3
<VirtualHost *:9443>
DocumentRoot "/usr/abills/cgi-bin"
ServerName stat.gala-net.pl.ua:9443
#ServerAdmin admin@example.com
ErrorLog /var/log/httpd/abills-error.log
#TransferLog /var/log/abills-access.log
CustomLog /var/log/httpd/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/etc/apache22/server.crt
SSLCertificateKeyFile /usr/local/etc/apache22/server.key
<FilesMatch "\.(cgi)$">
SSLOptions +StdEnvVars
</FilesMatch>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /var/log/httpd/abills-ssl_request.log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</IfModule>
# User interface
<Directory "/usr/abills/cgi-bin">
<IfModule ssl_module>
SSLOptions +StdEnvVars
</IfModule>
<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
<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/abills/cgi-bin/admin">
<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>
.....
На главной страничке http://gala-net.pl.ua/ есть ссылочка http://gala-net.pl.ua/main.php?page_nic=stat , она открывает страницу на которой:
<h1>Статистика</h1>
<p>В связи с тем, что страничка статистики находится на другом сервере, вы автоматически будете переадресованы по следующему адресу:</p>
<p style="text-align: center; font-weight: bold;"><a href="https://stat.gala-net.pl.ua:9443/">http ... 43/</a></p>
<p>Если ваш браузер не поддерживает автоматическую переадресацию, то нажмите на ссылку выше.</p>
<?
$JScript = "
<script language='JavaScript'>
setTimeout(document.location = 'https://stat.gala-net.pl.ua:9443/', 100000);
</script>
";
?>
у меня всё работает... только у некоторых клиентов и только в ИЕ открываеться 2-3 минуты
...
Listen 9443
...
#Abills version 0.3
<VirtualHost *:9443>
DocumentRoot "/usr/abills/cgi-bin"
ServerName stat.gala-net.pl.ua:9443
#ServerAdmin admin@example.com
ErrorLog /var/log/httpd/abills-error.log
#TransferLog /var/log/abills-access.log
CustomLog /var/log/httpd/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/etc/apache22/server.crt
SSLCertificateKeyFile /usr/local/etc/apache22/server.key
<FilesMatch "\.(cgi)$">
SSLOptions +StdEnvVars
</FilesMatch>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /var/log/httpd/abills-ssl_request.log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</IfModule>
# User interface
<Directory "/usr/abills/cgi-bin">
<IfModule ssl_module>
SSLOptions +StdEnvVars
</IfModule>
<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
<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/abills/cgi-bin/admin">
<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>
.....
На главной страничке http://gala-net.pl.ua/ есть ссылочка http://gala-net.pl.ua/main.php?page_nic=stat , она открывает страницу на которой:
<h1>Статистика</h1>
<p>В связи с тем, что страничка статистики находится на другом сервере, вы автоматически будете переадресованы по следующему адресу:</p>
<p style="text-align: center; font-weight: bold;"><a href="https://stat.gala-net.pl.ua:9443/">http ... 43/</a></p>
<p>Если ваш браузер не поддерживает автоматическую переадресацию, то нажмите на ссылку выше.</p>
<?
$JScript = "
<script language='JavaScript'>
setTimeout(document.location = 'https://stat.gala-net.pl.ua:9443/', 100000);
</script>
";
?>
у меня всё работает... только у некоторых клиентов и только в ИЕ открываеться 2-3 минуты
Нікому невірю, доки сам не перевірю.
Намає нічого тривалішого, ніж короткочасне.
Намає нічого тривалішого, ніж короткочасне.
у меня для того что бы пользователь набрал в браузере http://billing.name.com
и попал на https://billing.name.com:9443
сделано так:
#---------- ~Abills~ -------------------------------------------------------
<VirtualHost 199.99.99.99:80 >
# редирект на https:9443
ServerName billing.name.com
Redirect / https://billing.name.com:9443/
</VirtualHost>
<VirtualHost 199.99.99.99:9443 >
DocumentRoot "/usr/abills/cgi-bin"
ServerName billing.name.com:9443
ServerAdmin admin@name.com
ErrorLog /var/log/httpd/abills-error.log
и т.д.
и попал на https://billing.name.com:9443
сделано так:
#---------- ~Abills~ -------------------------------------------------------
<VirtualHost 199.99.99.99:80 >
# редирект на https:9443
ServerName billing.name.com
Redirect / https://billing.name.com:9443/
</VirtualHost>
<VirtualHost 199.99.99.99:9443 >
DocumentRoot "/usr/abills/cgi-bin"
ServerName billing.name.com:9443
ServerAdmin admin@name.com
ErrorLog /var/log/httpd/abills-error.log
и т.д.
Давно хотел всё переделать и вот настало это время... начитался мануалов и приступил:
...
NameVirtualHost *:9443
....
#################### STAT Abills ##################
#Abills version 0.3
<VirtualHost *:9443>
DocumentRoot "/usr/abills/cgi-bin"
ServerName stat.домен
ErrorLog /var/log/httpd/abills-stat-error.log
TransferLog /var/log/httpd/abills-stat-transfer.log
CustomLog /var/log/httpd/abills-stat-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/etc/apache22/server.crt
SSLCertificateKeyFile /usr/local/etc/apache22/server.key
<FilesMatch "\.(cgi)$">
SSLOptions +StdEnvVars
</FilesMatch>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /var/log/httpd/abills-stat-ssl_request.log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</IfModule>
# User interface
<Directory "/usr/abills/cgi-bin">
<IfModule ssl_module>
SSLOptions +StdEnvVars
</IfModule>
<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
<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/abills/cgi-bin/admin">
# <IfModule ssl_module>
# SSLOptions +StdEnvVars
# </IfModule>
# AddHandler cgi-script .cgi
Options Indexes ExecCGI FollowSymLinks
# AllowOverride none
# DirectoryIndex index.cgi
# order deny,allow
Deny from all
</Directory>
</VirtualHost>
#################### ADMINKA ##################
<VirtualHost *:9443>
ServerName isp.домен
DocumentRoot /usr/abills/cgi-bin/admin
ErrorLog /var/log/httpd/abills-admin-error.log
TransferLog /var/log/httpd/abills-admin-transfer.log
CustomLog /var/log/httpd/abills-admin-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/etc/apache22/server.crt
SSLCertificateKeyFile /usr/local/etc/apache22/server.key
<FilesMatch "\.(cgi)$">
SSLOptions +StdEnvVars
</FilesMatch>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /var/log/httpd/abills-admin-ssl_request.log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</IfModule>
<Directory "/usr/abills/cgi-bin/admin">
<IfModule ssl_module>
SSLOptions +StdEnvVars
</IfModule>
<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
<Files ~ "\.(db|log)$">
Order allow,deny
Deny from all
</Files>
#For hotspot solution
#ErrorDocument 404 "/abills/"
#directoryIndex "/abills" index.cgi
</Directory>
</VirtualHost>
вот такие изменения... Возможно скоро ещё что-то переделаю.
...
NameVirtualHost *:9443
....
#################### STAT Abills ##################
#Abills version 0.3
<VirtualHost *:9443>
DocumentRoot "/usr/abills/cgi-bin"
ServerName stat.домен
ErrorLog /var/log/httpd/abills-stat-error.log
TransferLog /var/log/httpd/abills-stat-transfer.log
CustomLog /var/log/httpd/abills-stat-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/etc/apache22/server.crt
SSLCertificateKeyFile /usr/local/etc/apache22/server.key
<FilesMatch "\.(cgi)$">
SSLOptions +StdEnvVars
</FilesMatch>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /var/log/httpd/abills-stat-ssl_request.log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</IfModule>
# User interface
<Directory "/usr/abills/cgi-bin">
<IfModule ssl_module>
SSLOptions +StdEnvVars
</IfModule>
<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
<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/abills/cgi-bin/admin">
# <IfModule ssl_module>
# SSLOptions +StdEnvVars
# </IfModule>
# AddHandler cgi-script .cgi
Options Indexes ExecCGI FollowSymLinks
# AllowOverride none
# DirectoryIndex index.cgi
# order deny,allow
Deny from all
</Directory>
</VirtualHost>
#################### ADMINKA ##################
<VirtualHost *:9443>
ServerName isp.домен
DocumentRoot /usr/abills/cgi-bin/admin
ErrorLog /var/log/httpd/abills-admin-error.log
TransferLog /var/log/httpd/abills-admin-transfer.log
CustomLog /var/log/httpd/abills-admin-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/etc/apache22/server.crt
SSLCertificateKeyFile /usr/local/etc/apache22/server.key
<FilesMatch "\.(cgi)$">
SSLOptions +StdEnvVars
</FilesMatch>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /var/log/httpd/abills-admin-ssl_request.log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</IfModule>
<Directory "/usr/abills/cgi-bin/admin">
<IfModule ssl_module>
SSLOptions +StdEnvVars
</IfModule>
<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
<Files ~ "\.(db|log)$">
Order allow,deny
Deny from all
</Files>
#For hotspot solution
#ErrorDocument 404 "/abills/"
#directoryIndex "/abills" index.cgi
</Directory>
</VirtualHost>
вот такие изменения... Возможно скоро ещё что-то переделаю.
Нікому невірю, доки сам не перевірю.
Намає нічого тривалішого, ніж короткочасне.
Намає нічого тривалішого, ніж короткочасне.