create redirect to different computer on network

27 posts / 0 new
Last post
#1 Tue, 05/12/2009 - 18:46
anwoke8204

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?

Tue, 05/12/2009 - 18:57
Joe
Joe's picture

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.

--

Check out the forum guidelines!

Thu, 05/14/2009 - 01:29 (Reply to #2)
anwoke8204

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

Thu, 05/14/2009 - 01:31 (Reply to #3)
Joe
Joe's picture

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

--

Check out the forum guidelines!

Tue, 05/12/2009 - 19:03
anwoke8204

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

Tue, 05/12/2009 - 19:09 (Reply to #5)
Joe
Joe's picture

Is there a question in there somewhere that I'm not seeing? :-)

--

Check out the forum guidelines!

Tue, 05/12/2009 - 19:19
anwoke8204

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.

Tue, 05/12/2009 - 19:23 (Reply to #7)
andreychek

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?
-Eric

Tue, 05/12/2009 - 19:30
anwoke8204

yes, when someone goes to crm.mydomain.com I need it to redirect to the other server on my network (which is ip 192.168.1.10:8024) is where it needs to re-direct to

Wed, 05/13/2009 - 05:46 (Reply to #9)
andreychek

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 :-)

If you select crm.mydomain.com 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: http://192.168.1.10:8024/$1

And then let's see how that does :-)
-Eric

Thu, 05/14/2009 - 00:27
anwoke8204

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

Thu, 05/14/2009 - 00:48 (Reply to #11)
Joe
Joe's picture

Define "didn't work".

--

Check out the forum guidelines!

Thu, 05/14/2009 - 01:40
anwoke8204

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.

Thu, 05/14/2009 - 02:02 (Reply to #13)
Joe
Joe's picture

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

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.

--

Check out the forum guidelines!

Thu, 05/14/2009 - 02:12
anwoke8204

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

Thu, 05/14/2009 - 23:27 (Reply to #15)
Joe
Joe's picture

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.

--

Check out the forum guidelines!

Thu, 05/14/2009 - 23:53
anwoke8204

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 http://192.168.1.10:8024 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 www.domainname.com:8024 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,
Andrew

Thu, 05/14/2009 - 23:59 (Reply to #17)
Joe
Joe's picture

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.)

--

Check out the forum guidelines!

Sun, 06/07/2009 - 07:54
anwoke8204

here is whats in the last 20 lines of the Access Log
[list}
216.152.208.1 - - [14/May/2009:01:44:11 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:01:48:27 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:02:30:29 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:02:57:53 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:02:59:06 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:03:19:41 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:04:21:01 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:04:33:34 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:04:34:10 -0600] "GET / HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; InfoPath.2; MS-RTC LM 8)"
216.152.208.1 - - [14/May/2009:05:29:11 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:05:36:34 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:05:59:16 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:20:58:00 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:22:31:08 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:23:15:13 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:23:17:29 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [15/May/2009:00:31:07 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [15/May/2009:01:25:18 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [15/May/2009:02:47:44 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [15/May/2009:02:47:55 -0600] "GET / HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; InfoPath.2; MS-RTC LM 8)"

[/list]

here is whats in the error log
[list]
[Tue May 12 22:52:48 2009] [error] [client 216.152.208.1] Directory index forbidden by Options directive: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/
[Tue May 12 23:15:59 2009] [error] [client 216.152.208.1] File does not exist: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/favicon.ico
[Wed May 13 00:19:35 2009] [error] [client 216.152.208.1] File does not exist: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/favicon.ico
[Wed May 13 00:58:13 2009] [error] [client 216.152.208.1] File does not exist: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/favicon.ico
[Wed May 13 01:40:08 2009] [error] [client 216.152.208.1] File does not exist: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/favicon.ico
[Wed May 13 02:40:53 2009] [error] [client 216.152.208.1] File does not exist: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/favicon.ico
[Wed May 13 03:04:26 2009] [error] [client 216.152.208.1] File does not exist: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/favicon.ico
[Wed May 13 05:53:30 2009] [error] [client 216.152.208.1] File does not exist: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/favicon.ico

[/list]

Sun, 06/07/2009 - 07:54
anwoke8204

here is whats in the last 20 lines of the Access Log
[list}
216.152.208.1 - - [14/May/2009:01:44:11 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:01:48:27 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:02:30:29 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:02:57:53 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:02:59:06 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:03:19:41 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:04:21:01 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:04:33:34 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:04:34:10 -0600] "GET / HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; InfoPath.2; MS-RTC LM 8)"
216.152.208.1 - - [14/May/2009:05:29:11 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:05:36:34 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:05:59:16 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:20:58:00 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:22:31:08 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:23:15:13 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [14/May/2009:23:17:29 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [15/May/2009:00:31:07 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [15/May/2009:01:25:18 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [15/May/2009:02:47:44 -0600] "GET /favicon.ico HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; GoogleToolbar 6.1.1518.856; Windows XP 5.1; MSIE 7.0.5730.13)"
216.152.208.1 - - [15/May/2009:02:47:55 -0600] "GET / HTTP/1.1" 302 417 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; InfoPath.2; MS-RTC LM 8)"

[/list]

here is whats in the error log
[list]
[Tue May 12 22:52:48 2009] [error] [client 216.152.208.1] Directory index forbidden by Options directive: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/
[Tue May 12 23:15:59 2009] [error] [client 216.152.208.1] File does not exist: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/favicon.ico
[Wed May 13 00:19:35 2009] [error] [client 216.152.208.1] File does not exist: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/favicon.ico
[Wed May 13 00:58:13 2009] [error] [client 216.152.208.1] File does not exist: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/favicon.ico
[Wed May 13 01:40:08 2009] [error] [client 216.152.208.1] File does not exist: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/favicon.ico
[Wed May 13 02:40:53 2009] [error] [client 216.152.208.1] File does not exist: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/favicon.ico
[Wed May 13 03:04:26 2009] [error] [client 216.152.208.1] File does not exist: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/favicon.ico
[Wed May 13 05:53:30 2009] [error] [client 216.152.208.1] File does not exist: /home/minutemen-it/domains/crm.minutemen-it.com/public_html/favicon.ico

[/list]

Fri, 05/15/2009 - 00:36
Joe
Joe's picture

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).

--

Check out the forum guidelines!

Fri, 05/15/2009 - 00:48
anwoke8204

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 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

any idea how I fix this?

Fri, 05/15/2009 - 00:57
anwoke8204

ok, I got it back up and running, checking logs now

Fri, 05/15/2009 - 01:01
anwoke8204

httpd.conf is completly blank, I have several others that are not though, could it be under a different file, such as apache2.conf?

Fri, 05/15/2009 - 01:26 (Reply to #24)
Joe
Joe's picture

Yes, it depends on the OS, which I don't recall being mentioned in this thread. On Debian and Ubuntu it is /etc/apache2/apache2.conf, and bits and pieces in modules-enabled and sites-enabled.

I've seen this initscript bug on Ubuntu, and maybe Debian. I have a hard time keeping up these days.

You'll have to kill apache2. The initscript is doing a soft reload when it should be doing a hard restart...which leaves Apache in a dead state (it's still running, but not accepting any new connections). So, it's the worst possible outcome: Nobody's home in the old process and the new process can't start because the old one has locked up the port.

--

Check out the forum guidelines!

Fri, 05/15/2009 - 02:13
anwoke8204

ok, I got it back up and running, I will look for those lines of code when I get home from work

Fri, 05/15/2009 - 03:20
anwoke8204

I found out, I think the issue is on my domain registrars side. I do not have 2 name servers up and running yet as I just have the one static ip address so I am using thier DNS servers for now till I can get more static ip addresses and on all 3 of my subdomains that are not working or redirecting to the proper address, i did a ping and they are gonig to a completly different ip address. I have contacted them about the issue so we can get it correct