Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 2 web servers: one linux server running apache and one windows server running IIS. Is it possible for me to make both servers share the same url and subdomain. For example, can I make http:// www.mysite.com/iis/ run off of IIS and have http:// www.mysite.com/apache/ run off of apache? I don't want to use subdomains to make this work.

share|improve this question
add comment

4 Answers

You can use mod_proxy in Apache to forward requests to http://www.mysite.com/iis/ on to the IIS service, if Apache is the main webserver of the two (i.e. it responds directly to port 80 on the address www.mysite.com points to).

The other option is to have neither Apache or IIS as the primary service on the standard port(s), having a dedicated reverse proxy instead that is configured to forward requests to IIS and Apache as appropriate.

share|improve this answer
add comment

One option would be to have everything for www.mysite.com go to apache, and then use the mod_proxy to forward everything for www.mysite.com/iis/ off to your IIS server.

share|improve this answer
add comment

In a standard setup, No. If you were running IIS and Apache on the same server, then they would need to be on different ports, only one of them could use port 80, therefore your URL for the other would have to include the port number.

There maybe some way to use something like Mod proxy as suggested to hand off request for certain URLs to the other server, but you would still have the issue of the URL needing to contain the port number, unless IIS is on another machine. You would need to designate one server to be primary and listen on port 80, and deal with handing off any requests to the other server.

share|improve this answer
add comment

You cannot accomplish this without making one of the servers the owner of both URLs. You would then take the default server, I'll call it, and issue redirects to another URL that would resolve to the IP address of your other server.

For example:

Linux Server IP1 = www.myurl.com, where IP1 is the IP address of the url shown.

In the httpd.conf file you would put a redirect directive to match anything against www.myurl.com/iis and send it to www.myotherurl.com which would resolve to the IP of the other server. www.myurl.com/apache can then just point to a local directory of your choice.

IIS Server IP2 = www.myotherurl.com where IP2 is the IP address of another URL as shown.

The Rewrite rule can be something like this:

RewriteEngine On RewriteRule ^iis/?$ http://www.myotherurl.com

As an aside note, we do something similar to redirect HTTP traffic to our HTTPS site for certain things.... like if you type webmail.mycompany.com, we redirect to https of the same.

RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule (.*) https://webmail.mycompany.corp/ [R=301,L]

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.