1

I have 1 server that is already taking up port 80 (a live site), and I have another server running wordpress mu that can ONLY run on port 80.

Is there a way with my router to transfer port 81 to look like it is port 80 to the wordpress install?

Jeremy Boyd
  • 586
  • 1
  • 9
  • 17

5 Answers5

1

Setting up a port forward should be simple. Are you using the stock firmware or something else else like ddwrt? The problem you may have is that the wordpressmu install may output absolute URLs. If it does, they will not include the correct port.

You could setup a HTTP proxy that you forward port 80 to. That proxy can then be configured to forward the request to the correct internal host based on the hostname. If your existing web site is already running apache, you could even just setup an additional virtual host there and enable the proxy.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
  • this is how i would do it. put a virtual host of livesite.com/wordpress that forwards that URL to port livesite.com:81. this also requires opening port 81 on the firewall because of the redirect. NOTE: there might be better ways that apache can handle the redirect on port 80 rather than 81 but i am not super experienced with it. – djangofan Jan 21 '10 at 18:37
  • Not only does MU use absolute urls... only port 80 will work with it. The MU site is dev, but we want to open it up to the client. I'm actually not sure if any of this is possible. I don't want to have to rent another server just to make this site accessible. – Jeremy Boyd Jan 21 '10 at 18:54
  • you never said what webserver you are using to host WordPress. if its apache, you can create a virtual host that makes liveserver:81 appear to be liveserver:80/wordpress to the client user. not only that but you can password protect it probably. – djangofan Jan 22 '10 at 01:02
  • ill enter a separate answer. – djangofan Jan 22 '10 at 01:04
0

Assuming that the request is coming externally through the router you can set it to forward the external port 81 to the IP and port 80 on your internal server.

Check the firewall setup and the add a port-forwarder.

It's here in the setup:

Applications and Gaming > Port Range Forward

From the manual:

To forward a port, enter the information on each line for the criteria required.

  • Application In this field, enter the name you wish to give the application. Each name can be up to 12 characters.

  • Start/End This is the port range. Enter the number that
    starts the port range in the Start
    column and the number that ends the
    range in the End column.

  • Protocol Select the protocol used for this application, either TCP or UDP, or Both.

  • IP Address For each application, enter the IP Address of the PC running the specific
    application.

  • Enable Select Enable to enable port forwarding for the relevant application.

Alex
  • 1,103
  • 6
  • 12
  • This will not work, as Both IPs need to use port 80 – Jeremy Boyd Jan 21 '10 at 18:51
  • So, really, you need two port 80's to be facing externally. For that you need something internally to handle the separation. You could have the router send all requests to one of the servers, and have that use host-headers and mod_rewrite to forward the requests on, either externally to the other server, or internally to the webserver on that host as required. I know apache can forward requests to another host, and would do it. – Alex Jan 21 '10 at 19:53
  • here I'm assuming on linux you're running Wordpress Mu on Apache... so, have all requests go to that, and forward as necessary to IIS. – Alex Jan 21 '10 at 19:54
0

The problem with the methods mentioned so far is that the solution is either more complicated than it needs to be (proxy, multiple port forwarding settings) or puts the burden on the client (alternate port). Why not run both sites on port 80 and use host headers to differentiate the two? This allows you to have a single port forwarding rule on your firewall (port 80), allows you to run multiple unique web sites internally, and allows your web site visitors to connect as they would with any other web site without having to specify the port number in their browser. I run 6 unique web sites on my home server this way.

This should work unless I'm misunderstanding your question.

joeqwerty
  • 108,377
  • 6
  • 80
  • 171
  • Two separate servers, one (192.168.1.12) is windows with iis 7 the other (192.168.1.13) is a linux server running Wordpress MU. Host headers wont work in this case. – Jeremy Boyd Jan 21 '10 at 18:50
  • Gotcha. I missed that in your question. Thanks for the clarification. – joeqwerty Jan 21 '10 at 19:25
0

I've never tried this but this should work without needing to restart the network adaptor nor taking down the live site for any reason:

Use an IP based virtual host approach: http://httpd.apache.org/docs/2.0/vhosts/ip-based.html

To make it work, bind your network card to 2 internal NAT IP addresses by adding the second IP in the network properties. Make Wordpress run on one of the IP addresses and the livesite run on the other IP address.... both on port 80. Then use your hosts file to send livesite.com to one IP and wordpresssite.com to the other IP address. Also, from the outside world make the domain resolve to the correct IP.

djangofan
  • 4,172
  • 10
  • 45
  • 59
0

I was able to overcome this using a reverse proxy in IIS, that works like mod_proxy and translates everything after the / to the internal site using the HOSTS file and mapping the domain to the internal IP. It is messy, but it works.

Jeremy Boyd
  • 586
  • 1
  • 9
  • 17