个人工具

“UbuntuHelp:UbuntuTracHowto”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/UbuntuTracHowto}} {{Languages|UbuntuHelp:UbuntuTracHowto}} There are "better" instructions at http://trac.edgewall.org/wiki/TracOnUbuntu == Loc...)
 
第2行: 第2行:
 
{{Languages|UbuntuHelp:UbuntuTracHowto}}
 
{{Languages|UbuntuHelp:UbuntuTracHowto}}
 
There are "better" instructions at http://trac.edgewall.org/wiki/TracOnUbuntu
 
There are "better" instructions at http://trac.edgewall.org/wiki/TracOnUbuntu
 
 
 
 
== Localhost setup ==
 
== Localhost setup ==
 
'''Steps to get Trac working on your computer from commandline'''
 
'''Steps to get Trac working on your computer from commandline'''
 
 
<!> ''I ommited the full path to the dir where i installed my Trac instance, so instead of reading the whole path, you'll only see <code><nowiki>path/to/MhzProjects/</nowiki></code>''
 
<!> ''I ommited the full path to the dir where i installed my Trac instance, so instead of reading the whole path, you'll only see <code><nowiki>path/to/MhzProjects/</nowiki></code>''
 
 
 
* Decide where you'd like to run SVN and Trac. In my case, I decided to use a dir called <code><nowiki>MhzSvn</nowiki></code> and one called <code><nowiki>MhzTrac</nowiki></code>, both under <code><nowiki>MhzProjects/</nowiki></code>. So <code><nowiki>cd</nowiki></code> to that dir
 
* Decide where you'd like to run SVN and Trac. In my case, I decided to use a dir called <code><nowiki>MhzSvn</nowiki></code> and one called <code><nowiki>MhzTrac</nowiki></code>, both under <code><nowiki>MhzProjects/</nowiki></code>. So <code><nowiki>cd</nowiki></code> to that dir
 
<pre><nowiki>
 
<pre><nowiki>
 
$ cd path/to/MhzProjects/
 
$ cd path/to/MhzProjects/
 
</nowiki></pre>
 
</nowiki></pre>
 
 
* Install Trac and say <code><nowiki>Y</nowiki></code> to install everything needed (apache, svn and some python stuff)
 
* Install Trac and say <code><nowiki>Y</nowiki></code> to install everything needed (apache, svn and some python stuff)
 
<pre><nowiki>
 
<pre><nowiki>
 
$ sudo apt-get install trac
 
$ sudo apt-get install trac
 
Password:
 
Password:
 
 
</nowiki></pre>
 
</nowiki></pre>
 
 
* Create a dir for SVN to work with Trac, then <code><nowiki>ls</nowiki></code> to see what SVN just created for you
 
* Create a dir for SVN to work with Trac, then <code><nowiki>ls</nowiki></code> to see what SVN just created for you
 
<pre><nowiki>
 
<pre><nowiki>
 
$ svnadmin create MhzSvn
 
$ svnadmin create MhzSvn
 
 
$ ls MhzSvn/
 
$ ls MhzSvn/
 
conf  dav  db  format  hooks  locks  README.txt
 
conf  dav  db  format  hooks  locks  README.txt
 
</nowiki></pre>
 
</nowiki></pre>
 
 
* Let Trac create everything for you. I decided to call my trac ''MhzStuff''
 
* Let Trac create everything for you. I decided to call my trac ''MhzStuff''
 
<pre><nowiki>
 
<pre><nowiki>
 
/path/to/MhzProjects $ trac-admin MhzTrac initenv
 
/path/to/MhzProjects $ trac-admin MhzTrac initenv
 
Creating a new Trac environment at path/to/MhzProjects/MhzTrac
 
Creating a new Trac environment at path/to/MhzProjects/MhzTrac
 
 
Trac will first ask a few questions about your environment
 
Trac will first ask a few questions about your environment
 
in order to initalize and prepare the project database.
 
in order to initalize and prepare the project database.
 
 
Please enter the name of your project.
 
Please enter the name of your project.
 
This name will be used in page titles and descriptions.
 
This name will be used in page titles and descriptions.
 
 
Project Name [My Project]> MhzStuff
 
Project Name [My Project]> MhzStuff
 
 
Please specify the absolute path to the project Subversion repository.
 
Please specify the absolute path to the project Subversion repository.
 
Repository must be local, and trac-admin requires read+write
 
Repository must be local, and trac-admin requires read+write
 
permission to initialize the Trac database.
 
permission to initialize the Trac database.
 
 
Path to repository [/var/svn/test]> path/to/MhzProjects/MhzSvn/
 
Path to repository [/var/svn/test]> path/to/MhzProjects/MhzSvn/
 
 
Please enter location of Trac page templates.
 
Please enter location of Trac page templates.
 
Default is the location of the site-wide templates installed with Trac.
 
Default is the location of the site-wide templates installed with Trac.
 
 
Templates directory [/usr/share/trac/templates]>
 
Templates directory [/usr/share/trac/templates]>
 
Creating and Initializing Project
 
Creating and Initializing Project
第106行: 第88行:
 
Indexing repository
 
Indexing repository
 
---------------------------------------------------------------------
 
---------------------------------------------------------------------
 
 
Project database for 'MhzStuff' created.
 
Project database for 'MhzStuff' created.
 
 
Customize settings for your project using the command:
 
Customize settings for your project using the command:
 
 
trac-admin /path/to/MhzProjects/MhzTrac
 
trac-admin /path/to/MhzProjects/MhzTrac
 
 
Don't forget, you also need to copy (or symlink) "trac/cgi-bin/trac.cgi"
 
Don't forget, you also need to copy (or symlink) "trac/cgi-bin/trac.cgi"
 
to you web server's /cgi-bin/ directory, and then configure the server.
 
to you web server's /cgi-bin/ directory, and then configure the server.
 
 
If you're using Apache, this config example snippet might be helpful:
 
If you're using Apache, this config example snippet might be helpful:
 
 
Alias /trac "/wherever/you/installed/trac/htdocs/"
 
Alias /trac "/wherever/you/installed/trac/htdocs/"
 
<Location "/cgi-bin/trac.cgi">
 
<Location "/cgi-bin/trac.cgi">
 
SetEnv TRAC_ENV "path/to/Work/MhzProjects/MhzTrac"
 
SetEnv TRAC_ENV "path/to/Work/MhzProjects/MhzTrac"
 
</Location>
 
</Location>
 
 
# You need something like this to authenticate users
 
# You need something like this to authenticate users
 
<Location "/cgi-bin/trac.cgi/login">
 
<Location "/cgi-bin/trac.cgi/login">
第130行: 第105行:
 
Require valid-user
 
Require valid-user
 
</Location>
 
</Location>
 
 
The latest documentation can also always be found on the project website:
 
The latest documentation can also always be found on the project website:
 
http://projects.edgewall.com/trac/
 
http://projects.edgewall.com/trac/
 
 
Congratulations!
 
Congratulations!
 
 
$
 
$
 
</nowiki></pre>
 
</nowiki></pre>
 
 
* Let's see what Trac created for us
 
* Let's see what Trac created for us
 
<pre><nowiki>
 
<pre><nowiki>
第152行: 第123行:
 
drwxr-xr-x  2 mhz rojo 4.0K 2006-01-04 15:58 wiki-macros
 
drwxr-xr-x  2 mhz rojo 4.0K 2006-01-04 15:58 wiki-macros
 
</nowiki></pre>
 
</nowiki></pre>
 
 
* Edit <code><nowiki>apache2.conf</nowiki></code>
 
* Edit <code><nowiki>apache2.conf</nowiki></code>
 
<pre><nowiki>
 
<pre><nowiki>
第158行: 第128行:
 
Password:
 
Password:
 
</nowiki></pre>
 
</nowiki></pre>
 
 
* Add these lines at the end of the file
 
* Add these lines at the end of the file
 
<pre><nowiki>
 
<pre><nowiki>
第166行: 第135行:
 
</Location>
 
</Location>
 
</nowiki></pre>
 
</nowiki></pre>
 
 
* Re-start apache
 
* Re-start apache
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo /etc/init.d/apache2 restart
 
sudo /etc/init.d/apache2 restart
 
</nowiki></pre>
 
</nowiki></pre>
 
 
* Start Trac
 
* Start Trac
 
<pre><nowiki>
 
<pre><nowiki>
 
tracd --port 8000 path/to/MhzProjects/MhzTrac/
 
tracd --port 8000 path/to/MhzProjects/MhzTrac/
 
</nowiki></pre>
 
</nowiki></pre>
 
 
* Open your browser and visit <code><nowiki>http://localhost:8000</nowiki></code>
 
* Open your browser and visit <code><nowiki>http://localhost:8000</nowiki></code>
 
 
'''There is a mistake in this configuration'''
 
'''There is a mistake in this configuration'''
 
<pre><nowiki>
 
<pre><nowiki>
 
The configuration of apache2 as in the example above implies that you want to run trac via the cgi script; rather than with tracd.  tracd is a substitute for apache.  If you attempt to run tracd after starting apache2, you might receive : "socket.error: (98, 'Address already in use')"  Will someone who is more familiar please verify this, and correct these instructions.  -cullen
 
The configuration of apache2 as in the example above implies that you want to run trac via the cgi script; rather than with tracd.  tracd is a substitute for apache.  If you attempt to run tracd after starting apache2, you might receive : "socket.error: (98, 'Address already in use')"  Will someone who is more familiar please verify this, and correct these instructions.  -cullen
 
</nowiki></pre>
 
</nowiki></pre>
 
 
== Server setup ==
 
== Server setup ==
 
/!\ '''Pending'''
 
/!\ '''Pending'''
 
 
 
[[category:CategoryDocumentation]] [[category:CategoryCleanup]] [[category:CategoryCleanup]]
 
[[category:CategoryDocumentation]] [[category:CategoryCleanup]] [[category:CategoryCleanup]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 21:57的版本

There are "better" instructions at http://trac.edgewall.org/wiki/TracOnUbuntu

Localhost setup

Steps to get Trac working on your computer from commandline <!> I ommited the full path to the dir where i installed my Trac instance, so instead of reading the whole path, you'll only see path/to/MhzProjects/

  • Decide where you'd like to run SVN and Trac. In my case, I decided to use a dir called MhzSvn and one called MhzTrac, both under MhzProjects/. So cd to that dir
$ cd path/to/MhzProjects/
  • Install Trac and say Y to install everything needed (apache, svn and some python stuff)
$ sudo apt-get install trac
Password:
  • Create a dir for SVN to work with Trac, then ls to see what SVN just created for you
$ svnadmin create MhzSvn
$ ls MhzSvn/
conf  dav  db  format  hooks  locks  README.txt
  • Let Trac create everything for you. I decided to call my trac MhzStuff
/path/to/MhzProjects $ trac-admin MhzTrac initenv
Creating a new Trac environment at path/to/MhzProjects/MhzTrac
Trac will first ask a few questions about your environment
in order to initalize 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]> MhzStuff
Please specify the absolute path to the project Subversion repository.
Repository must be local, and trac-admin requires read+write
permission to initialize the Trac database.
Path to repository [/var/svn/test]> path/to/MhzProjects/MhzSvn/
Please enter location of Trac page templates.
Default is the location of the site-wide templates installed with Trac.
Templates directory [/usr/share/trac/templates]>
Creating and Initializing Project
Inserting default data
Configuring Project
trac.repository_dir
trac.templates_dir
project.name
Installing wiki pages
/usr/share/trac/wiki-default/TracImport => TracImport
/usr/share/trac/wiki-default/TracRss => TracRss
/usr/share/trac/wiki-default/TracMultipleProjects => TracMultipleProjects
/usr/share/trac/wiki-default/TracBackup => TracBackup
/usr/share/trac/wiki-default/TracTimeline => TracTimeline
/usr/share/trac/wiki-default/TracTickets => TracTickets
/usr/share/trac/wiki-default/TracInstall => TracInstall
/usr/share/trac/wiki-default/WikiRestructuredText => WikiRestructuredText
/usr/share/trac/wiki-default/WikiPageNames => WikiPageNames
/usr/share/trac/wiki-default/TracSyntaxColoring => TracSyntaxColoring
/usr/share/trac/wiki-default/TracPermissions => TracPermissions
/usr/share/trac/wiki-default/TracSupport => TracSupport
/usr/share/trac/wiki-default/WikiHtml => WikiHtml
/usr/share/trac/wiki-default/TracModPython => TracModPython
/usr/share/trac/wiki-default/WikiFormatting => WikiFormatting
/usr/share/trac/wiki-default/TracBrowser => TracBrowser
/usr/share/trac/wiki-default/TracTicketsCustomFields => TracTicketsCustomFields
/usr/share/trac/wiki-default/TracNotification => TracNotification
/usr/share/trac/wiki-default/TracUnicode => TracUnicode
/usr/share/trac/wiki-default/TracAccessibility => TracAccessibility
/usr/share/trac/wiki-default/TracInstallPlatforms => TracInstallPlatforms
/usr/share/trac/wiki-default/TracReports => TracReports
/usr/share/trac/wiki-default/TracEnvironment => TracEnvironment
/usr/share/trac/wiki-default/WikiMacros => WikiMacros
/usr/share/trac/wiki-default/CamelCase => CamelCase
/usr/share/trac/wiki-default/WikiProcessors => WikiProcessors
/usr/share/trac/wiki-default/TracSearch => TracSearch
/usr/share/trac/wiki-default/TracQuery => TracQuery
/usr/share/trac/wiki-default/WikiStart => WikiStart
/usr/share/trac/wiki-default/TracLogging => TracLogging
/usr/share/trac/wiki-default/SandBox => SandBox
/usr/share/trac/wiki-default/WikiRestructuredTextLinks => WikiRestructuredTextLinks
/usr/share/trac/wiki-default/TracLinks => TracLinks
/usr/share/trac/wiki-default/TracRoadmap => TracRoadmap
/usr/share/trac/wiki-default/TracStandalone => TracStandalone
/usr/share/trac/wiki-default/TracUpgrade => TracUpgrade
/usr/share/trac/wiki-default/RecentChanges => RecentChanges
/usr/share/trac/wiki-default/TracAdmin => TracAdmin
/usr/share/trac/wiki-default/TracGuide => TracGuide
/usr/share/trac/wiki-default/TracChangeset => TracChangeset
/usr/share/trac/wiki-default/TitleIndex => TitleIndex
/usr/share/trac/wiki-default/WikiNewPage => WikiNewPage
/usr/share/trac/wiki-default/TracWiki => TracWiki
Indexing repository
---------------------------------------------------------------------
Project database for 'MhzStuff' created.
Customize settings for your project using the command:
trac-admin /path/to/MhzProjects/MhzTrac
Don't forget, you also need to copy (or symlink) "trac/cgi-bin/trac.cgi"
to you web server's /cgi-bin/ directory, and then configure the server.
If you're using Apache, this config example snippet might be helpful:
Alias /trac "/wherever/you/installed/trac/htdocs/"
<Location "/cgi-bin/trac.cgi">
SetEnv TRAC_ENV "path/to/Work/MhzProjects/MhzTrac"
</Location>
# You need something like this to authenticate users
<Location "/cgi-bin/trac.cgi/login">
AuthType Basic
AuthName "MhzStuff"
AuthUserFile /somewhere/trac.htpasswd
Require valid-user
</Location>
The latest documentation can also always be found on the project website:
http://projects.edgewall.com/trac/
Congratulations!
$
  • Let's see what Trac created for us
$ ls -lh MhzTrac
total 32K
drwxr-xr-x  2 mhz rojo 4.0K 2006-01-04 15:58 attachments
drwxr-xr-x  2 mhz rojo 4.0K 2006-01-04 15:58 conf
drwxr-xr-x  2 mhz rojo 4.0K 2006-01-04 15:58 db
drwxr-xr-x  2 mhz rojo 4.0K 2006-01-04 15:58 log
-rw-r--r--  1 mhz rojo   94 2006-01-04 15:58 README
drwxr-xr-x  2 mhz rojo 4.0K 2006-01-04 15:58 templates
-rw-r--r--  1 mhz rojo   27 2006-01-04 15:58 VERSION
drwxr-xr-x  2 mhz rojo 4.0K 2006-01-04 15:58 wiki-macros
  • Edit apache2.conf
$ sudo nano /etc/apache2/apache2.conf
Password:
  • Add these lines at the end of the file
Alias /trac "/usr/share/trac/htdocs"
<Location "/cgi-bin/trac.cgi">
SetEnv TRAC_ENV "path/to/MhzProjects/MhzTrac"
</Location>
  • Re-start apache
sudo /etc/init.d/apache2 restart
  • Start Trac
tracd --port 8000 path/to/MhzProjects/MhzTrac/
  • Open your browser and visit http://localhost:8000

There is a mistake in this configuration

The configuration of apache2 as in the example above implies that you want to run trac via the cgi script; rather than with tracd.  tracd is a substitute for apache.  If you attempt to run tracd after starting apache2, you might receive : "socket.error: (98, 'Address already in use')"  Will someone who is more familiar please verify this, and correct these instructions.  -cullen

Server setup

/!\ Pending