Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sorry the title, but I don't know how to name this question.

I'm on a dedicated server on ubuntu 11.04. It runs with plesk 10.3. I change the listen port of apache 80 -> 8008

When I go into my domain :, the site doesn't work. If I go on ... it doesn't work.

If I take a file like an image, or a script like :

doesn't work


Question : How can I tell " ->

With rule nat? (iptables?)


share|improve this question
I can't help you on how to fix it, but this is entirely expected. is simply shorthand for Why? Because, port 80 is the standard HTTP port that all browsers in the world will look at. Why would you want to change your port from that? – Dan Nov 25 '11 at 14:14
Because I need to install Varnish, an http accelerator. – Raphaël Nov 25 '11 at 14:15
Fair enough - that bit's beyond me! – Dan Nov 25 '11 at 14:33
up vote 3 down vote accepted

You need to run:

iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

This will redirect everything on 80 to 8080

share|improve this answer
+1 but -I may be better. – Iain Nov 25 '11 at 15:02
Thank you very much =) – Raphaël Nov 28 '11 at 14:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.