LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-28-2009, 01:15 PM   #1
remo123
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
not able to acces domain without port name


Hi,

I am not able to access my domain without port number.
Eg.its running like http://www.example.com:9080 where as i wnat it to work without port number. i.e www.example.com
my tomcat is running on 9080 . i have hosted my application on godaddy's linux virtual dedicated server.
my server.xml is something like this
<Connector connectionTimeout="20000" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" port="9080" redirectPort="9443"/>
<Connector port="8009" protocol="AJP/1.3"/>
<Engine defaultHost="example" name="Catalina">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
<Host appBase="/home/admin/webapps" name="example">
<Alias>www.example.com</Alias>
</Host>

kindly help me.

Last edited by remo123; 07-28-2009 at 01:22 PM. Reason: to add extra info
 
Old 07-28-2009, 01:38 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well you need to be running something on port 80 if you want to access it on port 80. You could either make tomcat listen directly, configure a normal web server like apache to listen and send a 302 redirect to get that jump up to 9080 done, or redirect with iptables:
Code:
$IPTABLES -t nat -A PREROUTING -p tcp -d $EXTIP --dport 80 -j REDIRECT --to-port 9080
 
Old 07-29-2009, 02:53 AM   #3
remo123
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
well you need to be running something on port 80 if you want to access it on port 80. You could either make tomcat listen directly, configure a normal web server like apache to listen and send a 302 redirect to get that jump up to 9080 done, or redirect with iptables:
Code:
$IPTABLES -t nat -A PREROUTING -p tcp -d $EXTIP --dport 80 -j REDIRECT --to-port 9080
ya. thanks. that made sense. but i m very new to all of these. could u pls tel me where do need to run that IPTABLES command?
 
Old 07-29-2009, 04:29 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
It, or a version of it, would go in our firewall startup script, but as you've not said what distro you're using I can't say what that would be. /etc/sysconfig/iptables or a redhat variant.
 
Old 07-29-2009, 08:59 AM   #5
nowonmai
Member
 
Registered: Jun 2003
Posts: 481

Rep: Reputation: 48
With Tomcat, the standard way of achieving this is to run apache webserver on the box, and proxy tomcat using the Tomcat JK Connector.
 
Old 07-30-2009, 12:09 AM   #6
remo123
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
iptables -t nat -A PREROUTING -d your hostname -p tcp --dport 80 -j REDIRECT --to-ports 9080

wen i run the above command i m getting following error!

WARNING: /etc/modprobe.d line 1: ignoring bad line starting with 'á-@'
FATAL: Could not load /lib/modules/2.6.18-028stab059.6/modules.dep: No such file or directory
iptables v1.3.8: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

Could u plz guide me in detail how to upgrade iptables version as i m very new to linux.
my current iptables version is : iptables v1.3.8 and kernel version is
2.6.18-028stab059.6
 
Old 07-30-2009, 05:14 AM   #7
nowonmai
Member
 
Registered: Jun 2003
Posts: 481

Rep: Reputation: 48
Using iptables to do dumb packet redirection is NOT the correct way to proceed in this matter.
You need to set up Apache2 using mod_jk to handle the communication between Apache and Tomcat.

A simple tutorial here... http://www.howtoforge.com/apache2_tomcat5_mod_jk
 
Old 07-30-2009, 05:18 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Yeah I forgot about the connector, generally a much better solution.
 
Old 08-10-2009, 11:40 AM   #9
remo123
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
Yeah I forgot about the connector, generally a much better solution.
Hi
I m using mod jk connector to configure tomcat with apache. But able to access only my static files whenever i access my domain.

I am getting following error in mod_jk.log

[Sat Aug 08 23:42:24 2009][3289:3079326032] [error] uri_worker_map_ext::jk_uri_worker_map.c (505): Could not find worker with name 'wlb' in uri map post processing.


my workers.properties is something like this.

workers.tomcat_home=/usr/java/tomcat-5.5
workers.java_home=/usr/java/jdk
ps=/
worker.list=ajp13w
worker.ajp13w.type=ajp13
worker.ajp13w.host=localhost
worker.ajp13w.port=8009
worker.ajp13w.lbfactor=1

here ajp3w as worker name but from where i m getting that wlb
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Directing a domain to a port? Zeno McDohl Linux - Server 1 12-09-2008 03:03 PM
Domain-based Port Forwarding? cparker15 Linux - Networking 5 05-27-2007 01:59 PM
DNS (domain) unable to acces from LAN fritz001 Linux - Networking 4 10-14-2006 03:14 PM
Domain Problems (port 8000) Ian_Hawdon Linux - Networking 2 12-25-2005 11:49 AM
udp port domain unreachable mohamed_linux Linux - Networking 10 08-21-2002 08:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration