Tomcat: Https (Avec Apache et modk)
Bonsoir,
J'essaye d'acceder à une application Tomcat via Apache (et mod_jk) en https.
Cette application est sous un serveur Ubuntu.
L'application Tomcat fonctionne actuellement
http://monserveur/monapp
ou http://monserveur:8080/monapp
Le paramétrage de Apache (seul) doit être ok car je peux acceder à des documents aussi bien en http que https:
http://monserveur/monImage.png
https://monserveur/monImage.png
En revanche, l'application n'est accessible qu'en http. En https, j'ai: HTTP 500 (Internal Server Error)
J'ai également essayé la procedure suivante sans succes:
http://abhrajit.blogspot.com/2008/02...-ssl-page.html
J'ai aussi essayé d'indiquer 2 workers différents dans http et https mais c'est la même chose.
La dernière erreur étant(avec le 1er workers.properties indiqué ci-après):
jk_handler::mod_jk.c (2314): Could not init service for worker=worker1
Pour info:
Serveur Ubuntu 10.04.1
apache-2.2.8
apache-tomcat-6.0.29
jre1.6.0_17
Le certificat est un self signed.
**************** Extrait du httpd.conf
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| #module de liaison apache - Tomcat
LoadModule jk_module modules/mod_jk.so
JkWorkersFile /apache-tomcat-6.0.29/conf/workers.properties
# Secure (SSL/TLS) connections
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
# but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
#Configuration de la compression http
<Location />
AddOutputFilterByType DEFLATE text/html text/plain
Header append Vary User-Agent
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
</Location>
#JkExtractSSL On
<VirtualHost *:80>
JkMount /monapp/* worker1
JkMount /monapp worker1
</VirtualHost> |
**************** Extrait du extra/httpd-ssl.conf (ligne non commentée)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| Listen 443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
SSLPassPhraseDialog builtin
SSLSessionCache "shmcb:/apache-2.2.8/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
SSLMutex "file:/apache-2.2.8/logs/ssl_mutex"
<VirtualHost _default_:443>
DocumentRoot "/mesdocs/htdocs"
ServerName serveur.xxx.fr
ServerAdmin webmaster@localhost
ServerSignature on
ErrorLog "/apache-2.2.8/logs/error_log"
TransferLog "/apache-2.2.8/logs/access_log"
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "/etc/ssl/certs/server.crt"
SSLCertificateKeyFile "/etc/ssl/private/server.pem"
SSLCACertificatePath /etc/ssl
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/apache-2.2.8/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkExtractSSL On
# What is the indicator for SSL (default is HTTPS)
JkHTTPSIndicator HTTPS
# What is the indicator for SSL session (default is SSL_SESSION_ID)
JkSESSIONIndicator SSL_SESSION_ID
# What is the indicator for client SSL cipher suit (default is SSL_CIPHER)
JkCIPHERIndicator SSL_CIPHER
# What is the indicator for the client SSL certificated (default is SSL_CLIENT_CERT)
JkCERTSIndicator SSL_CLIENT_CERT
SSLOptions +ExportCertData +StdEnvVars
JkMount /monapp/* worker1
JkMount /monapp worker1
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
CustomLog "/apache-2.2.8/logs/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost> |
**************** workers.properties
Code:
1 2 3 4 5 6 7 8
| workers.tomcat_home=/apache-tomcat-6.0.29
workers.java_home=/jre1.6.0_17
ps=/
worker.list=worker1
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1 |
**************** workers.properties [cas où 2 différents]
Code:
1 2 3 4 5 6 7 8 9
| worker.list=ajp13w, ajp13s
worker.ajp13w.type=ajp13
worker.ajp13w.host=localhost
worker.ajp13w.port=8009
worker.ajp13s.type=ajp13
worker.ajp13s.host=localhost
worker.ajp13s.port=8443 |