Koozali.org: home of the SME Server

Proxypass redirect to .Net server not working

Offline Thomas

  • ***
  • 65
  • +0/-0
Proxypass redirect to .Net server not working
« on: December 18, 2004, 06:22:45 AM »
I have SME 6.01 setup and I installed the Proxypass contrib.  What I want to do is redirect requests to www.mywebsite.com/win2k to a Windows 2000 server running a .net web based application.  I made a URL Proxypass entry for my Win2k box but when you try to access www.mywebsite.com/win2k the browser times out.  Can this be done and what am I doing wrong?

Thanks,
thomas

Inq

Proxypass redirect to .Net server not working
« Reply #1 on: January 06, 2005, 12:10:59 PM »
Dude I've been hangin over this problem also, along with another thread http://forums.contribs.org/index.php?topic=25160.0

I've yet to see a working solution.

I got my proxypass to work by adding

Code: [Select]
ProxyPass /othersite/ http://otherserver/
<Location>
 order deny,allow
 deny from all
 allow from all
</location>


to a httpd.conf template in /etc/e-smith/template-custom/httpd/conf/httpd.conf/atemplate - path is from memory so may be out a bit

note tho that when you restart the httpd the main httpd.conf file is'nt always updated from the template so check it if nothings working, if it doesnt update, I suggest deleting the template then edit the main httpd.conf directly.

This method should take you to the index page on the other server, to access further pages is the problem as links will have to be hardcoded with the outside url rather than just the dir path. eg
Code: [Select]
<a href="http://globalserver/othersite/apage.html">apage</a>

rather than
Code: [Select]
href="apage.html">apage</a>
This of course would screw up viewing the pages from inside the network. I'm working on the problem, but if anyone else has an idea to solve please feel free to divulge.

Offline Thomas

  • ***
  • 65
  • +0/-0
Proxypass redirect to .Net server not working
« Reply #2 on: January 07, 2005, 05:16:51 AM »
Well, I find that if I type in a url for a .html file the proxypass works.  If I type in a url for a .aspx file in the same directory as the .html file then I get this (from Firefox browser)

"The requested URL /Area62/assqvr55g2md2nzhe2zicg45)/Secure/login.aspx was not found on this server."

I've searched the forums at www.asp.net and found some related stuff but no answers.  I'll keep trying.  Thanks for posting.

Thomas

Offline p-jones

  • *
  • 594
  • +0/-0
Proxypass redirect to .Net server not working
« Reply #3 on: January 08, 2005, 01:32:30 PM »
I dont know if I have got the right end of the stick here .. I had an issue where the sme server on site was the FQDN (smeserver.thisdomain.com) but the web for that domain (www.thisdomain.com) was hosted off site.

I simply pointed www.thisdomain.com to the IP of the website in the HostNames and addresses option. visibility and location were both set to local.

Could you not add the www.mydomain to this list, remove all other options, then point it to the IP of your server ?? Just a thought. I then set this domain to not require a password in the proxy password admin screen,(list of domains not requiring password) thereby making it available to everyone - even those who had no account here (ie general internet access)
...

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
Proxypass redirect to .Net server not working
« Reply #4 on: January 08, 2005, 04:42:13 PM »
Quote from: "Inq"

I got my proxypass to work by adding

Code: [Select]
ProxyPass /othersite/ http://otherserver/
<Location>
 order deny,allow
 deny from all
 allow from all
</location>


to a httpd.conf template in /etc/e-smith/template-custom/httpd/conf/httpd.conf/atemplate - path is from memory so may be out a bit

note tho that when you restart the httpd the main httpd.conf file is'nt always updated from the template so check it if nothings working, if it doesnt update, I suggest deleting the template then edit the main httpd.conf directly.


That's because when you finish editting the custom template you must re-expand the template for the updates to be incorporated.  i.e /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf

Then service httpd restart

JB
......

Offline Thomas

  • ***
  • 65
  • +0/-0
URL Proxypass
« Reply #5 on: January 11, 2005, 03:16:32 AM »
I have the Proxypass contrib installed and in the ProxyPass server manager panel I setup a "URL" proxypass instead of a "Virtual Domain" proxypass.  Wonder if this matters?

Thomas

Inq

Proxypass redirect to .Net server not working
« Reply #6 on: January 17, 2005, 12:13:01 PM »
Quote
That's because when you finish editting the custom template you must re-expand the template for the updates to be incorporated. i.e /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf


Ah ha, thx.



Quote
Well, I find that if I type in a url for a .html file the proxypass works. If I type in a url for a .aspx file in the same directory as the .html file then I get this (from Firefox browser)

"The requested URL /Area62/assqvr55g2md2nzhe2zicg45)/Secure/login.aspx was not found on this server."

I've searched the forums at www.asp.net and found some related stuff but no answers. I'll keep trying. Thanks for posting.


The ProxyPass will only pass on requests to a destination when the request is made to the address specified in the ProxyPass on the forwarding server.

If your ASP page is referring to pages on it's location, you will be redirected using the local address. If you check your browser on an internal machine you will see the address chage to  look directly at the serveing box, it will not go through the forwarding box (ie where the ProxyPass is made).

You may have to write your ASP pages to interrigate the http request and extract the initial part of the URL. eg

Code: [Select]
http://globalserver.com/thesite/indext.asp

grab the
Code: [Select]
http://globalserver.com/thesite/

and output back to the client the address

Code: [Select]
http://globalserver.com/thesite/nextpage.asp


Does that make any sense?[/code][/quote]

Offline Thomas

  • ***
  • 65
  • +0/-0
Apache doesn't know what to do with .aspx extension
« Reply #7 on: January 18, 2005, 02:44:11 AM »
Actually if I type in URL just asking for a .aspx page it says it can't be found.  This isn't being redirected to another webpage on the .Net box, just a simple .aspx page.  So, from that I think Apache doesn't know what to do with a page with the .aspx extension. I hope I have explained myself well enough, any thoughts on this?

Thanks,
Thomas

Offline Thomas

  • ***
  • 65
  • +0/-0
Apache doesn't know what to do with .aspx extension again
« Reply #8 on: January 18, 2005, 03:04:56 AM »
I renamed the page login.aspx to login.html on the .Net server. When I access this page from the internet, www.mysmeserver/myproxypassurlsetup/login.html I see the html in this page displayed correctly.  If I try to do the same thing with the page named login.aspx then apache returns page can't be found.

Thomas

Inq

Proxypass redirect to .Net server not working
« Reply #9 on: January 18, 2005, 10:14:20 AM »
What is your asp code doing?

Offline Thomas

  • ***
  • 65
  • +0/-0
Proxypass redirect to .Net server not working
« Reply #10 on: January 18, 2005, 02:27:45 PM »
Well, it's asp.net code not asp code.
Actually all the page does is display two fields that a user enters a username and password then clicks an ok button.  But, just to load the .aspx page in a browser does not require any of the asp.net code to run, at that point it's just html code!!!  That's my point, apache will not load a .aspx page.

Thomas

Inq

Proxypass redirect to .Net server not working
« Reply #11 on: January 18, 2005, 02:36:44 PM »
Have you set apache to recognise the .aspx extension in the apache.conf?

Offline Thomas

  • ***
  • 65
  • +0/-0
Proxypass redirect to .Net server not working
« Reply #12 on: January 18, 2005, 03:10:46 PM »
No, how do I do that?  Thanks for trying to help by the way!!!

Thomas

Inq

Proxypass redirect to .Net server not working
« Reply #13 on: January 18, 2005, 03:36:50 PM »
Sorry it's httpd.conf not apache.conf.

Assuming you've used the command prompt.

login as root
pico /etc/httpd/conf/httpd.conf

look for the line DirectoryIndex

you will see already index.html index.shtml index.cgi etc
Now add after the last entery

index.aspx index.asp

then save ctl+o and ctl+x to exit.

Now restart the http deamon by typying

/etc/rc.d/init.d/httpd restart

the prompt should say:

Stopping httpd:    [ok]
Starting httpd:    [ok]

now see of it loads your asp page.

Strictly speaking you should edit the custom-templates for the httpd.conf but for DirectryIndex I feel it's ok.

Lastly if this fixes your problem I will be surprised, but at the moment that's all I cant think of.

Offline Thomas

  • ***
  • 65
  • +0/-0
Proxypass redirect to .Net server not working
« Reply #14 on: January 18, 2005, 05:35:05 PM »
Nope, didn't help.  Hey, we'll just keep trying!

Thomas

Offline Thomas

  • ***
  • 65
  • +0/-0
Which version of Apache?
« Reply #15 on: January 18, 2005, 06:16:21 PM »
I found this at asp.net http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=427756 where he claims to have accomplished what we're trying to do here.  One thing I noticed is he is using Apache version 2.0.  Which version of Apache does SME 6.01-01 use?  Do you think this could be the difference?

Thomas[/url]