Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to run Apache and IIS on the same machine with one IP-Address (and different ports ?)

The "main" one should be IIS. Is there an option to address the Apache without typing in the port-number The reason for this is: I cannot get Django to work on IIS Any ideas will be appreciated

like image 260
Helmut Avatar asked Jan 26 '26 22:01

Helmut


2 Answers

You could set up Apache on a different port, then use redirects or proxying on IIS to get people to the Apache port without them having to type it.

like image 74
chaos Avatar answered Jan 29 '26 12:01

chaos


The only way to avoid typing in the port number is to set up a proxy, which could be either one of the two webservers. That way, the proxy makes the connection on the alternate port and the client doesn't have to know where it is.

I don't know about IIS, but on Apache, you would have to load mod_proxy (and I think, mod_proxy_http) and then do something like this:

ProxyRequests Off

<Proxy *>
  Order deny,allow
  Allow from all
</Proxy>

ProxyPass /foo http://foo.example.com/bar
ProxyPassReverse /foo http://foo.example.com/bar

Also check the docs for mod_proxy online.

You might also want to look at lightweight webservers such as lighttpd, if you're going to have two running. It's a common setup to have a light webserver taking specific tasks away from the main one. (Apache for dynamic and lighttpd for static content is one typical example).

There's also other possibilities, ranging from getting more fancy, such as

  • Have a third webserver doing only the proxying and the other two on alternate ports
  • Have them running on the same port but two IPs and hide that fact via your network setup

to attacking the root cause by either

  • finding somenone who knows how to get Django running on IIS
  • moving from IIS to another webserver

Of course, I have no clue what might be appropriate for your situation.

like image 37
Hanno Fietz Avatar answered Jan 29 '26 10:01

Hanno Fietz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!