?
Solved

How to hide port 8080?

Posted on 2004-09-20
8
Medium Priority
?
7,646 Views
Last Modified: 2012-08-13
I have apache2.050 and tomcat 5.5.  Apache uses port 80 and tomcat 8080.  Is there a way to hide port 8080?

Or can I map www.mysite.com:8080/mywebapp/  map to
www.mysite.com/mywebapp/ ?

Thanks
0
Comment
Question by:rdong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 15

Expert Comment

by:samri
ID: 12110429
hi rdong,

technically, you could not hide port 8080 as it would be used by tomcat.  By default apache would bind to port 80, and tomcat would be using port 8080.  However, if you wish, you could configure your apache in such a way that it would accept request, then will redirect/proxied/rewite to the tomcat.

the quickest way to do is by using redirect, where you could use

Redirect /mywebapp http://www.mysite.com:8080/mywebapp/

(

Redirect would cause the URL location to change -- which the user would see the URL on the location bar to change to http://www.mysite.com:8080/mywebapp/

Next, you could use mod_rewrite and/or mod_proxy to use ReverseProxy mode to achive your goal:

PAQ: http://www.experts-exchange.com/Web/Web_Servers/Apache/Q_20319838.html
http://www.experts-exchange.com/Web/Web_Servers/Apache/Q_20319552.html
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12110941
You can make redirection from apache httpd to tomcat using mod_jk
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk/aphowto.html
use only ajp connector and disable http connector on tomcat
0
 

Author Comment

by:rdong
ID: 12119097
Thank both for your response.  I want to try ramazanyich's suggestion first.

Apache is pretty new to me, so please bear with me...

I use windows xp.

I have tried to configure http.conf without success.

1. How to add  jk2 module to http.conf?
2. The document says to add this line to http.conf
Include /var/tomcat3/conf/jk/mod_jk.conf-aut

Then I actually add this line to http.conf:

Include C:/Program Files/Apache Software Foundation/Tomcat 5.5/conf/jk/mod_jk.conf-auto
I got an error when I restart apache:

"
Include takes one argument, Name of the config file to be included
Note the errors or messages above, and press the <ESC> key to exit."

3. Where do I put workers.properties file.  How to configure it?

Is that possible you can give me step by step?

Thanks you very much



 

0
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
LVL 19

Expert Comment

by:ramazanyich
ID: 12121491
Download mod_jk from apache site: http://apache.belnet.be/jakarta/tomcat-connectors/jk/binaries/win32/
copy mod_jk.dll into modules directory of you apache server.
Modify httpd.conf:
--------
LoadModule modules/mod_jk.dll
AddModule mod_jk.c
JkWorkersFile conf/workers.properties
JkLogFile log/mod_jk.log
JkMount /*.jsp worker1
----------

The 'JkMount' tells mod_jk to forward all requests for
JSP's  to the worker named worker1.

Create file workers.properties in conf directory of your Apache server:
---
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=127.0.0.1
worker.worker1.port=9009
worker.worker1.lbfactor=1
worker.worker1.local_worker=1
------

in your tomcat server.xml find <Connector> element with attribute which has Ajp13Connector inits value.
check the port attribute of that element and modify its value to 9009
Restart both tomcat and apache.


0
 

Author Comment

by:rdong
ID: 12129820
Thanks for your help.

I got stuck here.

1. I followed your steps but when I started apache server it complained:

"LoadModule takes two arguments, a module name and the name of a shared object fi
le to load it from"

So I gave it a name jk_module. So the first line becomes
LoadModule jk_module modules/mod_jk.dll
I found that other module names are not working, how do you get the module name in the first place?

2. After the above being taked cared of, I got another error when restarting apache:

"Invalid command 'AddModule', perhaps mis-spelled or defined by a module not included in the server configuration"

What is mod_jk.c? How do you include it in the server configuration?

Could not go further, please shed some light on this. Also I am wondering, if everything works fine,
www.mysite.com/mywebapp/ will be pointing to www.mysite.com:8080/mywebapp?



0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12130590
remove AddModule line.
It is not necessary if LoadModule already exists.
AddModule directive used to load modules in some order if necessary.
0
 

Author Comment

by:rdong
ID: 12139257
Thanks,

I got both apache and tomcat restarted successfully. However can you tell me how can I map localhost:8080/mywebapp
to
localhost/mywebapp?

this is my workers.properties file
===========================
port=9009
host=127.0.0.1

# define the worker
[ajp13:localhost:9009]
channel=channel.socket:localhost:9009
group=lb
#
#[uri:/mywebapp/*]

group=lb

[status:]
info=Status worker, displays runtime information

[uri:/jkstatus/*]
info=The Tomcat /jkstatus handler
group=status:

worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=127.0.0.1
worker.worker1.port=9009
worker.worker1.lbfactor=1
worker.worker1.local_worker=1
========================

This is server.xml in tomcat
=====================
................
  <Connector port="9009"
               enableLookups="false" redirectPort="8443" debug="0"
               protocol="AJP/1.3" />
........
========================

do I need to change anything in jk2.properties in tomcat?

Thanks so much
0
 
LVL 19

Accepted Solution

by:
ramazanyich earned 200 total points
ID: 12141018
add to your httpd.conf:
JkMount /mywebapp/* worker1
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question