Table 1. Trac に必要なパッケージ
パッケージ | バージョン | 入手先 |
Active Python | 2.5.5.7 | ActiveState |
Python setuptools | 0.6c9(Python2.5 用) | Python Package Index : setuptools 0.6c11 |
mod_python | 3.3.1 (Windows, Apache2.2 用) | mod_python.org |
- Active Python 2.5.5.7 をダウンロード、インストールする
- Windows 用の Python setupttols 0.6c をダウンロード、インストールする
- Python25/Scripts に easy_install.exe がインストールされているので実行する
> easy_install.exe Trac Searching for Trac Reading http://pypi.python.org/simple/Trac/ Reading http://trac.edgewall.com/ Reading http://trac.edgewall.org/wiki/TracDownload Reading http://projects.edgewall.com/trac Reading http://projects.edgewall.com/trac/wiki/TracDownload Best match: Trac 0.11.4 Downloading http://pypi.python.org/packages/2.5/T/Trac/Trac-0.11.4-py2.5.egg#md5 =b97f05e8683b400c28cb022040c333e4 Processing Trac-0.11.4-py2.5.egg creating c:\usr\python25\lib\site-packages\Trac-0.11.4-py2.5.egg Extracting Trac-0.11.4-py2.5.egg to c:\usr\python25\lib\site-packages Adding Trac 0.11.4 to easy-install.pth file Installing trac-admin-script.py script to C:\usr\Python25\Scripts Installing trac-admin.exe script to C:\usr\Python25\Scripts Installing tracd-script.py script to C:\usr\Python25\Scripts Installing tracd.exe script to C:\usr\Python25\Scripts Installed c:\usr\python25\lib\site-packages\trac-0.11.4-py2.5.egg Processing dependencies for Trac Searching for Genshi>=0.5 Reading http://pypi.python.org/simple/Genshi/ Reading http://genshi.edgewall.org/ Reading http://genshi.edgewall.org/wiki/Download Best match: Genshi 0.5.1 Downloading http://ftp.edgewall.com/pub/genshi/Genshi-0.5.1-py2.5-win32.egg Processing Genshi-0.5.1-py2.5-win32.egg Moving Genshi-0.5.1-py2.5-win32.egg to c:\usr\python25\lib\site-packages Adding Genshi 0.5.1 to easy-install.pth file Installed c:\usr\python25\lib\site-packages\genshi-0.5.1-py2.5-win32.egg Finished processing dependencies for Trac
- プロジェクトディレクトリを作成する
C:\home>mkdir trac C:\home>cd trac C:\home\trac>mkdir test
- trac-admin.exe で初期化を行う
C:\home\trac\test>c:\usr\Python25\Scripts\trac-admin.exe c:\home\trac\test initenv Creating a new Trac environment at c:\home\trac\test 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]> trac_test ← プロジェクト名を入力 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]> (Enter) Please specify the type of version control system, By default, it will be svn. If you don't want to use Trac with version control integration, choose the default here and don't specify a repository directory. in the next question. Repository type [svn]> (Enter) Please specify the absolute path to the version control repository, or leave it blank to use Trac without a repository. You can also set the repository location later. Path to repository [/path/to/repos]> (Enter) Creating and Initializing Project (中略) Project environment for 'trac_test' created. You may now configure the environment by editing the file: c:\home\trac\test\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 c:\home\trac\test Then point your browser to http://localhost:8000/test. 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!
- Apache で動作するように mod_python 3.3.1 (win32, py2.5, Apache2.2) をダウンロード、インストールする
Apache のインストール先を聞かれた時はインストーラは modules ディレクトリが知りたいので bin ディレクトリではなく Apache のルートディレクトリを指定する - apache/conf/httpd.conf に以下を追記
### Trac ### LoadModule python_module modules/mod_python.so <IfModule python_module> <Location "/trac"> SetHandler mod_python PythonInterpreter main_interpreter PythonHandler trac.web.modpython_frontend PythonOption TracEnvParentDir "c:\home\trac" PythonOption TracUriRoot /trac </Location> </IfModule>
- Apache を再起動する
- ブラウザで http://localhost/trac にアクセスし trac_test プロジェクトが表示されることを確認する
- ユーザ登録 (全プロジェクトを通してのユーザ登録) をする
apache\bin\htpasswd.exe -c c:\home\trac\trac.htpasswd user-name Automatically using MD5 format. New password: ******** Re-type new password: ******** Adding password for user user-name
- httpd.conf の
で囲まれた箇所に以下を追加 AuthType Basic AuthName "Trac" AuthUserFile "c:\home\trac\trac.htpasswd" Require valid-user
- 作成したユーザに Admin 権限を与える
C:\home\trac\test>c:\usr\Python25\Scripts\trac-admin.exe c:\home\trac\test Welcome to trac-admin 0.11.4 Interactive Trac administration console. Copyright (c) 2003-2009 Edgewall Software Type: '?' or 'help' for help on commands. Trac [c:\home\trac\test]> permission add user-name TRAC_ADMIN Trac [c:\home\trac\test]> permission list user-name (user-name で指定したユーザの権限一覧が表示される) User Action -------------------------------- user-name BROWSER_VIEW user-name CHANGESET_VIEW (以下略)
0 件のコメント:
コメントを投稿