Need to set proxy server for apache tomcat in RHEL 7.3 - apache

I have 3 machines with ips 10...56,10...57 and 10...58. How do I connect all of them using a proxy via tomcat8.
Till now I have made a new file setenv.sh in tomcat8/bin/ folder and wrote the below lines. But it doesn't seem to work.
export JAVA_OPTS="$JAVA_OPTS Dhttp.proxyHost=10...56|10...57|10...58 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=10...56|10...57|10...58 -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=localhost"
Let me know if I am following the right process or I need to modify any other file too.

Below link helps you in setting up the proxy with multiple
http://w3devops.com/add-http-https-proxy-http-non-proxy-jenkins-via-tomcat-server/
However, I think tomcat is not the best option to do the HTTP\HTTPS Proxy.
please feel free to experiment with apache or ngnix.
Apache
https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension
NGNIX
https://www.digitalocean.com/community/tutorials/understanding-nginx-http-proxying-load-balancing-buffering-and-caching
It may help you one day :)

Related

Apache Axis2 execution not working. I have Apache 24 http server as well

I am totally new in this and trying to learn API testing so as per instructions from 2 different courses 1. I have apache 24 http server along with SQL and PHP and that works with local:8080
2. I have installed Apache axis 2, have configured the environment path and followed the instructions but http://localhost:8080/axis2/services does not work.
When I execute the bat file axis2server.bat, I get the following message
C:\Data\Apps\Apache_axis2\axis2-1.8.2\bin>axis2server.bat
Using JAVA_HOME C:\Program Files\Java\jdk-19
Using AXIS2_HOME C:\Data\Apps\Apache\axis2-1.8.2-bin\axis2-1.8.2
but the http://localhost:8080/axis2/services does not work with site cannot be reached.
b. changed the ports in the conf axis2.xml from 8080 8006 still not working.
c. I have stopped Apache24 from services and tried in vain (with same 8080 and changing port).
I have installed all this again still could not get this work. your help would be appreciated.
I searched for the past post, i found one with apache tomcat copying folder in webapp.
Your help would be appreciated.

websphere and apache server proxy and rewrite configuration

There are javaEE applications run on WebSphere server.
The thing I wanna do that to configure a http server that takes the request and redirect to my local websphere server.
For example:
This is live Project testProject.com/Otel..
I wanna reach my local project when I insert local.testProject.com/Otel..
The thing I have done so far I can reach my local apache server when I click local.testProject.com just with adding in host file in windows/system32/drivre/etc directory.
The thing I could not do so far. redirecting this incoming request to my apache server to websphere server.
Could you please help me on these. Dont hasitate to ask further questions.
I would be appreciated if you could give me some ideas with just commenting at least.
Good days..
IBM provides a specialty reverse proxy module for Apache called the WebSphere WebServer Plug-in. Its use is described in detail in the websphere documentation.
In simple configurations, you can just configure any server you already have as a reverse proxy.
Load mod_proxy and mod_proxy_http (varies depending on Apache distribution)
Append to your virtual host:
ProxyPreserveHost ON
ProxyPass /otel http://washostname.example.com/otel
# ProxyPassReverse likely not required in your case.
Of course there are thousands of places to read about setting up Apache as a reverse proxy and there are nearly no WebSphere specifics.

Configure Apache as a Reverse Proxy To Point Tomcat On GoDaddy VPS

I need to setup reverse proxy on godaddy vps (Cent OS, Apache 2.4) to transfer request from Apache port 80 to my Java application running on tomcat 7.
I have come across a various answers but nothing works. Even on godaddy site they provide some way to configure the reverse proxy but its not work.
Please provide me some help or point me in right direction.
Following are the sites that i already try
GoDaddy VPS its official GoDaddy help page but unfortunately didn't work another site Xampp Virtual Host and Proxy Baypass. I try other solutions like changing Tomcat port to 80 its work but i dont want to do that. I also change .htaccess configuration but unable to access Apache.
Kindly please help.

Apache Server - Change port from 8080 to 80

I have recently bought Amazon EC2 server.
Instead of installing it trough command line, I downloaded the latest zip file and deployed my application in WebApps folder.
The problem is tomcat is listening all the requests on port 8080 instead of 80.
I have tried changing the server.xml file in conf folder but no help!!
It is still listening to port 8080.
How do I make it listen to port 80
Oddly enough, Tomcat has its own documentation about doing this:
http://wiki.apache.org/tomcat/HowTo#How_to_run_Tomcat_without_root_privileges.3F
Probably the most straightforward way on *NIX is to use jsvc which is a small utility that works by binding to a port, dropping privileges, and then launching Tomcat, which can then use lower-numbered ports.
There are a bunch of other ways, but jsvc is the easiest and offers some other benefits as well. Discovering those benefits is left as an exercise for the reader.
The following would apply toward various systems, while the second link would related toward windows based systems.
First link :http://www.klawitter.de/tomcat80.html
Second link:
http://javarevisited.blogspot.com/2011/12/how-to-change-tomcat-default-port-8080.html?m=1
Ok. So finally I figured out way to solve this problem.
First of all i was doing it wrong way. One should not open port 80 for tomcat7. Tomcat7 should always run port 8080 or anything which is greater than 1024.
So to make your web site work without port. Follow below steps.
Install Apache2. (By default it runs on port 80).
Go to localhost and make sure apache2 is installed properly.
Then you will have to redirect all the requests which are going on port to redirect to port 8080.
To do that follow below link. (this is important step)
https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension
Hope this answer helps!!!
Thanks
Fahad Mullaji
I wouldn't recommend doing that, for what it is worth...
That could work in theory, but you are literally using httpd as a proxy to forward every request. There isn't much of a reason, IMHO, to choose this over simply changing the port to 80 in the Tomcat configuration and ditching httpd. You can use port 80 for Tomcat but historically, in production environments, httpd is generally used to serve static assets and such and dynamic content would be served by Tomcat. Generally one would install mod_jk and use the jkMount directive to connect Tomcat to httpd via AJP, which is a lot faster being a binary protocol than using HTTP.
There used to be a much bigger difference in terms of performance, here.
Tomcat is able to serve static resources via its DefaultServlet pretty well these days.
For AJP setup, see the documentation here:
https://tomcat.apache.org/tomcat-4.0-doc/config/ajp.html

mod_proxy with apache tomcat, how do I set it up?

I have my app that serves on localhost:8080. I want to configure things so that it just servers on localhost:80 (or localhost without the port specified). I was told to follow these instructions.
My apache-tomcat that I downloaded is located at /home/myusername/tools/appname/apache-tomcat-6.0.33
I can't find an httpd.conf file in that dir... so I can't make the changes that the above article mentions. I am not sure what to do. I am new to apache/tomcat. Any help would be great!
Those instructions are for apache, which is different from apache's tomcat. What you have (the 6.0.33 thing) is apache's tomcat, which hosts/runs webapps but isn't typically used as a general webserver. You need to download and install apache, then you'll be able to follow those instructions.
You can download the apache webserver here: http://httpd.apache.org/download.cgi
Or if you are using an OS with a package manager, use your OS'es package manager instead.
Typically, the httpd.conf file should be at /etc/apache2/httpd.conf (or /etc/apache/httpd.conf).