• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue WSGIDaemonProcess errors to death on dual-stack hosts

bezeek

New Pleskian
On Plesk Onyx 17.5.3 (Update #25), hosts using both IPv4 and IPv6 throw errors when adding a WSGIDaemonProcess directive to a domain's Apache config because WSGI daemon names must be unique, yet the file containing said directive is included twice.

/etc/httpd/conf/plesk.conf.d/vhosts/mysite.conf:
Code:
<VirtualHost 1.2.3.4:7080 >
...
        Include "/var/www/vhosts/system/mysite/conf/vhost.conf"
...
</VirtualHost>

<Virtualhost [1:2:3:4:5:6:7:8]:7080 127.0.0.1:7080>
...
        Include "/var/www/vhosts/system/mysite/conf/vhost.conf"
...
</VirtualHost>

/var/www/vhosts/system/mysite/conf/vhost.conf:
Code:
<IfModule wsgi_module>
	WSGIDaemonProcess myapp python-path=/var/www/vhosts/mysite/env/lib/python2.7/site-packages
	WSGIProcessGroup myapp
	WSGIScriptAlias / /var/www/vhosts/mysite/app.wsgi
</IfModule>

The error:
Code:
AH00526: Syntax error on line 2 of /var/www/vhosts/system/mysite/conf/vhost.conf: Name duplicates previous WSGI daemon definition.

I have also tried using an <If> block to give both vhosts their own uniquely named daemons...
/var/www/vhosts/system/mysite/conf/vhost.conf:
Code:
<IfModule wsgi_module>
	<If "%{IPV6} == 'on'">
		WSGIDaemonProcess myapp6 python-path=/var/www/vhosts/mysite/env/lib/python2.7/site-packages
		WSGIProcessGroup myapp6
	</If>
	<Else>
		WSGIDaemonProcess myapp4 python-path=/var/www/vhosts/mysite/env/lib/python2.7/site-packages
		WSGIProcessGroup myapp4
	</Else>
	WSGIScriptAlias / /var/www/vhosts/mysite/app.wsgi
</IfModule>

With the unfortunate result:
Code:
AH00526: Syntax error on line 3 of /var/www/vhosts/system/mysite/conf/vhost.conf: WSGIDaemonProcess not allowed here

Has anyone dealt with this before, and is there a reasonable way to make this work?
I've long forgotten Apache's nuances, so any help would be greatly appreciated!

(Is there a pure nginx solution, perhaps?)

Thanks-
 
Back
Top