CentOS 6.X下Trac的部署

來源:互聯網
上載者:User

trac就是一個wiki,具體介紹可以百度下。公司一直在用trac來進行公用管理。

CentOS 5下可以直接使用yum安裝trac比較方便,而且簡單。但是新環境是CentOS 6,需要安裝trac的話就會用到python相關的源,玩過python的童鞋,應該對trac的安裝部署不在話下了。我沒學過python,還是費了些勁的。廢話不多說了,開啟簡單模式,針對CentOS x86_64 下部署安裝trac

安裝epel源;

rpm -ivh http://download.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 
#測試下能否正常運行 http://IP: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>

CentOS 5.5安裝配置Trac1.0 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.