Changes between Version 2 and Version 3 of waue/TracInstall


Ignore:
Timestamp:
Feb 10, 2009, 4:51:06 PM (15 years ago)
Author:
waue
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • waue/TracInstall

    v2 v3  
    1010雖然官網介紹得很詳盡,不過還是有些小細節要注意,安裝方法如下:
    1111
    12 = 環境參數 =
    13 
    14 == 查看 Ubuntu 機器資訊 ==
     12== 環境參數 ==
     13
     14=== 查看 Ubuntu 機器資訊 ===
    1515{{{
    1616waue@ubuntu:~$ cat /etc/lsb-release
     
    2323}}}
    2424
    25 == 環境路徑 ==
     25=== 環境路徑 ===
    2626以下內容會用到的路徑統一在此作說明解釋
    2727
     
    3434
    3535 * Trac 安裝路徑 包含了原始的trac內容,以及程式碼,然而當你要用trac開一個專案時,Trac會要你裝在其他的路徑以做分離,免得原始的Trac跟你的專案搞混在一起,因此Trac專案根目錄就是你之後會把專案放的目錄囉!
     36
    3637= Trac 0.11 安裝 =
    3738== 1. 軟體套件 ==
    3839
    39 
    40 安裝 apache, setuptools and some libraries:
     40 * 安裝 apache, setuptools 及一些 libraries:
    4141
    4242{{{
     
    4646}}}
    4747
    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有讀寫權限
    6251
    6352{{{
     
    6655}}}
    6756
    68 == 3. 設定 Apache2 ==
    69 
    70 接下來是設定trac整合到apache的步驟,先創立一個trac模型
     57== 3. 整合trac到 Apache2 ==
     58設定trac整合到apache的步驟
     59
     60 * 先創立一個trac模型
    7161
    7262{{{
     
    7464}}}
    7565
    76 填入此模型的內容
     66 * 填入此模型的內容
    7767
    7868{{{
     
    8373        ErrorLog /var/log/apache2/error.trac.log
    8474        CustomLog /var/log/apache2/access.trac.log combined
     75        Alias       /template/chrome/common  /usr/share/trac/htdocs
    8576
    8677        <Location /waue>
     
    10596}}}
    10697
    107 然後,取消default模板,換成剛剛的trac模板,然後重新啟動apache
    108 
     98然後,取消default模板,換成剛剛的trac模板
    10999{{{
    110100sudo a2dissite default
    111101sudo 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
    119109{{{
    120110sudo mkdir /var/lib/svn
    121111sudo svnadmin create /var/lib/svn/waue
    122 }}}
    123 
    124 增加apache可以存取的目錄權限:
    125 {{{
    126112sudo chown -R www-data /var/lib/svn
    127113sudo 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目錄參數
    168117
    169118{{{ 
     
    177126}}}
    178127
     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{{{
     135sudo 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{{{
     148sudo chown -R www-data /var/lib/trac
     149sudo /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]
    179157
    180158== 6. Plugin ==
     159安裝好用的套件
    181160
    182161=== apt-get trac plugins  ===
    183162{{{
    184 
    185163sudo apt-get install build-essential graphviz htmldoc enscript
    186164}}}
     
    201179 
    202180== 7. Adding Authentication ==
     181做了權限設定之後,才能夠登入trac,編輯文章等等..
    203182
    204183=== 權限設定 ===
    205 用 `htpasswd -c` 來創建 password 檔:
    206 
     184 * 用 `htpasswd -c` 來創建 password 檔:
    207185{{{
    208186$ htpasswd -c /etc/apache2/dav_svn.passwd admin
     
    212190}}}
    213191
    214 增加使用者也是用htpasswd,但不要加參數 "-c"
     192 * 增加使用者也是用htpasswd,但不要加參數 "-c"
    215193{{{
    216194$ htpasswd /etc/apache2/dav_svn.passwd waue
     
    220198}}}
    221199
    222 設定Trac的login到Apache的模型(sudo vi /etc/apache2/sites-available/trac):
     200 * 設定Trac的login到Apache的模型(sudo vi /etc/apache2/sites-available/trac):
    223201{{{
    224202<Location "/trac/login">
     
    232210=== 多個專案 ===
    233211
    234 如果你有很多的project要管理,可以用下面的方法來設定多個專案:
     212 * 如果你有很多的project要管理,可以用下面的方法來設定多個專案:
    235213{{{
    236214<LocationMatch "/trac/[^/]+/login">
     
    243221
    244222=== 更安全的作法 ===
    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] 。
    246224
    247225{{{
     
    255233</Location>
    256234}}}
    257 新增 .htpasswd file with htdigest instead of htpasswd as follows:
     235
     236 * 新增 .htpasswd file with htdigest instead of htpasswd as follows:
    258237{{{
    259238# htdigest /etc/apache2/dav_svn.passwd trac admin
    260239}}}
    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).
    262241
    263242{{{