forwarding an application having port id 8080 to 80 using httpd.conf
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
forwarding an application having port id 8080 to 80 using httpd.conf
Hi all,
I am a network/system Administrator in an avg. based company, we are using Cent Os as servers. We are developing applications in both php & java, for java we are using apache tomcat as server (port number 8080) & for php we are using apache as server (port 80). Php applications are uploaded in the server and giving the link to our clients like localhost.com/chrome. Now we are planning to give the java based application for testing purpose to clients & can give the application link to client as localhost.com:8080/mozilla. Is it is possible to change the link localhost.com:8080/mozilla to localhost.com/mozilla with out changing the portnumber of apache tomcat server & without interrupting the php applications, that means our clients can access php application as localhost.com/chrome & java application as localhost.com/mozilla in the same server at the same time
No. If apache is already listening on port 80, you can not run tomcat on the same port. There will be conflict between the two. Port redirection is possible but not in this case where two application will listen on the same port.
No. If apache is already listening on port 80, you can not run tomcat on the same port. There will be conflict between the two. Port redirection is possible but not in this case where two application will listen on the same port.
Actually i heared that we can forward the request which is coming to port 80 (incomming request) to port 8080 using httpd.conf
But apache is not serving jsp pages. Apache is serving php pages and tomcat is serving jsp. Two different applications on same port for different functions? They would collide.
Actually i heared that we can forward the request which is coming to port 80 (incomming request) to port 8080 using httpd.conf
You can configure apache to use what ever port you want to. But if a port is already occupied by another application, tomcat here, how will apcahe listen on it? And because apache is serving php pages, you can not use mod_jk like the bathory said. Either of two will listen on 8080 not both.
You can configure apache to use what ever port you want to. But if a port is already occupied by another application, tomcat here, how will apcahe listen on it? And because apache is serving php pages, you can not use mod_jk like the bathory said. Either of two will listen on 8080 not both.
You are wrong.
Apache listens on its own port (80) and tomcat on its own (8080). When a request for a jsp page comes to apache, it passes the request to tomcat, tomcat does the job, returns the resultsto apache and apache display them on a web page.
You can read the mod_jk documentation for details.
Also serving php pages is not a problem at all. Apache can serve both .php and .jsp pages just fine using the respective modules.
@OP
There is also mod_proxy that can be used in your case, so it make apache work as a reverse proxy for tomcat, but it's a bit slower that mod_jk. If mod_proxy is already installed in your Centos box, you can try to use this instead of mod_jk to do what you want
There are lots of tutorials about configuring apache with mod_jk. IMHO this is the most comprehensive, but it's written for debian. Or you can use this that is written specifically for Centos.
Since you have already a working apache and tomcat, you can focus on mod_jk apache configuration. Just note that in your case you have to use:
Code:
JkMount /mozilla/* ajp13
so anything under the URI /mozilla will be served by the specified worker (ajp13 in this case)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.