You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Weare Borg <ke...@gmail.com> on 2016/04/14 16:54:12 UTC

Certificate installation for https causing redirection.

Hello friends,

Sorry for pushing the question to both Tomcat and Apache, as changes seem
to be required in both Apache and Tomcat, so I did that.

We have one test server with Debian X64 which has one web-project running
in Apache and few webapps running with Apache Tomcat. The Apache web-server
runs mod_proxy and redirecting requests to Tomcat whenever the URL is
correct.

For adding security, I created certificates with LetsEncrypt
<https://letsencrypt.org/> and installed them. Unfortunately, for one of
the webapp which I installed the certificate, it is not opening anymore,
and whenever I try to open that webapp in browser, it redirects to the
web-project running in Apache web server. What am I doing wrong?

Please note, I was provided with .pem files, and had to convert them to .crt
and .key. Unfortunately there are no errors in logs as well. Right now, I
cannot reach the tomcat webapp which I would like with https.

Here is the configuration :

sites-enabled/000-default :

> <VirtualHost *:80>
>         ServerAdmin webmaster@localhost
>         ServerName www.apache_domain.com
>         ServerAlias apache_domain.com
>         DocumentRoot /var/www
>         <Directory />
>                 Options FollowSymLinks
>                 AllowOverride None
>         </Directory>
>         <Directory /var/www/>
>                 Options Indexes FollowSymLinks MultiViews
>                 AllowOverride All
>                  Order allow,deny
>                 allow from all
>         </Directory>
>
>         ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
>         <Directory "/usr/lib/cgi-bin">
>                 AllowOverride None
>                 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>                 Order allow,deny
>                 Allow from all
>         </Directory>
>
>         ErrorLog ${APACHE_LOG_DIR}/error.log
>
>         # Possible values include: debug, info, notice, warn, error, crit,
>         # alert, emerg.
>         LogLevel warn
>         CustomLog ${APACHE_LOG_DIR}/access.log combined</VirtualHost>
> Listen 443<VirtualHost *:443>ServerName www.tomcat_domain.deServerAlias tomcat_domain.deSSLEngine onSSLCertificateFile /etc/letsencrypt/live/www.tomcat_domain.de/tool.crtSSLCertificateKeyFile /etc/letsencrypt/live/www.tomcat_domain.de/private.keyProxyRequests offProxyPreserveHost On<Proxy *>Order deny,allowAllow from all</Proxy>#ProxyPass /maintenance.html !#ProxyPass / http://localhost:8080/#ProxyPassReverse / http://localhost:8080/
> <Location / >Order allow,denyAllow from all</Location></VirtualHost>
>
>
Tomcat server.xml :

> <Connector port="8080" proxyPort="80" protocol="org.apache.coyote.http11.Http11NioProtocol" compression="force" compressionMinSiz$
>                connectionTimeout="20000"  maxPostSize="5242880"
>                URIEncoding="utf-8"
>  compressableMimeType="text/html,text/xml,text/plain,text/css,text/ javascript,application/x-javascript,application/javascript"/>
>
>
>
>  <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"  maxPostSize="5242880" SSLEnabled="true" maxThreads=$
>               compressionMinSize="1024" scheme="https" secure="true" clientAuth="false" sslProtocols="TLS"
>                 sslEnabledProtocols="TLSv1+TLSv1.1+TLSv1.2"
>                SSLCertificateFile="/etc/letsencrypt/live/www.tool-tank.de/tool.crt"
>                 SSLCertificateKeyFile="/etc/letsencrypt/live/www.tool-tank.de/privkey.pem"
>  URIEncoding="utf-8"
>  compressableMimeType="text/html,text/xml,text/plain,text/css,text/ javascript,application/x-javascript,application/javascript"/>
>
>  <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true"/>
>
>
>
>         <Host name="tomcat_domain.de" autoDeploy="true" unpackWARs="true" appBase="tomcat_domain_webapps">
>                 <Alias>www.tomcat_domain.de</Alias>
>                 <Context path=""/>
>         </Host>
>
>         <Host name="second.com" autoDeploy="true" unpackWARs="true" appBase="second_webapps">
>                 <Alias>www.second.com</Alias>
>                 <Context path=""/>
>         </Host>
>
>         <Host name="third.de" autoDeploy="true" unpackWARs="true" appBase="third_webapps">
>                 <Alias>www.third.de</Alias>
>                 <Context path=""/>
>         </Host>
>
>         <Host name="www.fourth.de" autoDeploy="true" unpackWARs="true" appBase="fourth_webapps">
>                 <Alias>fourth.de</Alias>
>                 <Context path=""/>
>         </Host>
>
> Any help would be nice.