2007-07-13 23:22 在Windows上安裝Trac的完整步驟
雖然只知道Python的Logo是綠色的蛇,其他完全一無所知,但在TracOnWindows和網站製作學習誌的加持下,還算順利的在Windows上安裝了Trac 0.10.4。以下是安裝過程中做的筆記,主要的安裝程序是參考TracOnWindows的Method 3: Manual Installation:安裝需要的軟體
- 安裝Python 2.4.4:http://www.python.org/ftp/python/2.4.4/python-2.4.4.msi
- 下載簡易安裝程式easy_install.py: http://peak.telecommunity.com/dist/ez_setup.py
- 執行剛下載回來的ez_setup.py(雙擊即可執行),會自動下載setuptools.exe, 透過此工具以簡化後續的安裝步驟
- 安裝ClearSilver:
cd Python24scripts
easy_install -f http://clearsilver.net/downloads clearsilver==0.9.14 - 安裝PySQLite:easy_install pysqlite
- 安裝Subversion server
- 安裝Subversion Python library:easy_install -Z
http://subversion.tigris.org/downloads/svn-python-1.4.2.win32-py2.4.exe
安裝成功會出現"Processing dependencies for svn-python==1.4.2"; 這個步驟會等較久些 - 安裝Trac 0.10.4:http://ftp.edgewall.com/pub/trac/trac-0.10.4.win32.exe
- 把trac-admin和tracd少掉的副檔名給加上去:
cd Python24scripts
ren trac-admin trac-admin.py
ren tracd tracd.py
Trac系統設定
- 建立Trac環境;在這裡我把Trac裝到C:trac資料夾
以上指令中的「專案代碼」會變成網址中的webapp的文件根目錄.。執行後會以問答的方式輸入需要的資料:md trac
cd trac
Python24Scriptstrac-admin.py trac專案代碼 initenv重新啟動Apache
開始建檔環境時會出現 "Creating and Initializing Project",建立檔案後會"Indexing repository", 索引時間視檔案庫大小而定。Project Name: 專案名稱,可以用中文
Database connection string: db/trac.db 用預設值
Repository type: svnhttp://trac-hacks.org/wiki/
Path to repository: d:svn 或用UNC寫法Install
Templates directory: d:Python24sharetractemplates 用預設值重新啟動Apache重新啟動Apache - 啟動與測試:以Stand-alone的方式啟動Trac Server
啟動後在瀏覽器網址輸入 http://localhost:8000/ 或 http://localhost:8000/專案代碼 測試之。cd Python24scripts
tracd.py --port 8000 C:trac專案代碼 - 建立Trac的管理使用者
不許匿名用戶使用cd Python24scripts
trac-admin.py c:trac專案代碼 permission add admin TRAC_ADMINcd Python24scripts
trac-admin.py c:trac專案代碼 permission remove anonymous * - 安裝Plugins WebAdmin,建立管理網頁:
cd Python24scripts
easy_install http://svn.edgewall.com/repos/trac/sandbox/webadmin/ - 安裝Plugins AccountManager,以方便管理使用者:
cd Python24scripts
easy_install http://trac-hacks.org/svn/accountmanagerplugin/0.10 - 安裝Plugins IniAdmin,用網頁設定系統設定檔trac.ini:
cd Python24scripts
easy_install http://trac-hacks.org/svn/iniadminplugin
Trac和Apache Web Server的整合
- 安裝mod_python:由http://apache.stu.edu.tw/httpd/modpython/win/3.2.10/下載,選擇安裝目錄時選C:Program FilesApache GroupApache2,則mod_python.so會被安裝到c:Program FilesApache GroupApache2modules資料夾
- 修改 c:Program FilesApache GroupApache2confhttpd.conf,找到 LoadModule dav_svn_module "C:/Subversion/bin/mod_dav_svn.so"後,加入 LoadModule python_module modules/mod_python.so
- 設定網址對應,在httpd.conf最後面加上如下設定:
<Location /trac>
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir c:trac
PythonOption TracUriRoot /trac
AuthType Basic
AuthName "CompanyName"重新啟動Apache
AuthUserFile "D:/Repository/project-users.db"
Require valid-user重新啟動Apache重新啟動Apache
</Location> - 重新啟動Apache
- [/] 根目錄必須開放讀的權限給Trac的使用者,否則在瀏覽原始檔時會出現權限不足的錯誤訊息。

網頁載入中,請稍候...


