LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-28-2003, 01:40 AM   #1
TSynergy
Member
 
Registered: Aug 2003
Location: Georgia U.S.A.
Posts: 101

Rep: Reputation: 16
Lightbulb What command changes port 8080 to 80?


Hi

What is the RedHat Linux command that changes from port 8080 to port 80? I'm using Tomcat 4.1.27. This is my own desktop computer so I'm the root administrator.

Tina
 
Old 08-28-2003, 08:33 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
There is no command that makes Tomcat listen to different ports. If I'm reading the Tomcat documentation correctly, you'll have to change the port in Tomcat's server.xml file.
 
Old 08-28-2003, 05:51 PM   #3
TSynergy
Member
 
Registered: Aug 2003
Location: Georgia U.S.A.
Posts: 101

Original Poster
Rep: Reputation: 16
Thank you. Obviously I've asked the wrong question. How do I change the port in Tomca'ts server.xml file?

Tina
 
Old 08-29-2003, 08:14 AM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
Just open up server.xml in your favorite text editor, find the section that sets the port, change it from 8080 to 80, save and your done. You may have to be root or su to make the changes.

And I would strongly suggest reading some of the documentation on the Tomcat site. That way you'll have a better idea of what to look for once you have the file open.
 
Old 09-17-2003, 06:18 AM   #5
davee
Member
 
Registered: Oct 2002
Location: Ayrshire, Scotland
Distribution: Suse(home) RHEL (Work)
Posts: 263

Rep: Reputation: 30
Although you can change to port from 8080 to 80 in server.xml, you should think about doing this via an iptables redirection to avoid a security issue with giving straight access to port 80 (or any port less than 1024)

As root, type these three commands:
iptables -t nat -A OUTPUT -d localhost -p tcp --dport 80 -j REDIRECT --to-ports 8080
iptables -t nat -A OUTPUT -d xxx.xxx.xxx.xxx -p tcp --dport 80 -j REDIRECT --to-ports 8080
iptables -t nat -A PREROUTING -d xxx.xxx.xxx.xxx -p tcp --dport 80 -j REDIRECT --to-ports 8080

...where xxx.xxx.xxx.xxx is your ip address (or DNS name).

Additionally, for ssl (8443 --> 443):
iptables -t nat -A OUTPUT -d localhost -p tcp --dport 443 -j REDIRECT --to-ports 8443
iptables -t nat -A OUTPUT -d xxx.xxx.xxx.xxx -p tcp --dport 443 -j REDIRECT --to-ports 8443
iptables -t nat -A PREROUTING -d xxx.xxx.xxx.xxx -p tcp --dport 443 -j REDIRECT --to-ports 8443

Hope this is of some use.

Dave
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Port 80-->8080?? flamesrock Linux - Software 4 08-01-2004 02:40 AM
problem in IM with the 8080 port dred Linux - Networking 0 06-06-2004 04:21 AM
Port 8080 access kinchj Linux - Security 6 01-06-2004 11:38 AM
firewall.rc.config says :"open port 8080" but nmap says port is closed saavik Linux - Security 2 02-14-2002 01:16 PM
HTTP on port 8080 cauchy Linux - Networking 3 08-09-2001 08:29 PM


All times are GMT -5. The time now is 12:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration