Running Apache with another web server?

Has anyone managed to run two different web servers - for example, Apache and CherryPy - next to each other on the same machine? I am experimenting with other web servers right now, and I would like to see if I can carry out my experiments while maintaining my other sites. You can say that this is not so much a specific programmatic issue as a general network issue.

  • I know that you can run two web servers on different ports; but is there a way to configure them so that they can work on the same port (i.e. both were running on port 80)?
  • Web servers will not serve files from the same domains. For example, Apache can serve documents from foo.domain.com, and another web server will work with bar.domain.com.

I know this is not a perfect configuration. I just wanted to see if this can be done before I start running around the rabbit hole. :)

+3
source share
3 answers

You cannot have two processes associated with the same IP address. You can add another IP address to the field and each server listen on it.

Another option is a proxy to transfer one server to another. With Apache, you can do something like:

NameVirtualHost *
<virtualhost *>
  ServerName other.site.com

  # assumes CherryPy listens on port 8080
  ProxyPass / http://127.0.0.1:8080/
  ProxyPassReverse / http://127.0.0.1:8080/
</Virtualhost>

, ProxyPass. , , , , 127.0.0.1 IP- . - (apache mod_rpaf) X-Forwarded-For IP-. , CherryPy ?

+7

Apache httpd 80 , Apache, . Tomcat Apache, php, jsp.

CherryPy, Apache CherryPy.

: : http://tools.cherrypy.org/wiki/BehindApache

0

As an alternative to the correct Ishmaeel answer, if you have a server with two network cards, you can request answers to each server at different IP addresses.

0
source

Source: https://habr.com/ru/post/1696506/


All Articles