我正在尝试设置 Apache 以应用 Diazo 主题,但似乎处理链在某个时候停止,产生一个空文件,这会导致错误(只有FilterChain THEME
在配置中出现该行时才会出现错误,所以我'确定它与应用主题有关)。
到目前为止,我已经应用了以下步骤:
首先,我用 diazocompile 编译了我的 rules.xml 以生成一个文件/home/elmolino/buildout/src/djangolino-theme/theme.xsl
。
然后,我更新了我的 apache 配置文件,如下所示:
WSGIPythonHome /home/elmolino/buildout/env
LoadModule transform_module /usr/lib/apache2/modules/mod_transform.so
LoadModule filter_module /usr/lib/apache2/modules/mod_filter.so
<VirtualHost *:80>
ServerName elmolino.usecm.com
ServerAdmin xxx@xxx.com
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !/wsgi/
RewriteCond %{REQUEST_FILENAME} !/site_media/
RewriteCond %{REQUEST_FILENAME} !/static/
RewriteRule ^(.*)$ /wsgi/django.wsgi/$1 [QSA,PT,L]
LogLevel info
ErrorLog /home/elmolino/buildout/var/error_log
CustomLog /home/elmolino/buildout/var/access_log common
FilterDeclare THEME
FilterProvider THEME XSLT resp=Content-Type $text/html
TransformOptions +ApacheFS +HTML +HideParseErrors
TransformSet /home/elmolino/buildout/src/djangolino-theme/theme.xsl
# TransformCache /home/elmolino/buildout/src/djangolino-theme/theme.xsl /etc/apache2/theme.xsl
# Paths to el molino site
Alias /wsgi/ /home/elmolino/buildout/src/elmolino/apache/
<Directory /home/elmolino/buildout/src/elmolino/apache>
Options ExecCGI
SetHandler wsgi-script
FilterChain THEME
Order allow,deny
Allow from all
AuthType Basic
AuthName "ElMolino FrontEnd"
AuthUserFile /etc/apache2/authorization-users
Require valid-user
</Directory>
# serve media files
Alias /site_media "/home/elmolino/buildout/var/media"
# serve static files
Alias /static "/home/elmolino/buildout/var/static"
</VirtualHost>
然后,当我尝试访问我网站的主页时,浏览器中出现“未收到数据”错误
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.
错误日志显示以下消息:
info [client 213.97.51.211] mod_wsgi (pid=32415, process='', application='elmolino.usecm.com|/wsgi/django.wsgi'): Loading WSGI script '/home/elmolino/buildout/src/elmolino/apache/django.wsgi'.
error [client 213.97.51.211] mod_transform::libxml2_error: /home/elmolino/buildout/src/djangolino-theme/theme.xsl:1:
error [client 213.97.51.211] mod_transform::libxml2_error: parser
error [client 213.97.51.211] mod_transform::libxml2_error: error :
error [client 213.97.51.211] mod_transform::libxml2_error: Document is empty\n
error [client 213.97.51.211] mod_transform::libxml2_error: \n
error [client 213.97.51.211] mod_transform::libxml2_error: ^\n
error [client 213.97.51.211] mod_transform::libxml2_error: /home/elmolino/buildout/src/djangolino-theme/theme.xsl:1:
error [client 213.97.51.211] mod_transform::libxml2_error: parser
error [client 213.97.51.211] mod_transform::libxml2_error: error :
error [client 213.97.51.211] mod_transform::libxml2_error: Start tag expected, '<' not found\n
error [client 213.97.51.211] mod_transform::libxml2_error: \n
error [client 213.97.51.211] mod_transform::libxml2_error: ^\n
error [client 213.97.51.211] mod_transform: XSLT: Loading of the XSLT File has failed
非常感谢您的帮助!马丁