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 : http://www.bobcat.pro, the site doesn't work. If I go on http://www.bobcat.pro:8008 ... it doesn't work.

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

doesn't work

works

Question : How can I tell "http://www.bobcat.pro -> http://www.bobcat.pro:8008?

With rule nat? (iptables?)

Sincerely

link|improve this question

75% accept rate
I can't help you on how to fix it, but this is entirely expected. mysite.com is simply shorthand for www.mysite.com:80. 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
feedback

1 Answer

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

link|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
feedback

Your Answer

 
or
required, but never shown

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