redirect port 8080 to 80

I'd like to make Apache listen on ports 80 and 8080. The same content is to be served on both ports. I'm using Fedora Core 2. I tried setting up a virtual host but I'm getting Unable to connect to remote host. Can't access startfile http://localhost:8080/
fabiovhAsked:
Who is Participating?
 
ramazanyichConnect With a Mentor Commented:
or just
Listen 8080
0
 
ramazanyichCommented:
Add directive in main part of httpd.conf:
Listen *:8080
0
 
fabiovhAuthor Commented:
thanks, but now it's only locally accessible, if i try http://192.168.1.2:8080 it says the page cannot be displayed.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
ramazanyichCommented:
How your VirtualHost directives looks like ?
0
 
ramazanyichCommented:
Just try following
<VirtualHost 192.168.1.2:8080>
ServerAdmin your@email.address
DocumentRoot /your/document/root
ServerName 192.168.1.2
ErrorLog logs/error_log
TransferLog logs/access_log
</VirtualHost>
0
 
fabiovhAuthor Commented:
thanks ramazanyich, but it has to do with the firewall, if I "service iptables stop" it works.
0
 
mrielfConnect With a Mentor Commented:
iptables -t nat -A PREROUTING -p tcp --dport 8080 -j REDIRECT --to-port 80
0
 
ramazanyichCommented:
but without sugested Directive Apache will not listen on port 8080.
I think I deserved ny points :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.