You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have installed Pootle following instruction. I can run it with
pootle runserver --insecure
But when I switch to Apache (wsgi, not proxy), it throw 500 error. In apache error log, I found:
[Sat May 06 13:15:56.827925 2017] [wsgi:error] [pid 11006] [client 84.249.204.100:45130] Truncated or oversized response headers received from daemon process 'pootle': /srv/www/vhosts/pootle/wsgi.py
[Sat May 06 13:15:56.863319 2017] [core:notice] [pid 10996] AH00052: child pid 11446 exit signal Segmentation fault (11)
But I have no idea what happened.
pootle.conf
<VirtualHost *:80>
# Domain for the Pootle server. Use 'localhost' for local deployments.## If you want to deploy on example.com/your-pootle/ rather than in# my-pootle.example.com/ you will have to do the following changes to# this sample Apache configuration:## - Change the ServerName directive to:# ServerName example.com# - Change the WSGIScriptAlias directive to (note that /your-pootle must# not end with a slash):# WSGIScriptAlias /your-pootle /srv/www/vhosts/pootle/wsgi.py# - Change the Alias directive for 'assets' to include the '/your-pootle'.# - Include the following settings in your custom Pootle settings:# STATIC_URL = '/your-pootle/assets/'# FORCE_SCRIPT_NAME = '/your-pootle'# - If you have previously calculated the stats:# - Restart the RQ workers.# - Run refresh_stats to recalculate the stats data.ServerName translate.kde-china.org
# Set the 'POOTLE_SETTINGS' environment variable pointing at your custom# Pootle settings file.## If you don't know which settings to include in this file you can use# the file '90-local.conf.sample' as a starting point. This file can be# found at '/srv/www/vhosts/pootle/env/lib/python2.7/site-packages/pootle/settings/'.## Another way to specify your custom settings is to comment this# directive and add a new '90-local.conf' file (by copying the file# '90-local.conf.sample' and changing the desired settings) in# '/srv/www/vhosts/pootle/env/lib/python2.7/site-packages/pootle/settings/'# (default location for a pip-installed Pootle, having Python 2.7).## This might require enabling the 'env' module.SetEnv POOTLE_SETTINGS /srv/www/vhosts/pootle/pootle.conf
# The following two optional lines enable the "daemon mode" which# limits the number of processes and therefore also keeps memory use# more predictable.WSGIDaemonProcess pootle processes=2 threads=3 stack-size=1048576 maximum-requests=500 inactivity-timeout=300 display-name=%{GROUP} python-path=/srv/www/vhosts/pootle/env/lib/python2.7/site-packages
WSGIProcessGroup pootle
WSGIApplicationGroup {GLOBAL}
# Point to the WSGI loader script.WSGIScriptAlias / /srv/www/vhosts/pootle/wsgi.py
<Directory /srv/www/vhosts/pootle>
Order deny,allow
Allow from all
<Files wsgi.py>
Require all granted
</Files>
</Directory>
# Turn off directory listing by default.Options -Indexes
# Compress before being sent to the client over the network.# This might require enabling the 'deflate' module.SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript
# Set expiration for some types of files.# This might require enabling the 'expires' module.ExpiresActive On
ExpiresByType image/jpg "access plus 10 years"ExpiresByType image/png "access plus 10 years"ExpiresByType text/css "access plus 10 years"ExpiresByType application/x-javascript "access plus 10 years"# Optimal caching by proxies.# This might require enabling the 'headers' module.Header set Cache-Control "public"# Directly serve static files like css and images, no need to go# through mod_wsgi and Django. For high performance consider having a# separate server.Alias /assets /srv/www/vhosts/pootle/env/lib/python2.7/site-packages/pootle/assets
<Directory /srv/www/vhosts/pootle/env/lib/python2.7/site-packages/pootle/assets>
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
wsgi.py
#!/usr/bin/env python# -*- coding: utf-8 -*-importosimportsiteimportsys# You probably will need to change these paths to match your deployment,# most likely because of the Python version you are using.ALLDIRS= [
'/srv/www/vhosts/pootle/env/lib/python2.7/site-packages',
'/srv/www/vhosts/pootle/env/lib/python2.7/site-packages/pootle/apps',
]
# Remember original sys.path.prev_sys_path=list(sys.path)
# Add each new site-packages directory.fordirectoryinALLDIRS:
site.addsitedir(directory)
# Reorder sys.path so new directories at the front.new_sys_path= []
foriteminlist(sys.path):
ifitemnotinprev_sys_path:
new_sys_path.append(item)
sys.path.remove(item)
sys.path[:0] =new_sys_path# Set the Pootle settings module as DJANGO_SETTINGS_MODULE.os.environ['DJANGO_SETTINGS_MODULE'] ='pootle.settings'# Set the WSGI application.defapplication(environ, start_response):
"""Wrapper for Django's WSGIHandler(). This allows to get values specified by SetEnv in the Apache configuration or interpose other changes to that environment, like installing middleware. """try:
os.environ['POOTLE_SETTINGS'] =environ['POOTLE_SETTINGS']
exceptKeyError:
passfromdjango.core.wsgiimportget_wsgi_application_wsgi_application=get_wsgi_application()
return_wsgi_application(environ, start_response)
The text was updated successfully, but these errors were encountered:
We're pretty certain this solved with ALLOWED_HOSTS, but without feedback we can't confirm. So closing for now, please open if this issue is not solved.
Pootle 2.8.0rc5 (Django 1.10.7, Translate Toolkit 2.0.0)
I have installed Pootle following instruction. I can run it with
But when I switch to Apache (wsgi, not proxy), it throw 500 error. In apache error log, I found:
But I have no idea what happened.
pootle.conf
wsgi.py
The text was updated successfully, but these errors were encountered: