PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Problem mit apache2 & vhosts & Port 443



Stormbringer
01.11.04, 08:06
Hi,

ich habe mich heute morgen mal mit apache2 & vhosts beschäftigt.
Prinzipiell funzt es sauber! Nur will das Ganze nicht laufen, wenn auf unterschiedlichen Ports (80 & 443) gelauscht werden soll.
Die Ports 80 & 443 sind an der FW geöffnet, und die Zertifikate sind erstellt. Hintergund der Übung ist, daß ich demnächst eigentlich von apache 1.3.x auf 2.0.x umstellen will, vorher aber die grundlegende Konfig durchtesten wollte ...

Die aktuelle Konfig schaut wie folgt aus:
/etc/apache2/httpd.conf:


Include /etc/apache2/uid.conf
Include /etc/apache2/server-tuning.conf
ErrorLog /var/log/apache2/error_log
Include /etc/apache2/sysconfig.d/loadmodule.conf
Include /etc/apache2/listen.conf
Include /etc/apache2/mod_log_config.conf
Include /etc/apache2/sysconfig.d/global.conf
Include /etc/apache2/mod_status.conf
Include /etc/apache2/mod_info.conf
Include /etc/apache2/mod_usertrack.conf
Include /etc/apache2/mod_autoindex-defaults.conf
TypesConfig /etc/apache2/mime.types
DefaultType text/plain
Include /etc/apache2/mod_mime-defaults.conf
Include /etc/apache2/errors.conf
Include /etc/apache2/ssl-global.conf
<Directory />
Options None
AllowOverride None
Order deny,allow
Deny from all
</Directory>
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
DirectoryIndex index.html index.html.var
Include /etc/apache2/default-server.conf
Include /etc/apache2/sysconfig.d/include.conf
Include /etc/apache2/vhosts.d/*.conf


/etc/apache2/listen.conf:


Listen 80
Listen 443

<IfDefine SSL>
<IfDefine !NOSSL>
<IfModule mod_ssl.c>

Listen 443

</IfModule>
</IfDefine>
</IfDefine>
NameVirtualHost *:80

Wenn ich hier NameVirtualHost ändere, bspw. in NameVirtualHost *, so gibt es Fehlermeldungen. Mache ich den Eintrag einmal für :80 und einmal für :443, so dauert der Startvorgang recht lange (etwa 30 Sekunden), und es ist nur der default-server erreichbar ...

/etc/apache2/vhosts.d/config.conf:


<VirtualHost *:80>
ServerAdmin webmaster@domain-1.dyndns.org
ServerName www.domain-1.dyndns.org
ServerAlias domain-1.dyndns.org *.domain-1.dyndns.org
DocumentRoot /srv/www/vhosts/domain-1.dyndns.org
ErrorLog /var/log/apache2/domain-1.dyndns.org-error_log
CustomLog /var/log/apache2/domain-1.dyndns.org-access_log combined
HostnameLookups Off
UseCanonicalName Off
ServerSignature On
ScriptAlias /cgi-bin/ "/srv/www/vhosts/domain-1.dyndns.org/cgi-bin/"
<Directory "/srv/www/vhosts/domain-1.dyndns.org/cgi-bin">
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>
<IfModule mod_userdir.c>
UserDir public_html
Include /etc/apache2/mod_userdir.conf
</IfModule>
<Directory "/srv/www/vhosts/domain-1.dyndns.org">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Include /etc/apache2/vhosts.d/domain-2.dyndns.org
Include /etc/apache2/vhosts.d/domain-1.dnsalias.org
Include /etc/apache2/vhosts.d/domain-3.dyndns.org
Include /etc/apache2/vhosts.d/domain-1.homelinux.org
Include /etc/apache2/vhosts.d/vhostssl

Die anderen vhosts.d Konfigurationen haben im Prinzip selbigen Aufbau, heißen nur anders, liegen in anderen Verzeichnissen und schreiben eigene Logdateien.

/etc/apache2/vhosts.d/vhostssl:


<IfDefine SSL>
<IfDefine !NOSSL>
<VirtualHost _default_:443>
DocumentRoot "/srv/www/htdocs/squirrelmail"
ServerName webmail.domain-1.dyndns.org:443
ServerAdmin webmaster@domain-1.dyndns.org
ErrorLog /var/log/apache2/webmail-error_log
TransferLog /var/log/apache2/webmail-access_log
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSL v2:+EXP:+eNULL
SSLCertificateFile /etc/apache2/ssl.crt/server.crt
SSLCertificateKeyFile /etc/apache2/ssl.key/server.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/srv/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /var/log/apache2/ssl_request_log ssl_combined
</VirtualHost>
</IfDefine>
</IfDefine>


Kann mir jemand sagen, wo der Fehler liegt?

Mit dieser Konfig funzt:


web:/etc/apache2 # telnet localhost 443
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

Nur wird halt keine Website präsentiert ... die Berechtigungen stimmen ebenfalls, da eine unverschlüsselte Verbindung funzt.

Danke & Gruß

steve-bracket
01.11.04, 08:36
Hallo, anstehende Configfragmente sind Auszug einer laufenden Installation mit NVH und mehreren VH incl. SSL.

/etc/apache2/listen.conf

Listen 62.x.x.1:80

<IfDefine SSL>
<IfModule mod_ssl.c>

Listen 62.x.x.2:443
Listen 62.x.x.3:443
Listen 62.x.x.4:443
</IfModule>
</IfDefine>




/etc/apache2/vhosts.d/domain.conf

NameVirtualHost 62.x.x.1:80

<VirtualHost 62.x.x.1:80>
Servername www.domain.tld
DocumentRoot /irgendwo
</VirtualHost>

<VirtualHost 62.x.x.1:80>
Servername www2.domain.tld
DocumentRoot /woanders
</VirtualHost>



/etc/apache2/vhosts.d/ssl_domain.conf

<IfDefine SSL>

##
## SSL Virtual Host Context
##

<VirtualHost 62.x.x.2:443>

DocumentRoot "/irgendwo"
ServerName sql.domain.tld:443
ServerAdmin bla@bla.bla
ErrorLog /var/log/apache2/error_log
TransferLog /var/log/apache2/access_log

SSLEngine on

SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSL v2:+EXP:+eNULL

SSLCertificateFile /irgendwo/*.crt

SSLCertificateKeyFile /irgendwo/*.key

<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/srv/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>

SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0

CustomLog /var/log/apache2/ssl_request_log ssl_combined

</VirtualHost>

</IfDefine>

Viele Grüsse
Steve