2016-07-26 36 views
0

我碰到這篇文章https://wiki.apache.org/tomcat/FAQ/Password 他們提到了使用資源實體來隱藏密碼。我在哪裏把資源實體文件放在〜tomcat /目錄下?

我照他們建議把即

<!DOCTYPE Server [ 
<!ENTITY % resources SYSTEM "resources.txt"> 
%resources; 
]> 

在server.xml中和中提到

密碼= 「資源」;

而在resources.txt我只提到密碼值說foo123。 然後我將resources.txt放置在〜tomcat/conf目錄中,與放置server.xml的位置相同。

在catalina.out中我收到錯誤,如下面

Parse Fatal Error at line 1 column 1: The markup declarations contained or 
pointed to by the document type declaration must be well-formed. 

這種設置不工作。我不知道如何調試這個問題。 你能提出一些建議嗎?

回答

0

下面是該解決方案是如何工作的:

resources.txt放在同一文件夾中的server.xml即tomcat的〜/ conf目錄/

在resources.txt你需要將信息寫入作爲一個實體

<!ENTITY resources "foo1223"> 

資源標籤這裏應與你在server.xml中

提供了什麼
相關問題