I am trying to run two applications on my Linux apache server:
- OpenProject
- pgAdmin (which is WSGI application)
And, in order to connect them from remote computer, I use those httpd
configuration files:
For OpenProject:
Include /etc/openproject/addons/apache2/includes/server/*.conf
<VirtualHost *:80>
ServerName 198.162.12.13
DocumentRoot /opt/openproject/public
ProxyRequests off
Include /etc/openproject/addons/apache2/includes/vhost/*.conf
# Can't use Location block since it would overshadow all the other proxypass directives on CentOS
ProxyPass /openproject/ http://127.0.0.1:6000/openproject/ retry=0
ProxyPassReverse /openproject/ http://127.0.0.1:6000/openproject/
</VirtualHost>
For pgAdmin:
<VirtualHost *:80>
ServerName 198.162.214.23
WSGIScriptAlias /pgadmin4 /usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi
WSGIDaemonProcess pgadmin processes=1 threads=25
<Directory /usr/lib/python2.7/site-packages/pgadmin4-web/>
WSGIProcessGroup pgadmin
WSGIApplicationGroup %{GLOBAL}
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
</VirtualHost>
And now magic (for me) begins and where my question lies:
take a look at server names in both files, pgAdmin contains my actual IP address, while OpenProject has some random IP address.
With that setup, pgAdmin works, but OpenProject doesn't.
Generally, without configuration for pgAdmin, OpenProject works with any IP address, which is strange for me, so my first question is: why???
So, to sum up:
If I set up in both files my actual IP address, then OpenProject works, pgAdmin doesn't.
If I set up in both files some random IP address, then OpenProject works, pgAdmin doesn't.
If I set up actual IP for OpenProject, random for pgAdmin, then OpenProject works, pgAdmin doesn't.
If I set up random IP for OpenProject, actual IP for pgAdmin, then OpenProject doesn't work, but pgAdmin does.
Why it is so messed up? How to configure those files so both applications work as expected?