Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3368
  • Last Modified:

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/
0
fabiovh
Asked:
fabiovh
  • 5
  • 2
2 Solutions
 
ramazanyichCommented:
Add directive in main part of httpd.conf:
Listen *:8080
0
 
ramazanyichCommented:
or just
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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
 
mrielfCommented:
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now