> On 27 Mar 2018, at 8:35 pm, Eric Sears <[email protected]> wrote:
> 
> Are you modifying sys.path in the WSGI script file so Python will know where 
> your project code is? 
> 
> You have to excuse me as I didn't build the Django app. The main wsgi.py 
> calls the site.settings file. In the settings.py the closest thing I could 
> find is:
> 
> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
> 
> 
> Do you mean using: 
> 
>     WSGIApplicationGroup %{GLOBAL} 
> 
> It is preferable you use that regardless. 
> The information in the virtual host settings is:

Which is different to what you showed before.

> 
> WSGIDaemonProcess projectname 
> python-path=/opt/rh/httpd24/root/var/www/html/sitea/project_name

The python-path setting here is an alternative for setting sys.path in the 
wsgi.py file.

Note that it looks like you have placed all your code under DocumentRoot 
directory. That is:

    /opt/rh/httpd24/root/var/www/html

That is a bad idea. If someone commented out WSGIScriptAlias, your code can be 
downloaded, including any passwords of the secret key in the Django settings 
file.

You should not put your Django project code under the directory specified by 
DocumentRoot.

> WSGIProcessGroup project_name
> WSGIScriptAlias / 
> /opt/rh/httpd24/root/var/www/html/sitea/project_name/wsgi.py 
> application-group=%{GLOBAL}

So using application-group instead of WSGIApplicationGroup.

> Can you ensure you have set: 
> 
>     LogLevel info 
> 
> in Apache configuration. 
> 
> LogLevel is currently set to debug as I wanted to get as much info as 
> possible.

Using info is sufficient. Plus the logs below indicate you might not be using 
debug when that request was made as I would have expected there to be more 
information than that, including some debug message. Anyway, doesn't matter, 
whether debug messages show may depend on other Apache modules being used. 
Extra messages from mod_wsgi may only get displayed if also have 
WSGIVerboseDebugging directive set to On, but don't need to see them.

> This will cause mod_wsgi to log more about process restarts, script loading 
> etc. I need to see the more detailed logging from the log file around time 
> the request was made. If you are using VirtualHost specific log, also need to 
> see any errors from main  
> Apache error log at the same time. 
>  
> This is a disconnected system and I can't export the logs directly. Hopefully 
> the info below is what you need:
> 
> [wsgi:info] [pid 27937:tid #] mod_wsgi (pid=27937): Attach interpreter ''.
> [wsgi.info] [pid 27937:tid #] mod_wsgi (pid=27937): Adding 
> '/opt/rh/httpd24/root/var/www/html/sitea' to path
> [wsgi:debug] - Spawns 15 threads in daemon process ' project_name'
> [wsgi:info] [pid 27937:tid #] [remote 192.168.1.100] mod_wsgi (pid 27937, 
> process='project_name', application=''): Loading Python script file 
> '/opt/rh/httpd24/root/var/www/html/sitea/project_name/wsgi.py'
> [wsgi:error] [pid 27981] [client 192.168.1.100] Truncated or oversized 
> response headers received from damon process 'project_name': 
> /opt/rh/httpd24/root/var/www/html/sitea/project_name/wsgi.py, referrer 
> https://site.com/ <https://site.com/>

Are you sure there is nothing after this?

Can you do more than the one request and show me error log messages from across 
the two requests.

Are you sure there are no messages showing a message like 'Segmentation Fault'? 
Does the process ID shown in the 'Loading Python script file' message in logs 
still exist after you make the request?

Does your application return a WWW-Authenticate header with a really long 
authentication challenge string?

Does your application return any other response headers with really long values?

If yes to either of last two questions, try adding:

    header-buffer-size=16384

option to WSGIDaemonProcess directive.

Graham

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to