Приложение mod_wsgi в двух разных портах

У меня есть приложение WSGI, работающее в prod, и я хочу создать промежуточное приложение на одном serverе. Поэтому я настроил два виртуальных хоста в разных портах 80 для prod и 9090 для оленя, но каждый раз, когда я запрашиваю порт 9090, он использует приложение prod и я не знаю почему. Вот моя configuration:

prod.conf:

LoadModule wsgi_module modules/mod_wsgi.so NameVirtualHost *:80 ServerName dashboard <VirtualHost *:80> ServerName dashboard WSGIDaemonProcess dashboard display-name=%{GROUP} WSGIProcessGroup dashboard WSGIScriptAlias / /srv/dashboard/wsgi.py process-group=dashboard application-group=dashboard WSGIPassAuthorization on Alias /static/ /srv/dashboard/static/ Alias /favicon.ico /srv/dashboard/static/favicon.ico DocumentRoot "/srv/dashboard" <Directory /srv/dashboard> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-error.log" CustomLog "/var/log/httpd/dashboard-access.log" common </VirtualHost> 

stag.conf:

 LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> Модуль LoadModule wsgi_module / mod_wsgi.so LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> Прослушать 9090 LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> Столкновение приборной панели ServerName LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> Столкновение приборной панели ServerName LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> Отображение-имя WSGIDaemonProcess display-name =% {GROUP} LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> WSGIProcessGroup - разбивка приборной панели LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> WSGIScriptAlias ​​/ /srv/dashboard-stagging/wsgi.py process-group = dashboard-stagging application-group = pnpdash $ LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> WSGIPassAuthorization on LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> Alias ​​/ static / / srv / dashboard-stagging / static / LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> Alias ​​/favicon.ico /srv/dashboard-stagging/static/favicon.ico LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> DocumentRoot "/ srv / dashboard-stagging" LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> <Directory / srv / dashboard-stagging> LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> Параметры + Индексы + FollowSymLinks + MultiViews LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> <Directory / srv / dashboard-stagging / static> LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> Параметры + Индексы + FollowSymLinks + MultiViews LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> ErrorLog "/var/log/httpd/dashboard-stag-error.log" LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> CustomLog "/var/log/httpd/dashboard-stag-access.log" общий LoadModule wsgi_module modules/mod_wsgi.so Listen 9090 NameVirtualHost *:9090 ServerName dashboard-stagging <VirtualHost *:9090> ServerName dashboard-stagging WSGIDaemonProcess dashboard-stagging display-name=%{GROUP} WSGIProcessGroup dashboard-stagging WSGIScriptAlias / /srv/dashboard-stagging/wsgi.py process-group=dashboard-stagging application-group=pnpdash$ WSGIPassAuthorization on Alias /static/ /srv/dashboard-stagging/static/ Alias /favicon.ico /srv/dashboard-stagging/static/favicon.ico DocumentRoot "/srv/dashboard-stagging" <Directory /srv/dashboard-stagging> Options +Indexes +FollowSymLinks +MultiViews AllowOverride None Require all granted </Directory> <Directory /srv/dashboard-stagging/static> Options +Indexes +FollowSymLinks +MultiViews Require all granted </Directory> ErrorLog "/var/log/httpd/dashboard-stag-error.log" CustomLog "/var/log/httpd/dashboard-stag-access.log" common </VirtualHost> 

Мой /var/log/httpd/dashboard-stag-access.log остается пустым, когда я запрашиваю http://dashboard.mycompany.com:9090, и он использует приложение в порту 80.

Любые указания?

Проверьте имена fileов cookie ваших приложений, вызванные wsgi (prod и stag), они не должны конфликтовать. Пример: у меня есть 2 приложения с флягой и wsgi, используя ту же программу с разными параметрами. Мне нужно назначить разные значения config ["SESSION_COOKIE_NAME"], чтобы избежать конфликтов.

  • Apache обратный proxy перенаправляет на apache tomcat
  • Каковы эти локальные хосты для доступа к виртуальному хосту Apache?
  • htaccess не работает на виртуальном хосте apache 2.4
  • Сделать Virtualhost обнаруживать подстановочный знак с и без предшествующего www
  • Установка CMS Textpattern с apache2 на debian
  • Apache 2.4 - Virtualhost игнорируется?
  • Может ли HAProxy балансировать нагрузку на удаленном websiteе, а server, на котором он работает на других хостах?
  • Ошибка a2ensite «Сайт не существует» при создании виртуального хоста apache2 на ubuntu
  • Замените все URL-адреса на основе имени хоста, используя Apache 2.2
  • ERR_SSL_PROTOCOL_ERROR apache hosting gitlab
  • Можно ли настроить Apache2 Virtualhosts для searchа fileов в directoryе на основе имени хоста?
  • Давайте будем гением компьютера.