How to deploy to Apache httpd using Jenkins - apache

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.

Related

Apache Solr: Tomcat or Jetty?

I am running an instance of Apache Solr in the Jetty servlet container that came included in the example file download from Apache. I am going to use Solr to set up an enterprise search system that will search across a directory of several hundred files on a local hard drive. Is there any reason I should run Solr in Tomcat and not in the Jetty servlet container that was part of the example? I have heard Tomcat is preferred but WHY? For what purpose do I need to switch over?
Officially jetty is recommended. Because sole's test cases run against jetty.

Is there any way to deploy/run Java WAR files on Apache Server (not Tomcat)?

I'm running an Apache 2.4.3 server. I've tried Googling for solutions to this, but everything just brings up Apache Tomcat servers. Unfortunately, the solutions for Tomcat don't seem to be portable, since I can't find any webapps directory, any server.xml, or the like.
So is there some method I can use to get a WAR file running on a regular Apache server? Or do I have to switch servers?

How to set up an Apache httpd test instance?

For our continuous integration tests under Ubuntu (run by Jenkins), I'd like to test the Apache httpd configuration especially with regard to the rewrite rules.
My plan of attack was (and is):
create a temporary directory,
copy the configuration there and amend some directives,
fire up an Apache httpd on a non-standard port,
run the tests,
shutdown the httpd,
remove the temporary directory.
The repository of our Apache httpd configuration can be found here, my first stab at the test script here.
The process however is very cumbersome as many paths are hardcoded and even the man page for apachectl just recommends reading the source for the various environment variables.
What is the recommended approach to set up such an isolated Apache httpd instance? Are there instructions or field reports that I have missed?
Rather than trying to rewrite configuration files, I suggest using a tool like Vagrant to create and provision a VM that runs your actual apache configuration. Running in a VM provides isolation (you can expose and remap TCP ports as needed) and it also gives you a development environment for interactive testing and debugging.
Instead of creating a temporary directory and modifying configuration files, you would run vagrant up as the first build step. With the right configuration, Vagrant will install whatever packages are needed and provision your apache configuration. Once the VM is up, you can run your tests.
It's easy to get started with Vagrant by walking through the Getting Started Guide to see if it's right for you.

How to configure apache to proxy requests

I want to add a javascript based chat system to my web app. I have read in many places that apache needs to forward(proxy) the requests to the xmpp chat server.
From what I have understood , I either need to add proxying support to apache server
OR use the jabberHTTPbind servelet.
I am trying the first thing. Add proxy support to apache. Now within Eclipse I am using Tomcat 7.0. I think this Tomcat comes with its own web server and is not using Apache. Is that true ?I am using Tomcat from http://tomcat.apache.org/download-70.cgi and added server in Eclipse by providing its extracted path.
I am not able to find any apache related folder structure eg(/etc/apache2/apache2.conf) within my Tomcat extracted directory.Also can't find httpd.conf anywhere .
Should I need to download apache separately and connect my tomcat to it.
I think adding proxy support to apache is required because javascript code won't be able to connect to any URL other than the current domain. so the question again is the same , where are all these apache2.conf and httpd.conf to add mod_proxy. and where can I do the virtual host mapping.
Any help to move ahead with be very much appreciated.
You need to install the Apache HTTPD server and enable reverse proxying. Read the doc on mod_proxy on how to do this. There are tons of resources on Stackoverflow as well; search for Apache reverse Proxy. The conf files you mention are part of the Apache HTTPD install.
javascript code won't be able to connect to any URL other than the current domain
That is generally true unless you enable CORS

Dual server deployment: PHP and Java

I need PHP for UI coding and I'll be making AJAX requests to a Java backend. I've never deployed two servers before. I'll need Apache for PHP and Tomcat for Java.
How can I do this?
You can run php through Tomcat as it is based on Apache. Here is a pretty simple tutorial to do so. http://nexus.zteo.com/2008/02/15/how-to-setup-php5-with-tomcat-5/
One possibility is to run a PHP interpreter written in Java directly in Tomcat and there is an open-source one called Quercus.
Well you can run both servers seperately but that would mean, that Tomcat will have to run on another port. You can also setup PHP with Tomcat as a CGI Script as already mentioned but I don't know if that'll offer the best performance.
In my experience the best way is to connect Tomcat with Apache is via mod_jk conenctor. You just have to tell Apache which pages to redirect to the Tomcat Server running behind it. Since you didn't give more information about your system environment I could only give you the link to the general documentation.