• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about portforwarding and tomcat

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, Our app would be running on a Linux server. Most probably, no one wants to view their domain as mydomain.com:8080, so we set port forwards to port 80 so every request that comes through it forwards to port 8080, is this correct? My app is accessed by invoking myipaddress:8080/myappname, if the visitors to my site would just type mydomainname.com, how do I make sure that it points correctly to my app? Thanks!
 
Naseem Khan
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you can do the same thing in Tomcat itself.

Change your port number to 80 from 8080 form server.xml of tomcat, then you don't require any port number.

Naseem
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, but on the Linux environment you have to be running as root. I need to be running as a non-root account. And even on windows, you still have to be invoking http://mydomain.com:8080/myapp which is ugly. I want it to be just http://mydomain.com.


I'm also running apache web server which is in port 80, thank you
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you're doing is fine.

Some other alternatives:
  • Use a connector to have Apache HTTPD forward requests to Tomcat (More hassle than it's worth to me).
  • Use the jakarta/commons/daemon to bind to port 80 as root and then downgrade itself to a lesser user for running Tomcat (the same way Apache HTTPD works).
  • Set up an iptables rule that to do port re-direction at a kernel level.

  •  
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic