2012-01-31 33 views
0

我試圖設置Apache以應用Diazo主題,但似乎處理鏈在某個時刻暫停,產生空文件,從而導致錯誤(該錯誤僅在配置中出現FilterChain THEME時纔會出現,所以我確定它與應用主題有關)。當在Apache中應用Diazo主題時出現「文檔爲空」錯誤

到目前爲止,我已經申請了以下步驟:

首先,我編譯rules.xml中與diazocompile產生一個文件/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 [email protected] 

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 

幫助實在的欣賞ED! Maarten

回答

0

如果我使用TransformCache選項,它似乎工作。我會寫下我改變的東西(這個解決方案是基於我目前的理解,但它可能仍然不正確)。當使用TransformCache時,第一個參數是緩存文件的名稱(我懷疑它是否真的用作文件,因爲沒有創建具有此名稱的文件),第二個參數是輸入文件的名稱。緩存文件的名稱應傳遞給TransformSet:

TransformOptions +ApacheFS +HTML +HideParseErrors 
TransformSet /etc/apache2/elmolino.xsl 
TransformCache /etc/apache2/elmolino.xsl /home/elmolino/buildout/src/djangolino-theme/theme.xsl 
相關問題