Why are you setting 'socket-user'?

That is only required when using Apache PrivilegesMode as SECURE, or using 
certain Apache MPMs.

What happens when you don't use that?

I want to see the original error messages and permissions on both the socket 
files, and the directory the sockets are in, before changing any configuration 
from what one would normally use.

Graham

> On 19 Mar 2020, at 2:10 am, Guddu <[email protected]> wrote:
> 
> After configuring daemon mode, I started getting a 503 Server Unavailable 
> error.
> 
> There are lot of posts on stackoverflow and a dedicate section in the 
> troubleshooting page at 
> https://modwsgi.readthedocs.io/en/develop/user-guides/frequently-asked-questions.html
>  and 
> https://modwsgi.readthedocs.io/en/develop/user-guides/configuration-issues.html
>  but none of the suggestions seem to be helping me at the moment. Appreciate 
> your guidance.
> 
> The error logs have the following
> 
> [Wed Mar 18 09:30:17.649428 2020] [wsgi:error] [pid 14044] (13)Permission 
> denied: [client 10.52.7.18:2505] mod_wsgi (pid=14044): Unable to connect to 
> WSGI daemon process 'app_qa' on '/run/httpd/wsgi/.14039.0.1.sock' as user 
> with uid=1001.
> 
> 
> 
> 
> The directory in question has read and write permission to app_user
> 
> The httpd processes start fine. Below is the ps output
> 
> root     14197     1  0 09:30 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
> app_user  14202 14197  0 09:30 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
> app_user  14203 14197  0 09:30 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
> app_user  14204 14197  0 09:30 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
> app_user  14205 14197  0 09:30 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
> app_user  14206 14197  0 09:30 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
> 
> 
>   
> The socket flies get written
>   
> [root@server wsgi]# ls -ltra
> total 0
> srwx------ 1 app_user root      0 Mar 18 09:30 .14197.0.1.sock
> srwx------ 1 app_user root      0 Mar 18 09:30 .14197.0.2.sock
> 
> 
> 
> 
> My apache build info is as follows
> 
> [app_user@server app_qa]$ httpd -V
> AH00558: httpd: Could not reliably determine the server's fully qualified 
> domain name, using 10.21.2.136. Set the 'ServerName' directive globally to 
> suppress this message
> Server version: Apache/2.4.6 (Red Hat Enterprise Linux)
> Server built:   Jun  9 2019 13:01:04
> Server's Module Magic Number: 20120211:24
> Server loaded:  APR 1.4.8, APR-UTIL 1.5.2
> Compiled using: APR 1.4.8, APR-UTIL 1.5.2
> Architecture:   64-bit
> Server MPM:     prefork
>   threaded:     no
>     forked:     yes (variable process count)
> Server compiled with....
>  -D APR_HAS_SENDFILE
>  -D APR_HAS_MMAP
>  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
>  -D APR_USE_SYSVSEM_SERIALIZE
>  -D APR_USE_PTHREAD_SERIALIZE
>  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
>  -D APR_HAS_OTHER_CHILD
>  -D AP_HAVE_RELIABLE_PIPED_LOGS
>  -D DYNAMIC_MODULE_LIMIT=256
>  -D HTTPD_ROOT="/etc/httpd"
>  -D SUEXEC_BIN="/usr/sbin/suexec"
>  -D DEFAULT_PIDLOG="/run/httpd/httpd.pid"
>  -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
>  -D DEFAULT_ERRORLOG="logs/error_log"
>  -D AP_TYPES_CONFIG_FILE="conf/mime.types"
>  -D SERVER_CONFIG_FILE="conf/httpd.conf"
> 
>  [app_user@server app_qa]$ httpd -l
> Compiled in modules:
>   core.c
>   mod_so.c
>   http_core.c
> 
> 
> 
> 
> My httpd conf is as follows
>   
> WSGISocketPrefix /run/httpd/wsgi/
> <VirtualHost *:8999>
> WSGIDaemonProcess app_qa processes=2 display-name=%{GROUP} 
> python-path=/opt/app/app_qa  socket-user=app_user
> WSGIProcessGroup app_qa
> WSGIScriptAlias /app_qa /opt/app/app_qa/app/wsgi.py  process-group=app_qa
> Alias /static_app_qa /opt/app/app_qa/staticfiles
> 
> <Directory /opt/app/app_qa/app/>
>         <Files wsgi.py>
>                 Require all granted
>         </Files>
> </Directory>
> 
> <Directory /opt/app/app_qa/staticfiles/>
>         Require all granted
> </Directory>
> </VirtualHost>
> 
> 
> Appreciate your help on this matter.
> 
> -- 
> 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] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/modwsgi/82ab46fe-adc1-42fd-90ad-abaf05f58613%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/modwsgi/82ab46fe-adc1-42fd-90ad-abaf05f58613%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/E64EE2B2-A0C8-41C2-9D2A-95C5558F9A0B%40gmail.com.

Reply via email to