Trac安装记录
[email protected]
2009-11-24
.安装Python的easy setup工具:
[root@jupiter trac]# wget -q http://peak.telecommunity.com/dist/ez_setup.py
[root@jupiter trac]# python ez_setup.py
Downloading http://pypi.python.org/packages/2.4/s/setuptools/setuptools-0.6c11-py2.4.egg
Processing setuptools-0.6c11-py2.4.egg
creating /usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg
Extracting setuptools-0.6c11-py2.4.egg to /usr/lib/python2.4/site-packages
Adding setuptools 0.6c11 to easy-install.pth file
Installing easy_install script to /usr/bin
Installing easy_install-2.4 script to /usr/bin
Installed /usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11
.使用easy setup tools安装Trac
[root@jupiter trac]# easy_install 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.6rc1
Downloading ftp://ftp.edgewall.com/pub/trac/Trac-0.11.6rc1.zip
Processing Trac-0.11.6rc1.zip
Running Trac-0.11.6rc1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-XX8XR8/Trac-0.11.6rc1/egg-dist-tmp-ZS07YU
Adding Trac 0.11.6rc1 to easy-install.pth file
Installing trac-admin script to /usr/bin
Installing tracd script to /usr/bin
Installed /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.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.4-linux-i686.egg
Processing Genshi-0.5.1-py2.4-linux-i686.egg
Moving Genshi-0.5.1-py2.4-linux-i686.egg to /usr/lib/python2.4/site-packages
Adding Genshi 0.5.1 to easy-install.pth file
Installed /usr/lib/python2.4/site-packages/Genshi-0.5.1-py2.4-linux-i686.egg
Finished processing dependencies for Trac
.创建项目目录
[root@jupiter share]# cd /opt/
[root@jupiter opt]# mkdir trac
[root@jupiter opt]# cd trac/
[root@jupiter trac]# mkdir projects
[root@jupiter trac]# cd projects/
[root@jupiter projects]# mkdir hotspot
[root@jupiter projects]# cd hotspot/
[root@jupiter hotspot]# trac-admin . initenv
Creating a new Trac environment at /opt/trac/projects/hotspot
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]> Hotspot
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]>
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]>
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]>
Creating and Initializing Project
Installing default wiki pages
WikiHtml imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-pages/WikiHtml
CamelCase imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-pages/CamelCase
TracRss imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-pages/TracRss
TracStandalone imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracStandalone
TracCgi imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-pages/TracCgi
TracFastCgi imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracFastCgi
TracNotification imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracNotification
TracWorkflow imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracWorkflow
WikiMacros imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/WikiMacros
WikiPageNames imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/WikiPageNames
RecentChanges imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/RecentChanges
TracTicketsCustomFields imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracTicketsCustomFields
TracImport imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracImport
TracBrowser imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracBrowser
TracQuery imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-pages/TracQuery
TitleIndex imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TitleIndex
WikiNewPage imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/WikiNewPage
TracAdmin imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-pages/TracAdmin
TracSyntaxColoring imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracSyntaxColoring
TracAccessibility imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracAccessibility
TracNavigation imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracNavigation
TracTimeline imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracTimeline
SandBox imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-pages/SandBox
TracInstall imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracInstall
WikiDeletePage imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/WikiDeletePage
TracRevisionLog imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracRevisionLog
TracModPython imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracModPython
TracPermissions imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracPermissions
TracTickets imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracTickets
TracBackup imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracBackup
TracUnicode imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracUnicode
TracIni imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-pages/TracIni
WikiRestructuredText imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/WikiRestructuredText
TracLogging imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracLogging
TracModWSGI imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracModWSGI
TracInterfaceCustomization imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-
py2.4.egg/trac/wiki/default-pages/TracInterfaceCustomization
TracRoadmap imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracRoadmap
WikiFormatting imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/WikiFormatting
TracUpgrade imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracUpgrade
WikiStart imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-pages/WikiStart
InterTrac imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-pages/InterTrac
TracFineGrainedPermissions imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-
py2.4.egg/trac/wiki/default-pages/TracFineGrainedPermissions
TracWiki imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-pages/TracWiki
TracSupport imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracSupport
TracReports imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracReports
TracChangeset imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracChangeset
TracLinks imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-pages/TracLinks
TracSearch imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracSearch
WikiProcessors imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/WikiProcessors
PageTemplates imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/PageTemplates
InterWiki imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-pages/InterWiki
WikiRestructuredTextLinks imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default
-pages/WikiRestructuredTextLinks
TracGuide imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-pages/TracGuide
InterMapTxt imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/InterMapTxt
TracEnvironment imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracEnvironment
TracPlugins imported from /usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/wiki/default-
pages/TracPlugins
---------------------------------------------------------------------
Project environment for 'Hotspot' created.
You may now configure the environment by editing the file:
/opt/trac/projects/hotspot/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 /opt/trac/projects/hotspot
Then point your browser to http://localhost:8000/hotspot.
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@jupiter hotspot]# ll
total 36
drwxr-xr-x 2 root root 4096 Nov 24 16:07 attachments
drwxr-xr-x 2 root root 4096 Nov 24 16:07 conf
drwxr-xr-x 2 root root 4096 Nov 24 16:09 db
drwxr-xr-x 2 root root 4096 Nov 24 16:07 htdocs
drwxr-xr-x 2 root root 4096 Nov 24 16:07 log
drwxr-xr-x 2 root root 4096 Nov 24 16:07 plugins
-rw-r--r-- 1 root root 98 Nov 24 16:07 README
drwxr-xr-x 2 root root 4096 Nov 24 16:07 templates
-rw-r--r-- 1 root root 27 Nov 24 16:07 VERSION
.生成Fast-CGI脚本(可选,如果不打算使用CGI的方式可以跳过)
[root@jupiter hotspot]# pwd
/opt/trac/projects/hotspot
[root@jupiter hotspot]# trac-admin . deploy /tmp/deploy
Copying resources from:
trac.web.chrome.Chrome
/usr/lib/python2.4/site-packages/Trac-0.11.6rc1-py2.4.egg/trac/htdocs
/opt/trac/projects/hotspot/htdocs
Creating scripts.
[root@jupiter hotspot]# mv /tmp/deploy/* /opt/trac/
.直接启动trac
[root@jupiter hotspot]# tracd --port 8000 /opt/trac/projects/hotspot
.使用Apache
#vi /etc/httpd/conf/httpd.conf
增加
<Location /trac/hotspot>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /opt/trac/projects
PythonOption TracEnv /opt/trac/projects/hotspot
PythonOption TracUriRoot /trac/hotspot
PythonOption TracLocale en_GB.UTF8
PythonOption PYTHON_EGG_CACHE /tmp
</Location>
<LocationMatch "/trac/[^/]+/login">
AuthType Basic
AuthName "Trac"
AuthUserFile /opt/trac/.htpasswd
Require valid-user
</LocationMatch>
增加2个用户:
# htpasswd /opt/trac/.htpasswd test
# htpasswd /opt/trac/.htpasswd admin
授予admin用于管理员权限,这样可以使用WEB的admin标签来管理trac
# cd /opt/trac/projects/hotspot
# trac-admin . permission add admin TRAC_ADMIN
访问:http://xx.xx.xx.xx/trac/hotspot
可选安装插件:Accountmanagerplugin (通过WEB页面管理用户的插件)
[root@jupiter trac]# easy_install http://trac-hacks.org/svn/accountmanagerplugin/0.11
Downloading http://trac-hacks.org/svn/accountmanagerplugin/0.11
Doing subversion checkout from http://trac-hacks.org/svn/accountmanagerplugin/0.11 to /tmp/easy_install-OficKG/0.11
Processing 0.11
Running setup.py -q bdist_egg --dist-dir /tmp/easy_install-OficKG/0.11/egg-dist-tmp--cyj8O
Adding TracAccountManager 0.2.1dev-r7163 to easy-install.pth file
Installed /usr/lib/python2.4/site-packages/TracAccountManager-0.2.1dev_r7163-py2.4.egg
Processing dependencies for TracAccountManager==0.2.1dev-r7163
Finished processing dependencies for TracAccountManager==0.2.1dev-r7163
配置Accountmanagerplugin:(修改trac.ini文件)
[components]
acct_mgr.admin.accountmanageradminpage = enabled
acct_mgr.api.accountmanager = enabled
acct_mgr.htfile.abstractpasswordfilestore = enabled
acct_mgr.htfile.htpasswdstore = enabled
acct_mgr.notification.accountchangenotificationadminpanel = enabled
acct_mgr.web_ui.accountmodule = enabled
acct_mgr.web_ui.loginmodule = enabled
acct_mgr.web_ui.registrationmodule = enabled
trac.web.auth.loginmodule = disabled
[account-manager]
password_file = /opt/trac/.htpasswd
password_store = HtPasswdStore
去掉Apache配置文件/etc/httpd/conf/httpd.conf中的
<LocationMatch "/trac/[^/]+/login">
AuthType Basic
AuthName "Trac"
AuthUserFile /opt/trac/.htpasswd
Require valid-user
</LocationMatch>