create redirect to different computer on network

Hi, I have a web application I am using that has to be ran on Microsoft IIS webserver, is tehre a way i can create a redirect so when we go to that address it will redirect from my virtualmin servers to the other server?

Proxying rules are easy to setup (Server Configuration->Edit Proxy Website, or if you just have a specific path where the app lives while everything else on the site is local, you could use Proxy Paths). Redirects…I know they’re in there somewhere, but I’m not seeing immediately where.

The Services->Configure Website module has a section for redirects, but it can be intimidating (it pretty much covers all of Apache’s very powerful alias and redirect features).

I seem to recall that when you create a virtual server you can also choose to make it a frame-forwarded or redirected site. But the configuration of that depends on the Server Template.

I am not sure how to set up the proxy paths, up till now I was planning on going linux all the way for my servers, but then we found this program and it has all the features we need in a customer management system. so we need to figure out how to get the re-directs working

Is there a question in there somewhere that I’m not seeing? :slight_smile:

well there wasn’t a question in there, but here is the question, what is the easiest way to do the re-direct I have tried redirect part of apache and it comes back as invalid ip address (probably due to the port), but I will look into other options to see if we can get this going.

So just to make sure I understand what you’re after – what you’re saying is that any user going to a particular domain being hosted on your Virtualmin server, you wish to be able to redirect them to a new URL that’s hosted at a remote server?

yes, when someone goes to I need it to redirect to the other server on my network (which is ip is where it needs to re-direct to

Okay, I’ll go over how to do a redirect. This is a redirect, rather than a proxy. Since the IP you’re redirecting to is internal, a redirect in this case assumes that the person connecting is on the same LAN, or otherwise can see the IIS server.

I find the Redirects screen in VM confusing to no end, and I’ve been begging for an overhaul on it. It’ll happen, though it hasn’t happened yet, so you’ll have to bear with me guessing a bit :slight_smile:

If you select from the drop-down on the top-left, and go into Services -> Configure Website -> Aliases and Redirects, try adding the following to "Regexp URL redirects" –

  1. Set "From" to: /(.*)
  2. Leave "Status" Blank
  3. Set "To" to:$1

And then let’s see how that does :slight_smile:

I tried that, it didn’t work. any other ideas?

Define “didn’t work”.

I get "page can not be displayed" error when trying to go to the url

But when you hit it directly (exactly as you entered it into the redirect field) it works?

it does so long as I have access to my internal network, but if I am not at the office I can’t access it as i don’t have access to the internal network. I need to find a way I can access it when I am away so when I am at a clients office or house I can log the details of the problem.

Then obviously a redirect is not the right solution to this problem. You want proxying, as I suggested in my first message. :wink:

A redirect tells the browser, "go over there". It does not accept the request on behalf of the other server. Proxying allows the Virtualmin server to accept the request, and then pass it on to the other server, and then relay the response back to the client.

ok, what is the best way to set up the proxy

As I mentioned, browse to Server Configuration->Edit Proxy Website, and fill out the form.

Set “Proxying Enabled?” to Yes, and “Proxy to URL” to the destination server URL (no variables or anything required…just the URL you’d use on a local PC to access the site). Assuming the Virtualmin server has network access to that destination, it will proxy requests on its behalf.

I have set proxying to enabled, and set up under Request to pass to another proxy, I have set it to all, then forward to which is the correct ip address but I am still getting page can’t be displayed. The virtualmin server has local network access to that ip address. if I go to I get the site it is supposed to go, so I know it is up and running on the other system. however the proxy doesn’t seem to want to pass the information. any ideas?

Many thanks,

Any errors in the error_log for that virtual server? If not, what’s in the access_log? (You can see these in the Logs and Reports menu.)

This kinda looks like no proxying is happening.

What does the relevant VirtualHost section in httpd.conf look like? (e.g. find the VirtualHost domain.tld:80 section, and copy paste that section here…it’ll be 15 to 30 lines long and will end with /VirtualHost).

Maybe the proxy module isn’t loaded in your Apache…I think we’d see some errors on startup thought. You could try restarting httpd and watching the system error_log (/var/log/httpd/error_log).

I restarted apache and now it wont’ start, I am getting the following error:

  • Starting web server apache2 (
    98)Address already in use: make_sock: could not bind to address
    no listening sockets available, shutting down
    Unable to open logs

any idea how I fix this?