Автор Тема: Странности с apche+mod_ssl [решено]  (Прочитано 2571 раз)

Оффлайн speccyfan

  • Участник
  • *
  • Сообщений: 522
  • CCNA
    • speccyfan (Примеры различных конфигураций сетевых сервисов)
Здравствуйте!
Поимел весьма странную проблему с apache.
Есть сервер с несколькими виртуальными хостами, решил добавить еще поддержку ssl, доустановил mod_ssl-2.8.31-alt1. При установке сгенерировался сертификат. Все вроде нормально. Посмотрел на то, что добавилось и вместо /etc/httpd/conf/ssl.default-vcost.conf
подключил в httpd.conf mail.ssl-vhost.conf  с таким вот содержимым:
<VirtualHost _default_:443>
DocumentRoot /var/www/html/squirrelmail
ServerName mserver.mydomain
ServerAdmin postmaster@mydomain
LogLevel debug
ErrorLog logs/ssl-error_log
TransferLog logs/ssl-access_log
SSLEngine on
SSLCertificateFile conf/ssl/server.crt
SSLCertificateKeyFile conf/ssl/server.key
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
CustomLog logs/ssl_request_log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
И вот что интересно, это заработало, но только с localhost, в логах есть обращение, а вот с другого адреса вижу такую картину:

[root@ZXDSL831CII conf]# openssl s_client -connect mserver.mydomain:443 -state -debug
CONNECTED(00000003)
SSL_connect:before/connect initialization
write to 0x80bf258 [0x80bf2a0] (124 bytes => 124 (0x7C))
0000 - 80 7a 01 03 01 00 51 00-00 00 20 00 00 39 00 00   .z....Q... ..9..
0010 - 38 00 00 35 00 00 16 00-00 13 00 00 0a 07 00 c0   8..5............
0020 - 00 00 33 00 00 32 00 00-2f 00 00 07 05 00 80 03   ..3..2../.......
0030 - 00 80 00 00 05 00 00 04-01 00 80 00 00 15 00 00   ................
0040 - 12 00 00 09 06 00 40 00-00 14 00 00 11 00 00 08   ......@.........
0050 - 00 00 06 04 00 80 00 00-03 02 00 80 30 c4 dc 36   ............0..6
0060 - 47 b9 ab 57 16 3f 77 b7-e8 21 17 c4 fb 1f b7 4b   G..W.?w..!.....K
0070 - b6 58 7f e1 5c 2f b0 b5-2c 80 30 79               .X..\/..,.0y
SSL_connect:SSLv2/v3 write client hello A
read from 0x80bf258 [0x80c4800] (7 bytes => 0 (0x0))
7597:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:188:
Firefox страницу не открывает, в логах ничего нет. Проверил iptables, все нормально, доступ есть,
nmap видит открытый 443-й порт.
На сервере есть еще несколько виртуальных хостов, с конфигами примерно такими:
<VirtualHost 10.8.1.2>
ServerName www.mydomain
DocumentRoot /var/www/html/plck
TransferLog logs/plck_log
ErrorLog logs/plck_error_log
</VirtualHost>
И вот тут самое интересное, если эти конфиги удалить из директории vhosts.d и перезапустить сервер, то хост с SSL работает с любой машины. Это вводит меня в ступор.
Мож етсь у кого какие мысли?
на всякий случай приложу httpd.conf
ServerType standalone
ServerRoot "/etc/httpd"
PidFile /var/run/httpd.pid
ScoreBoardFile /var/run/httpd.scoreboard
ResourceConfig /dev/null
AccessConfig /dev/null
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 500
Listen 80
ServerTokens ProductOnly
LoadModule env_module         modules/mod_env.so
LoadModule define_module      modules/mod_define.so
LoadModule config_log_module  modules/mod_log_config.so
LoadModule mime_module        modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule status_module      modules/mod_status.so
LoadModule includes_module    modules/mod_include.so
LoadModule autoindex_module   modules/mod_autoindex.so
LoadModule dir_module         modules/mod_dir.so
LoadModule cgi_module         modules/mod_cgi.so
LoadModule userdir_module     modules/mod_userdir.so
LoadModule alias_module       modules/mod_alias.so
LoadModule access_module      modules/mod_access.so
LoadModule auth_module        modules/mod_auth.so
LoadModule proxy_module       modules/libproxy.so
LoadModule expires_module     modules/mod_expires.so
LoadModule setenvif_module    modules/mod_setenvif.so
ClearModuleList
AddModule mod_env.c
AddModule mod_define.c
AddModule mod_log_config.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_proxy.c
AddModule mod_expires.c
AddModule mod_so.c
AddModule mod_setenvif.c
User apache
Group apache
ServerAdmin root@mydomain
DocumentRoot "/var/www/html"
<Directory />
    Options FollowSymLinks -Indexes
    AllowOverride All
</Directory>
<Directory "/var/www/html">
    Options Includes FollowSymLinks MultiViews
    AllowOverride none
    Order allow,deny
    Allow from all
    <Files index.shtml.ru.*>
        <IfModule mod_charset.c>
            CharsetDisable On
        </IfModule>
    </Files>
</Directory>
<Directory "/var/www/html/plck/doc>
Options +Indexes
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/html/plck/files>
Options +Indexes
Order allow,deny
Allow from all
</Directory>
<IfModule mod_userdir.c>
    UserDir public_html
</IfModule>
<Directory /home/*/public_html>
    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>
<IfModule mod_dir.c>
    DirectoryIndex index.html index.htm index.shtml index.cgi Default.htm default.htm index.php index.php3 index.php4 index.rbx
</IfModule>
AccessFileName .htaccess
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>
UseCanonicalName Off
<IfModule mod_mime.c>
    TypesConfig /etc/httpd/conf/apache-mime.types
</IfModule>
DefaultType text/plain
<IfModule mod_mime_magic.c>
    MIMEMagicFile /etc/httpd/conf/magic
</IfModule>
HostnameLookups Off
ErrorLog /var/log/httpd/error_log
LogLevel debug
<IfModule mod_log_config.c>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    LogFormat "%a %l %u %t \"%r\" %>s %b" common-quick
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent
    <IfModule mod_deflate.c>
        LogFormat "%a %l %u %t \"%r\" %>s %b \"%{defl_m}n:%{defl_r}n\"" common-deflate
    </IfModule>
    CustomLog /var/log/httpd/access_log common-quick
</IfModule>
ServerSignature Off
<IfModule mod_alias.c>
    Alias /icons/ "/var/www/icons/"
    <Directory "/var/www/icons">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    Alias /addon-modules/images/ /var/www/html/manual/images/
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
    ScriptAlias /protected-cgi-bin/ "/var/www/protected-cgi-bin/"
    <Directory "/var/www/cgi-bin">
        AllowOverride None
        Options ExecCGI
        Order allow,deny
        Allow from all
    </Directory>
    <Directory "/var/www/protected-cgi-bin">
        AllowOverride None
        Options ExecCGI
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1 localhost
    </Directory>
</IfModule>
<IfModule mod_autoindex.c>
    IndexOptions FancyIndexing
    AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
    AddIconByType (TXT,/icons/text.gif) text/*
    AddIconByType (IMG,/icons/image2.gif) image/*
    AddIconByType (SND,/icons/sound2.gif) audio/*
    AddIconByType (VID,/icons/movie.gif) video/*
    AddIcon /icons/binary.gif .bin .exe
    AddIcon /icons/binhex.gif .hqx
    AddIcon /icons/tar.gif .tar
    AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
    AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
    AddIcon /icons/a.gif .ps .ai .eps
    AddIcon /icons/layout.gif .html .shtml .htm .pdf
    AddIcon /icons/text.gif .txt
    AddIcon /icons/c.gif .c
    AddIcon /icons/p.gif .pl .py
    AddIcon /icons/f.gif .for
    AddIcon /icons/dvi.gif .dvi
    AddIcon /icons/uuencoded.gif .uu
    AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
    AddIcon /icons/tex.gif .tex
    AddIcon /icons/bomb.gif core
    AddIcon /icons/back.gif ..
    AddIcon /icons/hand.right.gif README
    AddIcon /icons/folder.gif ^^DIRECTORY^^
    AddIcon /icons/blank.gif ^^BLANKICON^^
    DefaultIcon /icons/unknown.gif
    ReadmeName README
    HeaderName HEADER
</IfModule>
<IfModule mod_mime.c>
    AddEncoding x-compress Z
    AddEncoding x-gzip gz tgz
    AddLanguage da .dk
    AddLanguage nl .nl
    AddLanguage en .en
    AddLanguage et .ee
    AddLanguage fr .fr
    AddLanguage de .de
    AddLanguage el .el
    AddLanguage he .he
    AddCharset ISO-8859-8 .iso8859-8
    AddLanguage it .it
    AddLanguage ja .ja
    AddCharset ISO-2022-JP .jis
    AddLanguage kr .kr
    AddCharset ISO-2022-KR .iso-kr
    AddLanguage no .no
    AddLanguage pl .po
    AddCharset ISO-8859-2 .iso-pl
    AddLanguage pt .pt
    AddLanguage pt-br .pt-br
    AddLanguage ltz .lu
    AddLanguage ca .ca
    AddLanguage es .es
    AddLanguage sv .se
    AddLanguage cz .cz
    AddLanguage ru .ru
    AddLanguage tw .tw
    AddCharset Big5         .Big5    .big5
    AddCharset WINDOWS-1251 .cp-1251
    AddCharset ISO-8859-5   .iso-ru
    AddCharset KOI8-R       .koi8-r
    AddCharset KOI8-U       .koi8-u
    AddCharset UTF-7        .utf7
    AddCharset UTF-8        .utf8
    AddCharset UTF-16       .utf16
    <IfModule mod_negotiation.c>
        LanguagePriority en ru uk be da nl et fr de el it ja kr no pl pt pt-br ltz ca es sv tw
    </IfModule>
    AddHandler cgi-script .cgi
    AddType text/html .shtml
    AddHandler server-parsed .shtml
    AddHandler imap-file map
</IfModule>
<IfModule mod_setenvif.c>
    BrowserMatch "Mozilla/2" nokeepalive
    BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
    BrowserMatch "RealPlayer 4\.0" force-response-1.0
    BrowserMatch "Java/1\.0" force-response-1.0
    BrowserMatch "JDK/1\.0" force-response-1.0
</IfModule>
<IfModule mod_status.c>
    <Location /server-status>
        SetHandler server-status
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1 localhost
        <IfModule mod_charset.c>
            CharsetDisable On
        </IfModule>
    </Location>
</IfModule>
<IfModule mod_info.c>
    <Location /server-info>
        SetHandler server-info
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1 localhost
        <IfModule mod_charset.c>
            CharsetDisable On
        </IfModule>
    </Location>
</IfModule>
Include conf/addon-modules.d/mod_charset.conf
<IfModule mod_deflate.c>
    DeflateEnable on
    DeflateDisableRange "MSIE 4."
</IfModule>
<IfDefine PERLPROXIED>
    <IfModule mod_proxy.c>
        ProxyPass               /perl/ http://127.0.0.1:8200/
        ProxyPassReverse        /perl/ http://127.0.0.1:8200/
    </IfModule>
    <Location ~ ^/perl/(perl-status|server-status|server-info)>
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1 localhost
    </Location>
</IfDefine>
Include conf/addon-modules.d/*.conf
Include conf/vhosts/Vhosts.conf
Include conf/addon-modules/mod_expires.conf
Include conf/addon-modules/mod_ssl.conf
Include conf/addon-modules/mail.ssl-vhost.conf
Вот еще mod_ssl.conf
[root@mserver addon-modules]# cat mod_ssl.conf|grep -v \#
LoadModule ssl_module         modules/libssl.so
AddModule mod_ssl.c
Listen 443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl
SSLPassPhraseDialog  builtin
SSLSessionCache        shm:/var/run/ssl_scache(512000)
SSLSessionCacheTimeout  300
SSLMutex  file:/var/run/ssl_mutex
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLLog      logs/ssl_engine_log
SSLLogLevel debug
« Последнее редактирование: 04.05.2009 20:34:47 от speccyfan »
With best regards, Yury Konovalov aka 2:453/53

Оффлайн speccyfan

  • Участник
  • *
  • Сообщений: 522
  • CCNA
    • speccyfan (Примеры различных конфигураций сетевых сервисов)
Re: Странности с apche+mod_ssl
« Ответ #1 : 29.04.2009 19:31:44 »
Ладно, поставим вопрос по другому, у кого-нибудь используется apache с Name Based виртуал хостами, как с поддержкой SSL, так и без нее?
With best regards, Yury Konovalov aka 2:453/53

Оффлайн ruslandh

  • Поспешай не торопясь !
  • Модератор глобальный
  • *****
  • Сообщений: 32 361
  • Учиться .... Телепатами не рождаются, ими ....
Re: Странности с apche+mod_ssl
« Ответ #2 : 29.04.2009 19:48:11 »
Спросите в расслке Сисадминов - там быстрей получите ответ.

Оффлайн speccyfan

  • Участник
  • *
  • Сообщений: 522
  • CCNA
    • speccyfan (Примеры различных конфигураций сетевых сервисов)
Re: Странности с apche+mod_ssl [решено]
« Ответ #3 : 04.05.2009 20:35:38 »
Выделил ему отдельный IP и все заработало как надо.
With best regards, Yury Konovalov aka 2:453/53