Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
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
add comment

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

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
add comment

Your Answer

 
discard

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.