trac就是一个wiki,具体介绍可以百度下。公司一直在用trac来进行公共管理。
CentOS 5下可以直接使用yum安装trac比较方便,而且简单。但是新环境是CentOS 6,需要安装trac的话就会用到python相关的源,玩过python的童鞋,应该对trac的安装部署不在话下了。我没学过python,还是费了些劲的。废话不多说了,开启简单模式,针对CentOS x86_64 下部署安装trac
安装epel源;
rpm -ivh Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
导入key:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
安装基本组件
yum -y install mysql mysql-server mysql-devel httpd mod_dav_svn mod_python MySQL-python python-devel subversion trac
#trac-admin 版本组件较低为0.12.5
数据库配置
/etc/init.d/mysqld start
#trac 只能使用utf-8字符集,否则报错
CREATE DATABASE trac_xe DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON trac_xe.* TO tracuser@'localhost' IDENTIFIED BY 'tracuser';
GRANT ALL ON trac_xe.* TO tracuser@'127.0.0.1' IDENTIFIED BY 'tracuser';
FLUSH PRIVILEGES;
初始化数据库及trac目录
mkdir -p /var/www/trac
trac-admin /var/www/trac/xe initenv
Project Name [My Project]> XoopsEngine
Database connection string [sqlite:db/trac.db]> mysql://tracuser:tracuser@127.0.0.1/trac_xe
测试trac
tracd --port 8000 /var/www/trac/xe
#测试下能否正常运行 :8000/xe 能访问,则说明trac已经安装完成
配置apache
<VirtualHost *:80>
ServerName dev.local.com
ErrorLog logs/dev.local-error_log
CustomLog logs/dev.local-access_log common
<IfModule mod_python.c>
<Location "/trac">
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /var/www/trac/xe
PythonOption TracUriRoot /trac
SetEnv PYTHON_EGG_CACHE /tmp
</Location>
<Location "/trac/login">
AuthType Basic
AuthName "dev Trac"
AuthUserFile /var/auth/passwd_op //trac登录配置文件,需要使用apache的htpasswd生成
Require valid-user
</Location>
</IfModule>
</VirtualHost>