2014-12-04 34 views
0

apache/flask下的目錄列表。 我有一個燒瓶運行在Apache Web服務器下,這是conf文件。Apache/Flask的目錄列表問題

<VirtualHost *:80> 
DocumentRoot /Library/WebServer/Documents/wsgi/scripts/wiki 
ServerName name 

WSGIScriptAlias//Library/WebServer/Documents/wsgi/scripts/wiki.wsgi 

<Directory "/Library/WebServer/Documents/wsgi/scripts/wiki"> 
    Options Indexes MultiViews FollowSymLinks 
    AllowOverride AuthConfig All 
    Order allow,deny 
    Allow from all 
</Directory> 

ErrorLog "/private/var/log/apache2/wiki_error_log" 

</VirtualHost> 

的問題是,即使有Options Indexes,我不能訪問維基目錄中的內容。例如試圖訪問靜態目錄(.../wiki/static /)給我這個「未找到」的錯誤。

什麼可能是錯誤的?

enter image description here

回答

1

/static/正在通過瓶路由。如果你把一個文件放在那個目錄中並請求:/wiki/static/file.jpg它應該可以工作。 Flask不像Apache那樣爲靜態文件夾的根目錄提供索引。

也就是說,最好是通過你的web服務器(Apache)直接路由你的靜態文件,而不是通過Flask。