Any chance to have some help on this ?
Thanks in advance.
Manu
On Friday, February 9, 2024 at 1:06:11 PM UTC+1 Manu Itutur wrote:
> Hello Graham,
>
> Thanks for your answer. Here is the full apache configuration
>
> <VirtualHost *:80>
> Servername redacted.io
> RewriteEngine On
> WSGIPassAuthorization on
> # Block access for all IPs in /etc/apache2/ipblacklist.conf
> RewriteMap hosts-deny "txt:/etc/apache2/ipblacklist.conf"
> RewriteCond "${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND}" "!=NOT-FOUND" [OR]
> RewriteCond "${hosts-deny:%{REMOTE_HOST}|NOT-FOUND}" "!=NOT-FOUND"
> RewriteRule "^" "-" [F]
>
> # Maintenance mode section
>
> # Allow Individual IP stored in /etc/apache2/maintenance.exceptions
> addresses past maintenance page
> RewriteMap exceptions /etc/apache2/maintenance.exceptions
> RewriteCond ${exceptions:%{REMOTE_ADDR}} =OK
> RewriteRule ^ - [L]
>
> ErrorDocument 503 /static/html/maintenance/under_construction.html
> RewriteCond /etc/apache2/MAINTENANCE_ON -f
> RewriteCond expr "! %{REQUEST_URI} -strmatch '/static/html/maintenance/*'"
> # Allow access for LB IPs
> RewriteCond expr "! -R '10.108.0.0/14'"
> RewriteRule ^ - [R=503,L]
>
> RewriteCond /etc/apache2/MAINTENANCE_ON !-f
> RewriteRule ^/static/html/under_construction.html$ / [R,L]
>
>
> # BLOG Conf - Test
> ProxyPreserveHost On
> ProxyRequests Off
>
> Alias /503 /home/redacted/redacted/redacted/static/html/
> under_construction.html
>
> <Location /mag>
> ProxyPass http://192.168.1.225/mag
> ProxyPassReverse http://192.168.1.225/mag
> Order allow,deny
> Allow from all
> ErrorDocument 503 /503
> </Location>
>
> <Location /mag/es>
> ProxyPass http://192.168.1.186/mag/es
> ProxyPassReverse http://192.168.1.186/mag/es
> Order allow,deny
> Allow from all
> ErrorDocument 503 /503
> </Location>
>
> <Location ~ "/admin|/staff|/admin_action|/mailator">
> Order deny,allow
> Include /etc/apache2/ipwhitelist.conf
> Deny from all
> ErrorDocument 503 /503
> </Location>
>
> Alias /robots.txt /home/redacted/redacted/redacted/static/robots.txt
> Alias /.well-known/security.txt /home/redacted/redacted/redacted/static/
> security.txt
> Alias /favicon.ico /home/redacted/redacted/redacted/static/favicon.ico
> Alias /static/ /home/redacted/redacted/redacted/static/
> <Directory /home/redacted/redacted/redacted/static>
> Options Includes FollowSymLinks MultiViews
> Order allow,deny
> Require all granted
> Allow from all
> </Directory>
> WSGIDaemonProcess redacted python-path=/home/redacted/redacted:/home/
> redacted/redacted/virtualenv/lib/python3.7/site-packages processes=8
> threads=2 display-name=redacted-apache
> WSGIScrredactedAlias / /home/redacted/redacted/redacted/conf/wsgi.prod.py
> process-group=redacted application-group=%{GLOBAL}
> WSGIApplicationGroup %{GLOBAL}
> <Directory /home/redacted/redacted/redacted/conf>
> <Files wsgi.prod.py>
> Require all granted
> Order allow,deny
> Allow from all
> </Files>
> </Directory>
>
> </VirtualHost>
>
> <VirtualHost *:80>
> ServerName cms.redacted.io
> Redirect 301 / https://redacted.io/
> </VirtualHost>
>
> <VirtualHost *:80>
> ServerName get.redacted.io
> Redirect 301 / https://redacted.io/
> </VirtualHost>
>
>
> <VirtualHost *:80>
>
> Servername help.redacted.io
> ErrorLog "/var/log/apache2/help_error_log.log"
> CustomLog "/var/log/apache2/help_access_log.log" common
>
> SSLProxyEngine on
> SSLProxyVerifyDepth 10
> SSLProxyCheckPeerCN off
> SSLProxyCheckPeerName off
>
> ProxyPreserveHost On
> ProxyPass / https://custom.intercom.help/
> ProxyPassReverse / https://custom.intercom.help/
>
> </VirtualHost>
>
> On my serveur, from the monitoring perspective, the maximum workers is
> reach at 260, while the CPU / RAM usage remains pretty low.
>
> My mpm_prefork conf is:
>
> <IfModule mpm_prefork_module>
> StartServers 20
> MinSpareServers 15
> MaxSpareServers 30
>
> MaxRequestWorkers 150
> MaxConnectionsPerChild 0
> </IfModule>
>
> So as the max workers does not seems to be use from mpm... I'm really
> confuse, I don't understand how both file are related, if they are.
>
> Thanks for your help.
>
> Manu
>
> On Thursday, December 14, 2023 at 8:39:03 PM UTC+1 Graham Dumpleton wrote:
>
>> The issue with the process-group option you have is that it doesn't match
>> the name of the process group. You have "custom" instead of "ipt".
>>
>> To be honest I even missed you had the process-group option in there.
>> Since didn't match you should actually have got an error. So maybe you do
>> have it correct.
>>
>> Note another video to watch which touches on performance is:
>>
>> [image: maxresdefault.jpg]
>>
>> Using benchmarks to understand how WSGI servers work. by Graham Dumpleton
>> <https://www.youtube.com/watch?v=SGleKfigMsk>
>> youtube.com <https://www.youtube.com/watch?v=SGleKfigMsk>
>> <https://www.youtube.com/watch?v=SGleKfigMsk>
>>
>>
>> BTW, make sure you have:
>>
>> WSGIRestrictEmbedded On
>>
>> set in global Apache configuration if using daemon process mode.
>>
>> Graham
>>
>> On 15 Dec 2023, at 4:49 am, Manu Itutur <[email protected]> wrote:
>>
>> Thanks for your answer,
>>
>> In my file I use absolute path, I remove some "sensitive" data, therefore
>> it's then a relative path, sorry for the confusion.
>>
>> I already watched both video couple of days ago, but I guess I missed
>> something. I will check process-group option in WSGIScriptAlias, hope
>> things will be clarified.
>>
>>
>>
>>
>> On Wednesday, December 13, 2023 at 8:25:46 PM UTC+1 Graham Dumpleton
>> wrote:
>>
>>> BTW the location given in python-path, second argument to
>>> WSGIScriptAlias and argument to Directory directive are supposed to be
>>> absolute paths, not relative. Use of a relative path might cause incorrect
>>> results.
>>>
>>> For a virtual environment you should not use python-path like that
>>> anyway. Instead use python-home to virtual environment root. See:
>>>
>>> Virtual Environments — mod_wsgi 5.0.0 documentation
>>> <https://modwsgi.readthedocs.io/en/master/user-guides/virtual-environments.html>
>>> modwsgi.readthedocs.io
>>> <https://modwsgi.readthedocs.io/en/master/user-guides/virtual-environments.html>
>>> [image: favicon.ico]
>>> <https://modwsgi.readthedocs.io/en/master/user-guides/virtual-environments.html>
>>>
>>> <https://modwsgi.readthedocs.io/en/master/user-guides/virtual-environments.html>
>>>
>>>
>>> On 14 Dec 2023, at 1:45 am, Manu Itutur <[email protected]> wrote:
>>>
>>> WSGIDaemonProcess ipt python-path=virtualenv/lib/python3.7/site-packages
>>> processes=7 threads=2 display-name=custom-apache
>>> WSGIScriptAlias / conf/wsgi.preprod.py process-group=custom
>>> application-group=%{GLOBAL}
>>> WSGIApplicationGroup %{GLOBAL}
>>> <Directory conf>
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "modwsgi" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>>
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/modwsgi/9973f79c-6265-4cee-a876-262b09975fa4n%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/modwsgi/9973f79c-6265-4cee-a876-262b09975fa4n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>>
>>
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/modwsgi/bba63b87-65ef-4699-b41b-fddb20084649n%40googlegroups.com.