Run local Apache Web Server + Tomcat as part of Gradle Build - apache

Our current environment has Tomcat containers sitting behind an Apache Web Server. Basically the web server has ProxyPass rules that we use to decide which Tomcat instance to route to based on the context root.
As part of our local gradle build, we are using the Cargo plugin to spin up a local tomcat container and deploying our war's to it. I haven't found anything that will let us spin up an Apache WebServer to test our apache config.
Our goal is to have two Tomcat containers, A and B, and one Apache WebServer C, such that C will route localhost/appA to tomcat A and localhost/appB to tomcat B.
This is all in an effort to run automated acceptance tests, but I have not found a gradle plugin like cargo that will do this.
Thanks!

You can use Gradle to deploy either an Apache http docker or a haproxy docker http://gitlove.us/p/million12/docker-haproxy to do the load balancing to your two appA and appB tomcat containers. You could also use docker for the tomcat containers. You could also use Amazon AWS for two Amazon Linux tomcat servers and either an elastic load balancer or a separate haproxy server for load balancing.

Related

How to deploy to Apache httpd using Jenkins

When I search "How to deploy to Apache httpd using Jenkins" or similar searches, all I can find is tutorials on how to run Jenkins behind an Apache proxy.
I want to know how to actually deploy my web application to Apache using Jenkins. I must be going about this the wrong way or something because I assumed it would be an extremely common use case, but I can't find any info on it anywhere, and I don't see any Jenkins Apache httpd plugins
You could install a Jenkins FTP plugin and upload the code to your apache htdocs folder. There isn't an Apache API to achieve that.

Can you have two separate Apache servers running on the same system?

Can you have two separate apache servers running on the same system in parallel, as long as they make use of different ports?
I have a system I need to install JIRA on, but the system is already in-use and running an Apache server for a separate project. The JIRA installer comes with a pre-configured apache tomcat server. If I just installed JIRA, would I run into a problem from the pre-existing apache server?
If you’re asking about running two Apache Tomcat instances, then this is not a problem. Moreover you can share the same CATALINA_HOME between many separate instances of Tomcat, each with own CATALINA_BASE. I’m often running separate Tomcat instance per application on production servers. See this init script for a hint about parameters.
But if you’re asking about running Apache HTTP Server and Apache Tomcat on the same server, then it’s a little bit trickier. Commonly used approach is to use a web server (Apache HTTP, nginx, …) as a reverse proxy in front of Tomcat. Then many applications can run under the same port and IP address. In case of Apache HTTP Server, see mod_proxy_ajp.
Apache HTTPD and Tomcat are 2 different servers. Also, JIRA doesn't run on port 80 so in this case there will not be a conflict for port numbers. If you want to expose your JIRA on port 80, you can use mod_proxy for the Apache HTTPD to relay the requests to the actual port JIRA is running on, so that it is transparent to the user.
So basically: Yes, you can run both Apache HTTPD and Apache Tomcat on the same machine if not using the same port.

Do I need to install Tomcat? I have installed JBoss for load balancing with Apache

I'm trying to working on load balancing, so is there a need to install Tomcat as well? Or is JBoss enough with Apache and mod_jk module.
And how can I test load balancing, if it it working or not? Can we have a simple way to test by looking at logs or is there another way?
Tomcat is bundled with JBoss, so there is no need to install it separately. Apache and mod_jk should be enough to load balance JBoss instances.
You can easily confirm that load balancing is working by looking at the JBoss access log files.

how to deploying the war into (Apache + Glassfish)

I gonna use Glassfish behind the Apache Http Server, my question is how should I deploy my war into these servers? deploy on Apache? or seprate the contents of war to static and servlets/JPS(java) and deploy statics on Apache and other dynamic java into Glassfish?
RGDS

How to separate J2EE web application for apache and tomcat

I want to setup and Apache and Tomcat together and deploy my war file on the this setup. My question is how I separate my application for apache and tomcat ?Please give me example.
Thanks
Kumara
Generally I place static files as well as rewriting, AJP, and other customization filters at the Apache layer, pass through necessary URLs over to Tomcat and Servlet processing.
If you are completely contained in the .war and don't have a need for the features of a web server, Tomcat is perfectly happy serving HTTP directly.