0

I am running two web applications, one is tornado-based and the other one is cherrypy based, behind apache on an opensuse server. Both run on different domains pointing to the same IP. The two applications are running on the same server, and serving on 127.0.0.1 and different ports - 8090 for the cherrypy application and 8091 for the tornado app. Apache has been setup to serve the applications with ProxyPass, with two virtualhosts such as:

conf1.conf

<VirtualHost domain1.com:80>
        ServerName domain1.com
        ProxyPass / http://127.0.0.1:8090/
        ProxyPassReverse / http://127.0.0.1:8090/

        <Location "/">
                Require all granted
        </Location>
</VirtualHost>

and conf2.conf

<VirtualHost domain2.com:80>
        ServerName domain2.com
        ProxyPass / http://127.0.0.1:8091/
        ProxyPassReverse / http://127.0.0.1:8091/

        <Location "/">
                Require all granted
        </Location>
</VirtualHost>

However when I try to access either one I get a 403 forbidden. It seems that I can only get one of them to work if I change the VirtualHost directive to *:80 and remove the other one. How do I go about enabling both to run simultaneously?

1
  • Try setting the VirtualHost to *:80 for both to enable name based VirtualHosting
    – HBruijn
    Jul 31, 2016 at 12:00

1 Answer 1

1

Although the VirtualHost directive supports the usage of a hostname in i.e. <VirtualHost example.com:80> that is not recommended.

Either use a specific IP-address or the wildcard * to match any ip-address.

Unless you have specific reasons not to I would suggest using <VirtualHost *:80> in both configuration files.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .