码迷,mamicode.com
首页 > 系统相关 > 详细

Ubuntu搭建trac平台步骤

时间:2015-02-14 01:19:25      阅读:299      评论:0      收藏:0      [点我收藏+]

标签:trac


Ubuntu搭建trac平台步骤:


# apt-get install apache2


# apt-get install libapache2-mod-python


# apt-get install libapache2-mod-authnz-external 


# a2enmod authnz_ldap


# apt-get install mysql-server-5.5  (设置root密码,如:123456)


# apt-get install python-mysqldb


# apt-get install python-setuptools


# easy_install Genshi==0.6


# easy_install Babel==0.9.6


# easy_install Trac==0.12.2


# mysql -u root -p123456


mysql> create database trac;


mysql> grant all on trac.* to tracadmin@‘localhost‘ identified by ‘123456‘;


mysql>  flush privileges;


mysql> quit



# mkdir -p /var/www/ming   (创建trac项目ming)


# trac-admin /var/www/ming initenv


ming


mysql://tracadmin:123456@127.0.0.1/trac


# chown -R www-data:www-data /var/www/ming  



# cp /etc/apache2/sites-available/default /etc/apache2/site-available/ming


#  vi /etc/apache2/site-available/ming


按a或i进入编辑模式


<VirtualHost 10.0.0.3:80>  (原为<VirtualHost *:80>)


DocumentRoot /var/www


<Location />

       SetHandler mod_python

       PythonInterpreter main_interpreter

       PythonHandler trac.web.modpython_frontend

       PythonOption  TracEnv /var/www/ming

       PythonOption  TracUriRoot /

       SetEnv  PYTHON_EGG_CACHE /tmp

</Location>


<Location /login>

       AuthType Basic

       AuthName "Trac"

       AuthBasicProvider "ldap"

       AuthLDAPURL  "ldap://10.0.0.3:3268/DC=ming,dc=com?sAMAccountName?sub?(objectClass=user)"

       AuthLDAPBindDN  yang@ming.com

       AuthLDAPBindPassword "123456"

       authzldapauthoritative Off

       require valid-user CN=Users,dc=ming,dc=com

</Location>


其它不变


按Esc键退出编辑模式


:wq (保存并退出)


# ln -s /etc/apache2/site-available/ming /etc/apache2/site-enabled/


# service apache2 restart



注:


如果报错:TimeoutError:Unable to get database connection within 0 seconds. (TracError 


(<babel.support.LazyProxy object at 0x7fe1d6e089b0>,))


是trac.ini的权限没设置好


# chown www-data:www-data /var/www/ming/conf/trac.ini即可





本文出自 “linux” 博客,谢绝转载!

Ubuntu搭建trac平台步骤

标签:trac

原文地址:http://yangzhiming.blog.51cto.com/4849999/1614325

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!