安装trac

install trac:

on ubuntu:
  • sudo apt-get install python-setuptools
  • sudo apt-get install libmysqlclient-dev
  • sudo apt-get install python-dev
  • create a user to install & run trac
  • su trac
  • cd ~
  • mkdir ./.local/lib/python2.6/site-packages -p
  • mkdir ./.local/lib/python2.4/site-packages -p
  • easy_install –prefix=$HOME/.local  Genshi
  • easy_install –prefix=$HOME/.local  Babel
  • cd $mysqldb_source_dir
  • python ./setup.py install –prefix=$HOME/.local
  • cd $trac_source_dir
  • python ./setup.py install –prefix=$HOME/.local
  • export PATH=$PATH:$HOME/.local/bin
  • 数据库操作:
    • CREATE DATABASE trac DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
    • ALTER DATABASE `trac` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
    • GRANT ALL ON trac.* TO trac@localhost IDENTIFIED BY ‘1234’;
    • db url: mysql://trac:1234@localhost/trac
  • trac-admin ./project/demo initenv
  • trac-admin ./project/demo permission add admin TRAC_ADMIN
  • 创建密码文件:
    • assume:
      • username : admin
      • password : 1234
    • echo admin:trac:$(printf “admin:trac:1234” | md5sum | grep -o “[0-9a-zA-Z]*”) >> digest.txt
  • 使用密码文件启动
    • tracd -p port –auth=”base_project_dir,password_file_path,realm” project_path
    • tracd –port 8000 –auth=”demo,./digest.txt,trac” ./project/demo
on centos
  • export PYTHONPATH=/home/trac/.local/lib/python2.4/site-packages:/home/trac/.local/lib64/python2.4/site-packages
  • mysql://trac:password@localhost/trac_cake
log:
  • import MySQLdb
  • db=MySQLdb.connect(host=”localhost”,db=”trac”,user=”trac”,passwd=”xxxxxx”, socket=none)
  • db=MySQLdb.connect(host=”127.0.0.1″,db=”trac”,user=”trac”,passwd=”xxxxxx”, socket=none)
  • /usr/local/mysql/libexec/mysqld –basedir=/usr/local/mysql –datadir=/usr/local/mysql/var –user=mysql –log-error=/usr/local/mysql/var/uhz000263.err –pid-file=/usr/local/mysql/var/uhz000263.pid –socket=/var/lib/mysql/mysql.sock –port=3306
  • trac-admin /var/trac/project1 permission add admin TRAC_ADMIN
  • trac-admin /var/trac/project1 permission remove anonymous ‘*’
  • trac-admin /var/trac/project1 permission add @user LOG_VIEW FILE_VIEW WIKI_VIEW WIKI_CREATE WIKI_MODIFY SEARCH_VIEW REPORT_VIEW REPORT_SQL_VIEW
  • trac-admin /var/trac/project1 permission add @user TICKET_VIEW TICKET_CREATE TICKET_MODIFY BROWSER_VIEW TIMELINE_VIEW CHANGESET_VIEW ROADMAP_VIEW MILESTONE_VIEW
  • trac-admin ./project/sardine permission add authenticated TICKET_VIEW TICKET_CREATE TICKET_MODIFY BROWSER_VIEW TIMELINE_VIEW CHANGESET_VIEW ROADMAP_VIEW MILESTONE_VIEW
  • 语法颜色高亮
    • easy_install –prefix=$TRAC_LOCAL Pygments
参考:

发表评论