trac : on CentOS 5.1

インタアクトさんの日本語化判を入れてみる。

[root@localhost ~]# wget http://www.i-act.co.jp/project/products/downloads/trac-0.10.5-ja-1.zip

root@localhost trac-0.10.5-ja-1]# yum install python-setuptools

省略

Thank you for choosing Trac 0.10.5. Enjoy your stay!

[root@localhost ~]# yum install mod_auth_mysql

[root@localhost ~]# cat  auth_mysql.sql

    CREATE DATABASE webauth;
    USE webauth;

    CREATE TABLE users (
      user_name CHAR(30) NOT NULL,
      user_passwd CHAR(20) NOT NULL,
      PRIMARY KEY (user_name)
    );
    CREATE TABLE groups (
      user_name CHAR(30) NOT NULL,
      user_group CHAR(20) NOT NULL,
      PRIMARY KEY (user_name, user_group)
    );

    GRANT SELECT
      ON webauth.users
      TO webauth@localhost
      IDENTIFIED BY 'webauth';
    GRANT SELECT
      ON webauth.groups
      TO webauth@localhost
      IDENTIFIED BY 'webauth';

[root@localhost ~]# cat auth_mysql.sql  | mysql

[root@localhost ~]# echo "show databases" | mysql | grep auth
webauth

[root@localhost ~]# echo "INSERT INTO users values(‘webuser’,md5(‘webuser’));" | mysql webauth

[root@localhost ~]# echo "INSERT INTO groups values(‘webuser’,’user.project.centos.hdknr’);" | mysql webauth

[root@localhost ~]# echo "show tables" | mysql webauth -N | while read LINE ;do echo "select count(*) as ‘$LINE’ from $LINE" | mysql webauth ; done
groups
1
users
1

[root@localhost project.centos.hdknr]# more httpd.conf

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName  project.centos.hdknr 

        DocumentRoot /var/www/project.centos.hdknr/www 

        ErrorLog /var/log/httpd/project.centos.hdknr_error.log 

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg. 

        LogLevel warn 

        CustomLog /var/log/httpd/project.centos.hdknr_access.log combined
        ServerSignature On 

<Location / >
        Options All 

        AuthName "PostgreSQL group authenticated zone"
        AuthType Basic 

    AuthMYSQLEnable on
    AuthMySQLUser webauth
    AuthMySQLPassword webauth
    AuthMySQLDB webauth
    AuthMySQLUserTable users
    AuthMySQLNameField user_name
    AuthMySQLPasswordField user_passwd
    AuthMySQLGroupTable groups
    AuthMySQLPwEncryption md5


    AuthMySQLGroupField user_group 

        require group user.project.centos.hdknr
</Location>
#
<Location /svn >
  DAV svn
  SVNPath /var/www/project.centos.hdknr/svn
  SVNAutoversioning On
</Location> 

<Location /trac> 

    SetEnv PYTHON_EGG_CACHE /var/www/project.centos.hdkkr/cache
    SetHandler mod_python
    PythonHandler trac.web.modpython_frontend
    PythonOption TracEnv /var/www/project.centos.hdknr/trac
    PythonOption TracUriRoot /trac 

</Location> 

</VirtualHost>

[root@localhost sites-enabled]# ln -s /var/www/project.centos.hdknr/httpd.conf project.centos.hdknr.conf

[root@localhost sites-enabled]# /etc/init.d/httpd restart
httpd を停止中:                                            [失敗]
httpd を起動中: Syntax error on line 39 of /etc/httpd/sites-enabled/project.centos.hdknr.conf:
Unknown DAV provider: svn                                                           [失敗]

[root@localhost sites-enabled]# yum install mod_dav_svn

[root@localhost sites-enabled]# /etc/init.d/httpd restart
httpd を停止中:                                            [失敗]
httpd を起動中:                                            [  OK  ]

 

image

webuser/webuser が通らない。

[root@localhost sites-enabled]# echo "select * from groups" | mysql webauth -u webauth -p
Enter password:
user_name       user_group
webuser user.project.centos.

テーブルの定義がおかしかった。

桁数を増やしてDB再作成。

[root@localhost project.centos.hdknr]# echo "drop database webauth" | mysql

SQL修正:

    CREATE TABLE groups (
      user_name CHAR(30) NOT NULL,
      user_group CHAR(50) NOT NULL,
      PRIMARY KEY (user_name, user_group)
    );

[root@localhost project.centos.hdknr]# cat auth_mysql.sql  | mysql

[root@localhost project.centos.hdknr]# echo "INSERT INTO users values(‘webuser’,md5(‘webuser’));" | mysql webauth
[root@localhost project.centos.hdknr]# echo "INSERT INTO groups values(‘webuser’,’user.project.centos.hdknr’);" | mysql webauth

[root@localhost sites-enabled]# echo "select * from groups" | mysql webauth -u webauth -p
Enter password:
user_name       user_group
webuser user.project.centos.hdknr

[root@localhost project.centos.hdknr]# /etc/init.d/httpd restart
httpd を停止中:                                            [  OK  ]
httpd を起動中:                                            [  OK  ]

 

パスワードフィールドも短い!

[root@localhost project.centos.hdknr]# echo "select * from users " | mysql webauth    user_name       user_passwd
webuser 4664ccd28b2a73dad40e
[root@localhost project.centos.hdknr]# echo "select md5(‘webuser’)" | mysql
md5(‘webuser’)
4664ccd28b2a73dad40e2a5aa8e748f7

[root@localhost project.centos.hdknr]# vi auth_mysql.sql

    CREATE TABLE users (
      user_name CHAR(30) NOT NULL,
      user_passwd CHAR(100) NOT NULL,
      PRIMARY KEY (user_name)
    );

[root@localhost project.centos.hdknr]# !1076
echo "drop database webauth" | mysql
[root@localhost project.centos.hdknr]# !1077
cat auth_mysql.sql  | mysql
[root@localhost project.centos.hdknr]# !1078
echo "INSERT INTO users values(‘webuser’,md5(‘webuser’));" | mysql webauth
[root@localhost project.centos.hdknr]# !1079
echo "INSERT INTO groups values(‘webuser’,’user.project.centos.hdknr’);" | mysql webauth

[root@localhost project.centos.hdknr]# !1090
echo "select * from users where user_passwd = md5(‘webuser’)" | mysql webauth
user_name       user_passwd
webuser 4664ccd28b2a73dad40e2a5aa8e748f7

WS000057

svnはDAVでいけています。

WS000058

[root@localhost trac]# vi conf/trac.ini

[header_logo]
alt =
height = -1
link = http://project.centos.hdknr
src = common/trac_banner.png
width = -1

[trac]
authz_file =
authz_module_name =
base_url =
check_auth_ip = true
database = sqlite:db/trac.db
default_charset = shift_jis
default_handler = WikiModule
htdocs_location =
ignore_auth_case = false
mainnav = wiki,timeline,roadmap,browser,tickets,newticket,search
metanav = login,logout,settings,help,about
permission_store = DefaultPermissionStore
repository_dir = /var/www/project.centos.hdknr/svn
repository_type = svn
templates_dir = /var/www/project.centos.hdknr/trac-templates
timeout = 20

[root@localhost project.centos.hdknr]# ls -al
合計 36
drwxr-xr-x  6 hide hide 4096  7月  4 11:30 .
drwxr-xr-x 12 root root 4096  7月  4 10:34 ..
-rw-r–r–  1 root root  527  7月  4 11:16 auth_mysql.sql
-rw-r–r–  1 root root 1246  7月  4 11:19 httpd.conf
drwxrwxr-x  7 hide hide 4096 11月 13  2007 svn
drwxr-xr-x 10 hide hide 4096 11月 13  2007 trac
drwxr-xr-x  2 root root 4096  7月  4 11:30 trac-templates
drwxr-xr-x  2 root root 4096  7月  4 10:52 www

バージョンアップ

[root@localhost project.centos.hdknr]# trac-admin trac upgrade
Database is up to date, no upgrade necessary.

[root@localhost project.centos.hdknr]# trac-admin trac resync
Resyncing repository history…
423 revisions cached. Done.

WS000059

PythonHandler trac.web.modpython_frontend: Traceback (most recent call last):
PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch\n    result = object(req)
PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/trac/web/modpython_frontend.py", line 87, in handler\n    gateway.run(dispatch_request)
PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/trac/web/wsgi.py", line 87, in run\n    response = application(self.environ, self._start_response)
PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 430, in dispatch_request\n    env.log.exception(e)

PythonHandler trac.web.modpython_frontend: AttributeError: ‘NoneType’ object has no attribute ‘log’

[root@localhost project.centos.hdknr]# mv trac trac_org

[root@localhost project.centos.hdknr]# trac-admin trac initenv

途中省略。

Indexing repository
[423]
———————————————————————
Project environment for ‘CentOsProject’ created.

You may now configure the environment by editing the file:

  /var/www/project.centos.hdknr/trac/conf/trac.ini

If you’d like to take this new project environment for a test drive,
try running the Trac standalone web server `tracd`:

  tracd –port 8000 /var/www/project.centos.hdknr/trac

Then point your browser to http://localhost:8000/trac.
There you can also browse the documentation for your installed
version of Trac, including information on further setup (such as
deploying Trac to a real web server).

The latest documentation can also always be found on the project
website:

http://trac.edgewall.org/

Congratulations!

でWebでアクセスしてみましたが、同じエラーですね。。。。。

時間無いので終了。

カテゴリー: 未分類 パーマリンク

trac : on CentOS 5.1 への2件のフィードバック

  1. Unknown より:

    Hi,Do you need ad players, advertisement player and LCD advertisings? Please go Here:www.amberdigital.com.hk(Amberdigital).we have explored and developed the international market with professionalism. We have built a widespread marketing network, and set up a capable management team dedicated to provide beyond-expectation services to our customers.
    amberdigital Contact Us

    E-mail:sstar@netvigator.com
    website:www.amberdigital.com.hk
    alibaba:amberdigital.en.alibaba.com[efgihicafgfegb]

  2. Unknown より:

    Hi,Do you need advertising displays, advertisement screens, LCD digital signage and LCD signages? Please go Here:www.amberdigital.com.hk(Amberdigital).we have explored and developed the international market with professionalism. We have built a widespread marketing network, and set up a capable management team dedicated to provide beyond-expectation services to our customers.
    amberdigital Contact Us
    website:www.amberdigital.com.hk
    alibaba:amberdigital.en.alibaba.com[dgfgbjjjfbifejb]

コメントを残す

以下に詳細を記入するか、アイコンをクリックしてログインしてください。

WordPress.com ロゴ

WordPress.com アカウントを使ってコメントしています。 ログアウト / 変更 )

Twitter 画像

Twitter アカウントを使ってコメントしています。 ログアウト / 変更 )

Facebook の写真

Facebook アカウントを使ってコメントしています。 ログアウト / 変更 )

Google+ フォト

Google+ アカウントを使ってコメントしています。 ログアウト / 変更 )

%s と連携中