trac on FreeBSD

CONTENTS


Lastmodified 2015-08-07 (金) 12:58:53


FreeBSD 10.1-RELEASE-p16 Apache24

Trac

portinstall www/trac

取り敢えずsvnとは連携なしで、動作確認。sandboxをつくる。

root@g7:~ # mkdir -p /usr/local/www/trac/sandbox
root@g7:~ # trac-admin /usr/local/www/trac/sandbox initenv
Creating a new Trac environment at /usr/local/www/trac/sandbox

Trac will first ask a few questions about your environment
in order to initialize and prepare the project database.

 Please enter the name of your project.
 This name will be used in page titles and descriptions.

Project Name [My Project]> sandbox

Please specify the connection string for the database to use.
By default, a local SQLite database is created in the environment
directory. It is also possible to use an already existing
PostgreSQL database (check the Trac documentation for the exact
connection string syntax).

Database connection string [sqlite:db/trac.db]>

Creating and Initializing Project
 Installing default wiki pages
  CamelCase imported from /usr/local/lib/python2.7/site-packages/trac/wiki/default-pages/CamelCase
  InterMapTxt imported from /usr/local/lib/python2.7/site-packages/trac/wiki/default-pages/InterMapTxt
  InterTrac imported from /usr/local/lib/python2.7/site-packages/trac/wiki/default-pages/InterTrac
                             :
                             :
                             :
 WikiRestructuredText imported from /usr/local/lib/python2.7/site-packages/trac/wiki/default-pages/WikiRestructuredText
 WikiRestructuredTextLinks imported from /usr/local/lib/python2.7/site-packages/trac/wiki/default-pages/WikiRestructuredTextLinks
 WikiStart imported from /usr/local/lib/python2.7/site-packages/trac/wiki/default-pages/WikiStart

---------------------------------------------------------------------
Project environment for 'sandbox' created.

You may now configure the environment by editing the file:

  /usr/local/www/trac/sandbox/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 /usr/local/www/trac/sandbox

Then point your browser to http://localhost:8000/sandbox.
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!

root@g7:~ #
root@g7:~ # chown -R www:www /usr/local/www/trac/sandbox

Apache24 Setting

確認 /usr/local/etc/apache24/httpd.conf

LoadModule python_module      libexec/apache24/mod_python.so

見えるように設定。

# vi /usr/local/etc/apache24/Includes/trac.conf

<Location /trac>
	SetHandler mod_python
	PythonHandler trac.web.modpython_frontend
	PythonOption TracEnvParentDir /usr/local/www/trac
	PythonOption TracUriRoot /trac
</Location>

http://g7.kuji-clinic.net/trac/sandbox

Trac.PNG

Trac の設定

/usr/local/www/trac/sandbox/conf/trac.ini

[Trac]
#repository_dir = 
repository_dir = /usr/home/svn/repos/sandbox
#repository_sync_per_request = (default)
repository_sync_per_request = /usr/home/svn/repos/sandbox

SVN との接続

SVNServeが起動しない

# /usr/local/etc/rc.d/svnserve start
Starting svnserve.
su: unknown login: svn
/usr/local/etc/rc.d/svnserve: WARNING: failed to start svnserve
#
#
# pw groupadd -n svn -g 90
# pw useradd -n svn -u 90 -g svn -d /nonexistent -s /nonexistent
#
#
# /usr/local/etc/rc.d/svnserve start
Starting svnserve.
#

SVN と Tracの同期

これ、嵌まりました。 まず、trac.ini は、

[Trac]
#repository_dir = 
repository_dir = /usr/home/svn/repos/sandbox
repository_sync_per_request = (default)
#repository_sync_per_request = /usr/home/svn/repos/sandbox

と元へ戻し、コマンドラインから、repository resync すると、

# trac-admin /usr/local/www/trac/sandbox repository resync  "(default)"
TracError: Unsupported version control system "svn": Can't find an appropriate component,
maybe the corresponding plugin was not enabled?

といわれる。また、Tracのウエブ表示でも、

TracError: サポートしていないバージョン管理システム "svn": 適切なコンポーネントを見つけることができません。
対応するプラグインは、有効になっていますか?

とエラー表示がでる。

解決策は、以下の通り。 【参考URL】http://wiki.ducca.org/wiki/Trac1.0%E3%81%A8Subversion%E3%81%AE%E9%80%A3%E6%90%BA

trac.ini

[components] 項目を追加し、

tracopt.versioncontrol.svn.svn_fs.subversionconnector = enabled

を追記する。

これで、SVNのリポジトリとTracが同期しました。

Apache24 でアクセス制限

<Location /trac>
	SetHandler mod_python
	PythonHandler trac.web.modpython_frontend
	PythonOption TracEnvParentDir /usr/local/www/trac
	PythonOption TracUriRoot /trac
</Location>

<Location /trac>
  #Require all granted
  Require host .smb.net
  Require ip 192.168.1.1
  Require host .some.known.net
  Require host .aaaabbbb.info
</Location>

追加

# mkdir -p /usr/local/www/trac/RS_Base
# trac-admin /usr/local/www/trac/RS_Base initenv

# chown -R www:www /usr/local/www/trac/

/usr/local/www/trac/RS_Base/conf/trac.ini

[trac]
repository_dir = /usr/home/svn/repos/RS_Base       ← リポジトリの位置を設定する
 
以下の行を書き加える

[components] 
tracopt.versioncontrol.svn.svn_fs.subversionconnector = enabled

あとは、ブラウザからアクセスする。


Total access 3005:本日 2:昨日 0

Counter: 3005, today: 2, yesterday: 0

添付ファイル: fileTrac.PNG 856件 [詳細]

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2015-08-07 (金) 12:58:53