Jump to content

Recommended Posts

Posted

Hi all, hope someone is daft enough to be viewing these forums today!

 

We have an Apache webserver sat on an Ubuntu machine, it's happily dishing out our website, Moodle, Intranet.

The school wants me to test the 'Insight' SIMS interface software, this needs to run on an IIS webserver

 

I've set up Insight and it works (locally) to make it available from our website I've set up a reverse proxy on Apache. The reverse proxy points to Insight and also a test website that contains one basic HTML page.

 

When I test the test website, it works fine which means my reverse proxy is set up correctly (mod_proxy enabled etc) However it falls over when I try to access the Insight bit.

 

What happens is the request from Apache to IIS for the Insight homepage (Secure.aspx) goes through correctly - this should return a login page... instead, whatever is passed back to Apache seems to cause it to look for a page internally and it throws a 404 error

 

'The requested URL /secure.aspx was not found on this server'

 

I'm presuming the problem is something to do with aspx but I really don't have a clue!

 

Can anyone point me in the right direction? I've been searching Google but I'm going nowhere fast

 

Cheers... and Happy New Year!

Posted

Oh yeah... just so you know...

 

It's IIS 6 with ASP.NET 4

 

I've set the ports up for the test website & Insight - I'm not using port 80

 

Oh yeah... just so you know...

 

It's IIS 6 with ASP.NET 4

 

I've set the ports up for the test website & Insight - I'm not using port 80

Posted

Ah, I may have an idea of what's going on... hopefully someone who knows a bit more than me can confirm if I'm on the right track...

 

My test website is in a folder called TestRP, my reverse proxy pushes all traffic with the url http://mywebsite.com/TestRP through to this site on IIS6. This works, when I type http://mywebsite.com/TestRP in my browser it displays the TestRP test page and the url displayed in the browser remains http://mywebsite.com/TestRP

 

My Insight website should work exactly the same but it falls over. When I type http://mywebsite.com/insight into my browser, I'm routed through to IIS6 correctly but the aspx page that it opens, returns a url that doesn't explicitly reference the folder (called insight) that it's sitting in. This url is passed to Apache that can no longer reverse proxy it and instead throws a 404 page not found error

 

this is what is displayed in the address bar : http://mywebsite.com/secure.aspx?ReturnUrl=%2f

 

And the page displayed tells me

 

Not Found : The requested URL /secure.aspx was not found on this server.

 

OK folks, can anyone tell me if:

 

A) I'm on the right track with this and...

B) How to resolve the issue... without digging into someones ASP code!

 

Cheers... and Happy New Year!

Posted

Don't know because I've never looked at mod_proxy before so this is a guess.

 

I think your httpd.conf might need to read like the following:

 

ProxyRequests Off
ProxyPreserveHost On

Order deny,allow
Allow from all


ProxyPass /insight/ http://iiserver:123/INSIGHT/
ProxyPassReverse /insight/ http://iiserver:123/INSIGHT/

ProxyPass /TestRP/ http://iiserver:124/TestRP/
ProxyPassReverse /TestRP/ http://iiserver:124/TestRP/


Order allow,deny
Allow from all

 

a trailing / on the url that you are proxying. Presumably what is happening is you are navigating to mywebsite.com/insight and it apache is seeing it as the root, so when the url is returned, it then looks for the url on the local apache server rather then proxying it.

 

Could be completely off though (as I say, I've never used it).

Posted

Ah, perhaps the issue is that links are not being re-written in the HTML, try adding this directive:

 

ProxyHTMLURLMap http://iisserver:123/INSIGHT /insight

 

It's been ages since I've had to do this, I have an example on of the servers at work somewhere, will try to dig it out tomorrow.

Posted
Oh, and you probably need this:

 

ProxyHTMLEnable On

 

Thanks! I've just tried adding the trailing '/' and that didn't make any difference, I'll try the ProxyHTMLEnable tomorrow when I get into work. I don't have a great deal of experience with web servers but I can't help thinking the problem is with the ASPX code... Instead of opening a page directly, it's chucking a URL back at the proxy that doesn't contain the '/insight/' part so the Apache server thinks it's a local page that it can't find... hopefully I'll be proved wrong tomorrow!

 

Cheers for all your help, much appreciated.

Posted

Generally, with RProxies it is best to do something like testrp.mydomain.com and insight.mydomain.com - rather than use subfolders, as this removes the need for a lot of rewriting or for the aspx to "understand" it is being proxied (the webservers can happily have a domain a piece) and then you use the rproxy to share 2 domains on one IP and the same port.

 

Does that make sense?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...