Changes between Version 2 and Version 3 of waue/TracInstall
- Timestamp:
- Feb 10, 2009, 4:51:06 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TabularUnified waue/TracInstall
v2 v3 10 10 雖然官網介紹得很詳盡,不過還是有些小細節要注意,安裝方法如下: 11 11 12 = 環境參數=13 14 == 查看 Ubuntu 機器資訊==12 == 環境參數 == 13 14 === 查看 Ubuntu 機器資訊 === 15 15 {{{ 16 16 waue@ubuntu:~$ cat /etc/lsb-release … … 23 23 }}} 24 24 25 == 環境路徑==25 === 環境路徑 === 26 26 以下內容會用到的路徑統一在此作說明解釋 27 27 … … 34 34 35 35 * Trac 安裝路徑 包含了原始的trac內容,以及程式碼,然而當你要用trac開一個專案時,Trac會要你裝在其他的路徑以做分離,免得原始的Trac跟你的專案搞混在一起,因此Trac專案根目錄就是你之後會把專案放的目錄囉! 36 36 37 = Trac 0.11 安裝 = 37 38 == 1. 軟體套件 == 38 39 39 40 安裝 apache, setuptools and some libraries: 40 * 安裝 apache, setuptools 及一些 libraries: 41 41 42 42 {{{ … … 46 46 }}} 47 47 48 === 若要安裝 Bitten === 49 雖然是選項,但我有安裝。 50 51 {{{ 52 # Needed for bitten's trac 10.4 compatiblity. 53 sudo apt-get install python-clearsilver 54 # Needed for bitten unitest. 55 sudo easy_install http://darcs.idyll.org/~t/projects/figleaf-latest.tar.gz 56 57 }}} 58 59 == 2. 新增 Trac 環境目錄 == 60 61 設定此目錄可以讓apache有讀寫權限 48 == 2. 建立 Trac 專案根目錄 == 49 50 * 建立 Trac 專案根目錄並設定apache有讀寫權限 62 51 63 52 {{{ … … 66 55 }}} 67 56 68 == 3. 設定 Apache2 == 69 70 接下來是設定trac整合到apache的步驟,先創立一個trac模型 57 == 3. 整合trac到 Apache2 == 58 設定trac整合到apache的步驟 59 60 * 先創立一個trac模型 71 61 72 62 {{{ … … 74 64 }}} 75 65 76 填入此模型的內容66 * 填入此模型的內容 77 67 78 68 {{{ … … 83 73 ErrorLog /var/log/apache2/error.trac.log 84 74 CustomLog /var/log/apache2/access.trac.log combined 75 Alias /template/chrome/common /usr/share/trac/htdocs 85 76 86 77 <Location /waue> … … 105 96 }}} 106 97 107 然後,取消default模板,換成剛剛的trac模板,然後重新啟動apache 108 98 然後,取消default模板,換成剛剛的trac模板 109 99 {{{ 110 100 sudo a2dissite default 111 101 sudo a2ensite trac 112 sudo /etc/init.d/apache2 reload 113 }}} 114 115 116 == 4. 啟動 == 117 === SVN === 118 讓trac有版本控制的功能: 102 }}} 103 104 == 4. SVN == 105 讓trac有版本控制的功能。 106 107 * 建立 /var/lib/svn 目錄來做同步的資料儲存庫,並用指令 '''svnadmin create '''開啟svn專案 108 119 109 {{{ 120 110 sudo mkdir /var/lib/svn 121 111 sudo svnadmin create /var/lib/svn/waue 122 }}}123 124 增加apache可以存取的目錄權限:125 {{{126 112 sudo chown -R www-data /var/lib/svn 127 113 sudo chown -R www-data /usr/share/trac 128 sudo /etc/init.d/apache2 reload 129 }}} 130 131 ps: References: [http://abbeyworkshop.com/howto/misc/svn01/ Commands populate files into SVN repository] 132 133 === Mercurial === 134 135 沒裝,不知道效果,原文如下: 136 137 An alternate solution is to use mercurial. if this case, do not setup any SVN (of course), indicate hg as the type of version control tool and the folder were your mercurial is. You will also need the mercurial plugin [wiki:TracMercurial Trac Mercurial] and the lastest version of mercurial from [https://help.ubuntu.com/community/UbuntuBackports#How%20to%20use the backports] 138 139 === Trac === 140 {{{/var/lib/trac/waue}}}是我trac中的專案路徑,更改其權限 141 142 {{{ 143 sudo mkdir /var/lib/trac 144 sudo trac-admin /var/lib/trac/waue initenv 145 }}} 146 147 執行trac-admin這個指令會有query詢問環境參數如何設定: 148 149 * Project Name [My Project]>''' {{{waue}}} ''' 150 * Database connection string [sqlite:db/trac.db]> ''' [Enter鍵] ''' 151 * Repository type [svn]> ''' [Enter鍵] ''' 152 * Path to repository [/path/to/repos]> ''' /var/lib/trac/waue ''' 153 154 接著設定權限 155 {{{ 156 sudo chown -R www-data /var/lib/trac 157 }}} 158 159 160 接著在瀏覽器輸入你的網址http://localhost/waue就可以看到囉! 161 '''!http://localhost/waue''' 162 163 更完整的Mod_Python設定,可以看 [http://trac.edgewall.org/wiki/TracModPython TracModPython] 164 165 166 == 5. 設定svn == 167 修改 {{{/etc/apache2/mods-available/dav_svn.conf}}} 114 }}} 115 116 修改 {{{/etc/apache2/mods-available/dav_svn.conf}}} 以設定svn目錄參數 168 117 169 118 {{{ … … 177 126 }}} 178 127 128 * ps: 關於svn detail請見 References: [http://abbeyworkshop.com/howto/misc/svn01/ Commands populate files into SVN repository] 129 130 === 5. 創建專案並啟動 Trac === 131 132 * 用指令'''trac-admin /var/lib/trac/waue initenv''',在 {{{/var/lib/trac}}}根目錄中建立一個waue專案 133 134 {{{ 135 sudo trac-admin /var/lib/trac/waue initenv 136 }}} 137 138 * 執行trac-admin這個指令會有query詢問環境參數如何設定: 139 140 * Project Name [My Project]>''' {{{waue}}} ''' 141 * Database connection string [sqlite:db/trac.db]> ''' [Enter鍵] ''' 142 * Repository type [svn]> ''' [Enter鍵] ''' 143 * Path to repository [/path/to/repos]> ''' /var/lib/svn/waue ''' 144 ps: ''Path to repository [/path/to/repos]>'' 這行要設定的是svn的路徑,設錯會有warning. 145 146 * 接著設定權限並重新啟動apache2 147 {{{ 148 sudo chown -R www-data /var/lib/trac 149 sudo /etc/init.d/apache2 reload 150 }}} 151 152 153 * 在瀏覽器輸入你的網址http://localhost/waue就可以看到Trac網頁內容囉! 154 '''!http://localhost/waue''' 155 156 ps: 更完整的Mod_Python設定,可以看 [http://trac.edgewall.org/wiki/TracModPython TracModPython] 179 157 180 158 == 6. Plugin == 159 安裝好用的套件 181 160 182 161 === apt-get trac plugins === 183 162 {{{ 184 185 163 sudo apt-get install build-essential graphviz htmldoc enscript 186 164 }}} … … 201 179 202 180 == 7. Adding Authentication == 181 做了權限設定之後,才能夠登入trac,編輯文章等等.. 203 182 204 183 === 權限設定 === 205 用 `htpasswd -c` 來創建 password 檔: 206 184 * 用 `htpasswd -c` 來創建 password 檔: 207 185 {{{ 208 186 $ htpasswd -c /etc/apache2/dav_svn.passwd admin … … 212 190 }}} 213 191 214 增加使用者也是用htpasswd,但不要加參數 "-c"192 * 增加使用者也是用htpasswd,但不要加參數 "-c" 215 193 {{{ 216 194 $ htpasswd /etc/apache2/dav_svn.passwd waue … … 220 198 }}} 221 199 222 設定Trac的login到Apache的模型(sudo vi /etc/apache2/sites-available/trac):200 * 設定Trac的login到Apache的模型(sudo vi /etc/apache2/sites-available/trac): 223 201 {{{ 224 202 <Location "/trac/login"> … … 232 210 === 多個專案 === 233 211 234 如果你有很多的project要管理,可以用下面的方法來設定多個專案:212 * 如果你有很多的project要管理,可以用下面的方法來設定多個專案: 235 213 {{{ 236 214 <LocationMatch "/trac/[^/]+/login"> … … 243 221 244 222 === 更安全的作法 === 245 安全因素考量,建立SSL連線;或AuthType用「Digest」代替 「Basic」. 更多 [http://httpd.apache.org/docs/2.0/ Apache HTTPD documentation] 。223 * 安全因素考量,建立SSL連線;或AuthType用「Digest」代替 「Basic」. 更多 [http://httpd.apache.org/docs/2.0/ Apache HTTPD documentation] 。 246 224 247 225 {{{ … … 255 233 </Location> 256 234 }}} 257 新增 .htpasswd file with htdigest instead of htpasswd as follows: 235 236 * 新增 .htpasswd file with htdigest instead of htpasswd as follows: 258 237 {{{ 259 238 # htdigest /etc/apache2/dav_svn.passwd trac admin 260 239 }}} 261 where the "trac" parameter above is the same as !AuthName above ("Realm" in apache-docs).240 * where the "trac" parameter above is the same as !AuthName above ("Realm" in apache-docs). 262 241 263 242 {{{