Starting automatically another tomcat instance when one goes down - apache

I am working on a Spring-MVC application and using Tomcat to deploy
it. I looked up on net how to create a custom maintenance site when
tomcat is down. It involves using Apache2 in the front and relaying
requests to and fro tomcat, and the maintenance site can be put on
Apache2. Seemed like a lot of hassle just for a webpage when tomcat
is down.
For this reasons, I created a small project and deployed it in
another instance of tomcat as ROOT.war.
I would just like to know if there is any way, I can bring the
maintainance tomcat instance online when production is down.
Here is my server.xml of production for viewing :
<Connector port="80" protocol="HTTP/1.1" compression="force" compressionMinSize="1024"
connectionTimeout="20000"
redirectPort="443" URIEncoding="utf-8"
compressableMimeType="text/html,text/xml,text/plain,text/css,text/ javascript,application/x-javascript,application/javascript"/>
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="200" compression="force"
compressionMinSize="1024" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS"
keystoreFile="my-keystore.jks" keystorePass="password" URIEncoding="utf-8"
compressableMimeType="text/html,text/xml,text/plain,text/css,text/ javascript,application/x-javascript,application/javascript"
/>
<Connector port="8010" protocol="AJP/1.3" redirectPort="443" URIEncoding="utf-8"
compressableMimeType="text/html,text/xml,text/plain,text/css,text/ javascript,application/x-javascript,application/javascript"
/>
Any help would be nice. Thanks a lot.

A good option used in high availability of application but not sure you would need that.
ran 2 tomcat in 2 separate ports always. one is production server and another maintainence server.
install haproxy so all request goes from here to the production server port.
when haproxy verifies that the port is down or the server not responding go to maintainence port tomcat instance.
in this way, the maintainence activity can be done without any issues. and due to some issues the prod server goes down it automatically call maintainence tomcat instance.

Related

An exception in Tomcat 9.0.31 if is SSL-enabled (happens only via VPN with reduced MTU)

I've experienced a strangest issue with an ugly tomcat 9.0.31 app written by 3rd-party. It works with no issues from office, but always throws exceptions at random operations while we work with it via VPN (where MTU is 1400). If we turn off SSL, it starts working with no issues via VPN as well as from the office.
This is the actual errormessage (it cannot be, leider, copypasted):
enter image description here
This is the relevant part of server.xml config:
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
maxPostSize="-1"
packetSize="1360"
redirectPort="443" />
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
connectionTimeout="20000"
maxThreads="200"
maxPostSize="-1"
packetSize="1360"
scheme="https"
SSLEnabled="true"
keystoreFile="/cert/******.pfx"
keystorePass="**********"
clientAuth="false"
sslProtocol="TLS"
keystoreType="PKCS12" />
<Engine name="Catalina" defaultHost="localhost">
Please, share any hints, ideas where to start to find a resolution? What to check? The developer (the 3rd-party) sagt nur: "Netzwerk, Netzwerk!", so no real help from them at all. Many many thanks in advance!
Ulrich

How to change port of Pentaho 5.1

May I ask How to change port of Pentaho 5.1. I am using windows 10. Now the value is 8080 but I need to change, I have searched on the internet information, they asked me to modify some xml file, but the problem is, the files they mentioned does not exist in my Pentaho.
Thank you very much!
According to this official 5.1 documentation,
Edit this /pentaho/server/biserver-ee/tomcat/conf/server.xml.
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
Then change the port number in /tomcat/webapps/pentaho/WEB-INF/web.xml
<context-param>
<param-name>fully-qualified-server-url</param-name>
<param-value>http://localhost:8080/pentaho/</param-value>
</context-param>
Restart the BA server.
I have done this earlier and worked for me.

How to use HTTPS on localhost on Tomcat?

I am using Apache Tomcat 8 and also have .cert file and the .key file. But I am unable to understand how to turn on the HTTPS mode. I want the APR implementation which uses OpenSSL by default. I tried to change the server.xml file in conf folder according to the documentation but after that Tomcat failed to start and I have delete it and use new unzipped files to start. How can I turn on SSL?
If the APR is already installed and configured on your Tomcat, you could have something like this in your server.xml:
Connector protocol="org.apache.coyote.http11.Http11AprProtocol"
port="8443" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
SSLCertificateFile="/usr/local/ssl/server.crt"
SSLCertificateKeyFile="/usr/local/ssl/server.pem"
SSLVerifyClient="optional" SSLProtocol="TLSv1+TLSv1.1+TLSv1.2"/>
Take a look at this tutorial tutorial, it was quite helpful for me.
Also this one could be interesting.

Access alfresco using https (SSL) url

I would like to change the url for accessing Alfresco share from http://localhost:8080/share
to https://sitename.companyname.com/share.
I would prefer to make this changes using Alfresco tomcat server and not involve a proxy.
I did the following changes to change the port number:
alfresco-global.properties
alfresco.context=alfresco
alfresco.host=sitename.companyname.com
alfresco.port=8443
alfresco.protocol=https
share.context=share
share.host=sitename.companyname.com
share.port=8443
share.protocol=https
share-config-custom.xml
Change the endpoint url to
http://localhost:8443/alfresco/
Can anyone advise as what changes are needed for the https setting?
Thanks.
Steps for using SSL with alfresco
Settings in server.xml
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
Settings in alfresco-global.property
alfresco.context=alfresco
alfresco.host=sitename.companyname.com
alfresco.port=8443 alfresco.protocol=https
share.context=share
share.host=sitename.companyname.com
share.port=8443
share.protocol=https
Settings in share-config-custom.xml
Modify endpoint url accordingly ex. https://<domain>:8443/alfresco/

How to connect JBoss AS 7.1.1 with IIS 7 using Apache ISAPI Redirector 1.2.37

I am trying to migrate my web app from JBoss EAP 5 to AS 7.1.1 and I am not able to get the IIS requests redirected to JBoss Web (Tomcat) on Windows 2008 R2 X64.
I have the filter authorized and running in IIS and pointing to the proper DLL and properties files and followed all the instructions I could find to get this working under JB 7 (it worked under JB 5). I am missing the last step which no one seems to be covering in their posts and answers.
Where do you make the changes to connect JBoss Web to port 8009 used by the AJP 1.3 connector?. Most of the examples refer to updating the connector in the server.xml file in JBOSS_HOME/server/default/Deploy/jbossweb.sar.
I don’t have anything like that under the new JBOSS_HOME/standalone/deployments folder. Where is JBoss Web configured?
Thank you for any pointers or examples you could supply.
Finally figured it out, the problem was a missing ajp connector that had to be defined in standalone.xml in the web subsystem as follows:
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="eStar-Host" native="false">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true">
<ssl/>
</connector>
<connector name="ajp13" protocol="AJP/1.3" scheme="http" socket-binding="ajp" redirect-port="8443"/>
<virtual-server name="eStar-Host" enable-welcome-root="true">
<alias name="localhost"/>
</virtual-server>
</subsystem>