Forum Moderators: phranque
What I would like to be able to do...if at all possible is have PWS running on a different port, since they both can't listen on port 80, and whenever a request comes in for [localhost...] get the output of the page from the PWS server [localhost:81...] but not redirect to that url.
This way, I can theoretically, mix PHP and ASP in the same site...as that is unfortunately what I have to do on this project.
I believe I need to set IIS to only accept requests from the local computer's IP and have them both use the same document root. With a rewrite rule like this...
RewriteRule (.*\.asp) [192.168.0.101...] [P]
...I think.
The visitor does have no direct interacion with PWS. All foreign requests are accepted by Apache, and dependent on how you set up the reverse proxy, some request are handled by Apache directly, and other requests are forewarded to PWS. I use a similar setup for a server handling both ordinary HTML/PHP and JSP. JSP requests are forwarded by Apache to Tomcat.
The Apache manual gives some examples how to setup a proper reverse proxy. You should read the manual carefully, because if you make some wrong settings, your computer will end up to be an open proxy which could be abused.
And if I use an .htaccess file with
RewriteEngine on
RewriteRule (.*\.asp) [192.168.0.102:81...]
it works fine, only it redirects...and I want the url to NOT show the :81.
So I change it too
RewriteEngine on
RewriteRule (.*\.asp) [192.168.0.102:81...] [P]
and I get
Forbidden
You don't have permission to access /index.asp on this server.
Apache/2.0.55 (Win32) PHP/5.1.2 Server at localhost Port 80
Any ideas as to what isn't configured properly?
I was getting the error becuase dummy me forgot to uncomment the mod_proxy stuff in the httpd.conf file.
Whoops.
The only issue I'm now having, is how can I check what type of file is being loaded 'by default' when someone enters [foo...]
...sometimes it will be index.html, or .php, and sometimes .asp...which I need to check for.
Ideas?
Edit:
actually just having it rewrite the url fom [foo...] to include the filename it's actually loading at the end would work too.
So if it's really loading index.php it is changed to show [foo...] instead of just [foo...]
[edited by: Gibble at 6:31 am (utc) on July 15, 2006]