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 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.de ServerAlias tomcat_domain.de SSLEngine on SSLCertificateFile /etc/letsencrypt/live/www.tomcat_domain.de/tool.crt SSLCertificateKeyFile /etc/letsencrypt/live/www.tomcat_domain.de/private.key ProxyRequests off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> #ProxyPass /maintenance.html ! #ProxyPass / http://localhost:8080/ #ProxyPassReverse / http://localhost:8080/ <Location / > Order allow,deny Allow 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>