Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Windows 7 安裝 Solr 4.9 + Tomcat 8.0 完整部署指南:web.xml 配置 solr.home、collection1 複製、JAR 補充、UTF-8 編碼

編輯:Windows 7 系統介紹

環境

  • Windows 7 64-bit
  • Apache Tomcat 8.0.9 (x64)
  • Solr 4.9.0
  • JDK 1.8.0_05 (x64) — Solr 4.9 需 JDK 1.7+

核心步驟

  1. 解壓 Solr 至任意目錄(如 D:\Installed Applications\solr-4.9.0)。
  2. solr-4.9.0.war 複製到 Tomcat webapps,重命名 solr.war。
  3. 啟動 Tomcat 一次(會報錯)以自動解壓 WAR,或手動解壓至 webapps\solr。
  4. 關鍵配置:編輯 webapps\solr\WEB-INF\web.xml,找到 solr/home 參數,設為 Solr 解壓目錄下的 example 資料夾(含 collection1/conf/solrconfig.xml 與 schema.xml)。
    注意:路徑分隔符必須用正斜線 /,不可用反斜線。
  5. Solr 管理介面
  6. 將 example\solr\collection1 整個複製到 example 目錄下(使 solr/home 指向的目錄包含 collection1)。
  7. 將 example\lib\ext 下 JAR 複製到 Tomcat lib 或 webapps\solr\WEB-INF\lib。
  8. 編輯 Tomcat conf\server.xml,Connector 節點加入 URIEncoding="UTF-8" 支援中文。
  9. 重啟 Tomcat,瀏覽器開啟 https://localhost:8080/solr/admin/ 出現管理介面即成功。
  10. Solr Admin 介面

Linux 部署邏輯相同,僅路徑與指令差異。

Copyright © Windows教程網 All Rights Reserved