Trac搭建

# on Unbuntu14.04, apache2.4
# apache2.2 need change access 777
sudo apt-get install python2.7  python-pip
#sudo apt-get install python2.7-dev #if header files needed
sudo pip install Genshi Trac==1.0 Babel==0.9.6
sudo apt-get install apache2-dev apache2-utils apache2-doc
sudo apt-get install libapache2-mod-fastcgi
#sudo apt-get install libapache2-mod-python libapache2-mod-wsgi

#config cgi
#sudo a2enmod mod_fastcgi #already enabled when install fastcgi module
#check /etc/apache2/mods-enabled/fastcgi.load and .conf exist.

sudo touch /etc/apache2/sites-available/trac-site

sudo cat >/etc/apache2/sites-available/trac-site <<'EOF'
<VirtualHost *:80>
        #the end slash cannot be omitted!
        ScriptAlias /trac /var/www/trac/cgi-bin/trac.fcgi/
        <Directory /var/www/trac>
                Options Indexes FollowSymLinks
                # apache2.4 syntax
                Require all granted
        </Directory>
        #change to accountmanager
        #Basic Authentication
        #<Location "/trac/login">
        #AuthType Basic
                #AuthName "Trac"
                #AuthUserFile /var/www/trac/trac.htpasswd
                #Require valid-user
        #</Location>
</VirtualHost>
#<IfModule mod_fastcgi.c>
#       FastCgiConfig -initial-env TRAC_ENV=/var/www/trac
#</IfModule>

EOF

sudo a2ensite trac-site

# refer to APACHE_RUN_USER in /etc/apache2/envvars
sudo chown www-data:www-data /var/www/trac
sudo chmod 777 /var/www/trac


#create trac environment
mkcd trac
trac-admin trac/ initenv
trac-admin trac/ deploy trac/deploy
cp -rf deploy/* .

#create link to target trac directory
sudo ln -s /var/www/trac ~/Documents/trac

#add apache2 access permissons to trac directory and files.
sudo chmod 777 trac trac/conf trac/db trac/plugins
sudo chmod 666 trac/conf/trac.ini trac/db/trac.db

#config trac
#look for help:
#trac-admin trac/demo_project help command [sub-command]
#add manager accmount
trac-admin trac/demo_project permission add admin TRAC_ADMIN
#add user permissions:
trac-admin trac/demo_project permission add user WIKI_ADMIN TICKET_ADMIN

################################
#README: https://trac-hacks.org/wiki/AccountManagerPlugin
#        https://trac-hacks.org/wiki/CookBook/AccountManagerPluginConfiguration
#define AccountManagerPlugin
#ifdef  AccountManagerPlugin
pip install -egg -t trac/plugins https://trac-hacks.org/svn/accountmanagerplugin/tags/acct_mgr-0.4.4

cat >> trac/conf/trac.ini <<'EOF'

[ticket-workflow]
complete = * -> closed
complete.default = -2
complete.permissions = TICKET_MODIFY
create = <none> -> new
create.operations = set_owner
create.permissions = TICKET_CREATE
create.set_owner = allen,ray,flynn,chenlei,challen,xuyang,wangxudong,c_cdun
leave = * -> *
leave.default = 1
leave.operations = leave_status
ongoing = * -> ongoing
ongoing.default = 0
ongoing.operations = set_owner_to_self
ongoing.permissions = TICKET_MODIFY
risk = * -> risk
risk.default = -1
risk.pemissions = TICKET_MODIFY

[components]
#https://trac-hacks.org/wiki/CookBook/AccountManagerPluginConfiguration
#trac.web.auth.loginmodule = disabled
#acct_mgr.web_ui.LoginModule = enabled
acct_mgr.admin.* = enabled
acct_mgr.api.* = enabled
acct_mgr.db.sessionstore = disabled
acct_mgr.htfile.htdigeststore = disabled
acct_mgr.htfile.htpasswdstore = enabled
acct_mgr.http.* = disabled
acct_mgr.notification.* = enabled
acct_mgr.pwhash.* = disabled
acct_mgr.register.* = enabled
acct_mgr.svnserve.svnservepasswordstore = disabled
acct_mgr.web_ui.* = enabled
acct_mgr.web_ui.resetpwstore = disabled

[account-manager]
password_store = HtPasswdStore
htpasswd_hash_type = md5
htpasswd_file = /var/www/trac/trac.htpasswd

EOF

touch trac/trac.htpasswd

#else
#config login
#only first need -c optoin:
#htpasswd -c trac/trac.htpasswd username password
#end
################################

# startup web-server
sudo apache2ctl restart




# trac standalone-server
trac-admin ~/work/trac/ ermission add admin TRAC_ADMIN
tracd --port 8099 /var/www/trac



###################################################
#    On Windows only standalone-server easy       #
###################################################
1. install python2.7
2. pip install Genshi Trac==1.0 Babel
3.
   # trac standalone-server
   trac-admin ~/work/trac/ ermission add admin TRAC_ADMIN
   tracd --port 8000 /var/www/trac
4. open chrome explorer

5. combine apache2.4 failed because of socket fromfd
6. install apache2.4
7. install mod_fastcgi.so in apache2.4/modules
8. edit httpd.conf

9. try AJP/IIS

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值