特殊:Badtitle/NS100:UbuntuTracHowto:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
(未显示同一用户的4个中间版本) | |||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/UbuntuTracHowto}} | {{From|https://help.ubuntu.com/community/UbuntuTracHowto}} | ||
{{Languages|UbuntuHelp:UbuntuTracHowto}} | {{Languages|UbuntuHelp:UbuntuTracHowto}} | ||
<<Include(Tag/StyleCleanup)>> | |||
<<Include(Tag/NeedsExpansion)>> | |||
There are "better" instructions at http://trac.edgewall.org/wiki/TracOnUbuntu | There are "better" instructions at http://trac.edgewall.org/wiki/TracOnUbuntu | ||
<!> ''Yeah but the "better" instructions there say <code><nowiki>These instructions are bad, do not follow them.</nowiki></code> Suggestions?'' | |||
<!> Suggestion: The Edgewall page uses the upstream-preferred installation mechanism (i.e. running <code><nowiki>easy-setup</nowiki></code>). This page should discuss the Ubuntu-preferred method, using Ubuntu-provided packages. | |||
== Localhost setup == | == Localhost setup == | ||
'''Steps to get Trac working on your computer from commandline''' | '''Steps to get Trac working on your computer from commandline''' | ||
第13行: | 第17行: | ||
$ 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 | ||
第24行: | 第30行: | ||
/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. | |||
This name will be used in page titles and descriptions. | Please enter the name of your project. | ||
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. | |||
Repository must be local, and trac-admin requires read+write | Please specify the absolute path to the project Subversion repository. | ||
permission to initialize the Trac database. | 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/ | 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. | 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]> | Templates directory [/usr/share/trac/templates]> | ||
Creating and Initializing Project | Creating and Initializing Project | ||
Inserting default data | Inserting default data | ||
Configuring Project | Configuring Project | ||
trac.repository_dir | trac.repository_dir | ||
trac.templates_dir | trac.templates_dir | ||
project.name | project.name | ||
Installing wiki pages | Installing wiki pages | ||
/usr/share/trac/wiki-default/TracImport => TracImport | /usr/share/trac/wiki-default/TracImport => TracImport | ||
/usr/share/trac/wiki-default/TracRss => TracRss | /usr/share/trac/wiki-default/TracRss => TracRss | ||
/usr/share/trac/wiki-default/TracMultipleProjects => TracMultipleProjects | /usr/share/trac/wiki-default/TracMultipleProjects => TracMultipleProjects | ||
/usr/share/trac/wiki-default/TracBackup => TracBackup | /usr/share/trac/wiki-default/TracBackup => TracBackup | ||
/usr/share/trac/wiki-default/TracTimeline => TracTimeline | /usr/share/trac/wiki-default/TracTimeline => TracTimeline | ||
/usr/share/trac/wiki-default/TracTickets => TracTickets | /usr/share/trac/wiki-default/TracTickets => TracTickets | ||
/usr/share/trac/wiki-default/TracInstall => TracInstall | /usr/share/trac/wiki-default/TracInstall => TracInstall | ||
/usr/share/trac/wiki-default/WikiRestructuredText => WikiRestructuredText | /usr/share/trac/wiki-default/WikiRestructuredText => WikiRestructuredText | ||
/usr/share/trac/wiki-default/WikiPageNames => WikiPageNames | /usr/share/trac/wiki-default/WikiPageNames => WikiPageNames | ||
/usr/share/trac/wiki-default/TracSyntaxColoring => TracSyntaxColoring | /usr/share/trac/wiki-default/TracSyntaxColoring => TracSyntaxColoring | ||
/usr/share/trac/wiki-default/TracPermissions => TracPermissions | /usr/share/trac/wiki-default/TracPermissions => TracPermissions | ||
/usr/share/trac/wiki-default/TracSupport => TracSupport | /usr/share/trac/wiki-default/TracSupport => TracSupport | ||
/usr/share/trac/wiki-default/WikiHtml => WikiHtml | /usr/share/trac/wiki-default/WikiHtml => WikiHtml | ||
/usr/share/trac/wiki-default/TracModPython => TracModPython | /usr/share/trac/wiki-default/TracModPython => TracModPython | ||
/usr/share/trac/wiki-default/WikiFormatting => WikiFormatting | /usr/share/trac/wiki-default/WikiFormatting => WikiFormatting | ||
/usr/share/trac/wiki-default/TracBrowser => TracBrowser | /usr/share/trac/wiki-default/TracBrowser => TracBrowser | ||
/usr/share/trac/wiki-default/TracTicketsCustomFields => TracTicketsCustomFields | /usr/share/trac/wiki-default/TracTicketsCustomFields => TracTicketsCustomFields | ||
/usr/share/trac/wiki-default/TracNotification => TracNotification | /usr/share/trac/wiki-default/TracNotification => TracNotification | ||
/usr/share/trac/wiki-default/TracUnicode => TracUnicode | /usr/share/trac/wiki-default/TracUnicode => TracUnicode | ||
/usr/share/trac/wiki-default/TracAccessibility => TracAccessibility | /usr/share/trac/wiki-default/TracAccessibility => TracAccessibility | ||
/usr/share/trac/wiki-default/TracInstallPlatforms => TracInstallPlatforms | /usr/share/trac/wiki-default/TracInstallPlatforms => TracInstallPlatforms | ||
/usr/share/trac/wiki-default/TracReports => TracReports | /usr/share/trac/wiki-default/TracReports => TracReports | ||
/usr/share/trac/wiki-default/TracEnvironment => TracEnvironment | /usr/share/trac/wiki-default/TracEnvironment => TracEnvironment | ||
/usr/share/trac/wiki-default/WikiMacros => WikiMacros | /usr/share/trac/wiki-default/WikiMacros => WikiMacros | ||
/usr/share/trac/wiki-default/CamelCase => CamelCase | /usr/share/trac/wiki-default/CamelCase => CamelCase | ||
/usr/share/trac/wiki-default/WikiProcessors => WikiProcessors | /usr/share/trac/wiki-default/WikiProcessors => WikiProcessors | ||
/usr/share/trac/wiki-default/TracSearch => TracSearch | /usr/share/trac/wiki-default/TracSearch => TracSearch | ||
/usr/share/trac/wiki-default/TracQuery => TracQuery | /usr/share/trac/wiki-default/TracQuery => TracQuery | ||
/usr/share/trac/wiki-default/WikiStart => WikiStart | /usr/share/trac/wiki-default/WikiStart => WikiStart | ||
/usr/share/trac/wiki-default/TracLogging => TracLogging | /usr/share/trac/wiki-default/TracLogging => TracLogging | ||
/usr/share/trac/wiki-default/SandBox => SandBox | /usr/share/trac/wiki-default/SandBox => SandBox | ||
/usr/share/trac/wiki-default/WikiRestructuredTextLinks => WikiRestructuredTextLinks | /usr/share/trac/wiki-default/WikiRestructuredTextLinks => WikiRestructuredTextLinks | ||
/usr/share/trac/wiki-default/TracLinks => TracLinks | /usr/share/trac/wiki-default/TracLinks => TracLinks | ||
/usr/share/trac/wiki-default/TracRoadmap => TracRoadmap | /usr/share/trac/wiki-default/TracRoadmap => TracRoadmap | ||
/usr/share/trac/wiki-default/TracStandalone => TracStandalone | /usr/share/trac/wiki-default/TracStandalone => TracStandalone | ||
/usr/share/trac/wiki-default/TracUpgrade => TracUpgrade | /usr/share/trac/wiki-default/TracUpgrade => TracUpgrade | ||
/usr/share/trac/wiki-default/RecentChanges => RecentChanges | /usr/share/trac/wiki-default/RecentChanges => RecentChanges | ||
/usr/share/trac/wiki-default/TracAdmin => TracAdmin | /usr/share/trac/wiki-default/TracAdmin => TracAdmin | ||
/usr/share/trac/wiki-default/TracGuide => TracGuide | /usr/share/trac/wiki-default/TracGuide => TracGuide | ||
/usr/share/trac/wiki-default/TracChangeset => TracChangeset | /usr/share/trac/wiki-default/TracChangeset => TracChangeset | ||
/usr/share/trac/wiki-default/TitleIndex => | /usr/share/trac/wiki-default/TitleIndex => TitleIndex | ||
/usr/share/trac/wiki-default/WikiNewPage => WikiNewPage | /usr/share/trac/wiki-default/WikiNewPage => WikiNewPage | ||
/usr/share/trac/wiki-default/TracWiki => TracWiki | /usr/share/trac/wiki-default/TracWiki => TracWiki | ||
Indexing repository | Indexing repository | ||
--------------------------------------------------------------------- | --------------------------------------------------------------------- | ||
Project database for 'MhzStuff' created. | Project database for 'MhzStuff' created. | ||
Customize settings for your project using the command: | |||
trac-admin /path/to/MhzProjects/MhzTrac | Customize settings for your project using the command: | ||
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. | trac-admin /path/to/MhzProjects/MhzTrac | ||
If you're using Apache, this config example snippet might be helpful: | |||
Alias /trac "/wherever/you/installed/trac/htdocs/" | Don't forget, you also need to copy (or symlink) "trac/cgi-bin/trac.cgi" | ||
<Location "/cgi-bin/trac.cgi"> | to you web server's /cgi-bin/ directory, and then configure the server. | ||
SetEnv TRAC_ENV "path/to/Work/MhzProjects/MhzTrac" | |||
</Location> | If you're using Apache, this config example snippet might be helpful: | ||
# You need something like this to authenticate users | |||
<Location "/cgi-bin/trac.cgi/login"> | Alias /trac "/wherever/you/installed/trac/htdocs/" | ||
AuthType Basic | <Location "/cgi-bin/trac.cgi"> | ||
AuthName "MhzStuff" | SetEnv TRAC_ENV "path/to/Work/MhzProjects/MhzTrac" | ||
AuthUserFile /somewhere/trac.htpasswd | </Location> | ||
Require valid-user | |||
</Location> | # You need something like this to authenticate users | ||
The latest documentation can also always be found on the project website: | <Location "/cgi-bin/trac.cgi/login"> | ||
http://projects.edgewall.com/trac/ | 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! | Congratulations! | ||
$ | $ | ||
</nowiki></pre> | </nowiki></pre> | ||
第131行: | 第154行: | ||
<pre><nowiki> | <pre><nowiki> | ||
Alias /trac "/usr/share/trac/htdocs" | Alias /trac "/usr/share/trac/htdocs" | ||
<Location "/cgi-bin/trac.cgi"> | <Location "/cgi-bin/trac.cgi"> | ||
SetEnv TRAC_ENV "path/to/MhzProjects/MhzTrac" | SetEnv TRAC_ENV "path/to/MhzProjects/MhzTrac" | ||
</Location> | </Location> | ||
</nowiki></pre> | </nowiki></pre> | ||
* Re-start apache | * Re-start apache | ||
第149行: | 第172行: | ||
</nowiki></pre> | </nowiki></pre> | ||
== Server setup == | == Server setup == | ||
/ | === Install subversion === | ||
<pre><nowiki> | |||
$ sudo apt-get install subversion | |||
</nowiki></pre> | |||
Install apache with subversion module: | |||
<pre><nowiki> | |||
$ sudo apt-get install apache2 libapache2-svn | |||
$ sudo /etc/init.d/apache2 restart | |||
</nowiki></pre> | |||
Edit the dav stuff: | |||
<pre><nowiki> | |||
$ sudo gedit /etc/apache2/mods-available/dav_svn.conf | |||
</nowiki></pre> | |||
<pre><nowiki> | |||
<Location /svn> | |||
DAV svn | |||
SVNPath /var/lib/svn | |||
AuthType Basic | |||
AuthName "Subversion Repository" | |||
AuthUserFile /etc/apache2/dav_svn.passwd | |||
Require valid-user | |||
#AuthzSVNAccessFile /etc/apache2/svn-acl | |||
</Location> | |||
</nowiki></pre> | |||
Place the files from subversion: | |||
<pre><nowiki> | |||
$ /var/lib/svn | |||
$ sudo chown -R www-data svn/ | |||
</nowiki></pre> | |||
Creating the passwordfile: | |||
<pre><nowiki> | |||
$ sudo htpasswd -c /etc/apache2/dav_svn.passwd first-svn-user | |||
</nowiki></pre> | |||
Adding more users with: | |||
<pre><nowiki> | |||
$ sudo htpasswd /etc/apache2/dav_svn.passwd more-user | |||
</nowiki></pre> | |||
Restart the webserver: | |||
<pre><nowiki> | |||
$ sudo /etc/init.d/apache2 restart | |||
</nowiki></pre> | |||
Subversion can now be found at: http://localhost/svn/ | |||
=== Trac enviroment === | |||
<pre><nowiki> | |||
$ sudo apt-get install trac | |||
Password: | |||
</nowiki></pre> | |||
Create the containing directory with it's files (our trac project is called "horus") | |||
<pre><nowiki> | |||
$ sudo mkdir /var/lib/trac | |||
$ sudo chown -R www-data /var/lib/trac/ | |||
$ cd /var/lib/trac/ | |||
$ sudo trac-admin horus initenv | |||
</nowiki></pre> | |||
This will generate the following output: | |||
<pre><nowiki> | |||
Creating a new Trac environment at /var/lib/trac/horus | |||
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]> Horus | |||
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]> /var/lib/svn | |||
Creating and Initializing Project | |||
… | |||
… | |||
… | |||
--------------------------------------------------------------------- | |||
Project environment for 'Horus' created. | |||
You may now configure the environment by editing the file: | |||
/var/lib/trac/horus/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/lib/trac/horus | |||
Then point your browser to http://localhost:8000/horus. | |||
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! | |||
</nowiki></pre> | |||
Change the owner and do a testrun with the webuser(test at http://localhost:8000/horus): | |||
<pre><nowiki> | |||
$ sudo chown -R www-data horus | |||
$ sudo -u www-data tracd --port 8000 /var/lib/trac/horus | |||
^C$ | |||
</nowiki></pre> | |||
=== Trac in apache ==== | |||
Create the location | |||
<pre><nowiki> | |||
$ sudo gedit /etc/apache2/sites-available/trac.conf | |||
</nowiki></pre> | |||
<pre><nowiki> | |||
<Location /trac> #set up Trac handling | |||
SetHandler mod_python | |||
PythonHandler trac.web.modpython_frontend | |||
PythonOption TracEnvParentDir /var/lib/trac | |||
PythonOption TracUriRoot /trac | |||
# Use the SVN password file. | |||
AuthType Basic | |||
AuthName "Subversion Repository" | |||
AuthUserFile /etc/apache2/dav_svn.passwd | |||
Require valid-user | |||
</Location> | |||
</nowiki></pre> | |||
Install the python module and make the site available | |||
<pre><nowiki> | |||
$ sudo apt-get install libapache2-mod-python | |||
$ cd /etc/apache2/sites-enabled | |||
$ sudo ln -s ../sites-available/trac.conf 010-trac | |||
$ sudo /etc/init.d/apache2 restart | |||
</nowiki></pre> | |||
location can be reached at: http://localhost/trac/ | |||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2010年5月20日 (四) 00:37的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/UbuntuTracHowto }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/af | • {{#if: UbuntuHelp:UbuntuTracHowto|Afrikaans| [[::UbuntuTracHowto/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/ar | • {{#if: UbuntuHelp:UbuntuTracHowto|العربية| [[::UbuntuTracHowto/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/az | • {{#if: UbuntuHelp:UbuntuTracHowto|azərbaycanca| [[::UbuntuTracHowto/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/bcc | • {{#if: UbuntuHelp:UbuntuTracHowto|جهلسری بلوچی| [[::UbuntuTracHowto/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/bg | • {{#if: UbuntuHelp:UbuntuTracHowto|български| [[::UbuntuTracHowto/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/br | • {{#if: UbuntuHelp:UbuntuTracHowto|brezhoneg| [[::UbuntuTracHowto/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/ca | • {{#if: UbuntuHelp:UbuntuTracHowto|català| [[::UbuntuTracHowto/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/cs | • {{#if: UbuntuHelp:UbuntuTracHowto|čeština| [[::UbuntuTracHowto/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/de | • {{#if: UbuntuHelp:UbuntuTracHowto|Deutsch| [[::UbuntuTracHowto/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/el | • {{#if: UbuntuHelp:UbuntuTracHowto|Ελληνικά| [[::UbuntuTracHowto/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/es | • {{#if: UbuntuHelp:UbuntuTracHowto|español| [[::UbuntuTracHowto/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/fa | • {{#if: UbuntuHelp:UbuntuTracHowto|فارسی| [[::UbuntuTracHowto/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/fi | • {{#if: UbuntuHelp:UbuntuTracHowto|suomi| [[::UbuntuTracHowto/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/fr | • {{#if: UbuntuHelp:UbuntuTracHowto|français| [[::UbuntuTracHowto/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/gu | • {{#if: UbuntuHelp:UbuntuTracHowto|ગુજરાતી| [[::UbuntuTracHowto/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/he | • {{#if: UbuntuHelp:UbuntuTracHowto|עברית| [[::UbuntuTracHowto/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/hu | • {{#if: UbuntuHelp:UbuntuTracHowto|magyar| [[::UbuntuTracHowto/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/id | • {{#if: UbuntuHelp:UbuntuTracHowto|Bahasa Indonesia| [[::UbuntuTracHowto/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/it | • {{#if: UbuntuHelp:UbuntuTracHowto|italiano| [[::UbuntuTracHowto/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/ja | • {{#if: UbuntuHelp:UbuntuTracHowto|日本語| [[::UbuntuTracHowto/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/ko | • {{#if: UbuntuHelp:UbuntuTracHowto|한국어| [[::UbuntuTracHowto/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/ksh | • {{#if: UbuntuHelp:UbuntuTracHowto|Ripoarisch| [[::UbuntuTracHowto/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/mr | • {{#if: UbuntuHelp:UbuntuTracHowto|मराठी| [[::UbuntuTracHowto/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/ms | • {{#if: UbuntuHelp:UbuntuTracHowto|Bahasa Melayu| [[::UbuntuTracHowto/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/nl | • {{#if: UbuntuHelp:UbuntuTracHowto|Nederlands| [[::UbuntuTracHowto/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/no | • {{#if: UbuntuHelp:UbuntuTracHowto|norsk| [[::UbuntuTracHowto/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/oc | • {{#if: UbuntuHelp:UbuntuTracHowto|occitan| [[::UbuntuTracHowto/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/pl | • {{#if: UbuntuHelp:UbuntuTracHowto|polski| [[::UbuntuTracHowto/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/pt | • {{#if: UbuntuHelp:UbuntuTracHowto|português| [[::UbuntuTracHowto/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/ro | • {{#if: UbuntuHelp:UbuntuTracHowto|română| [[::UbuntuTracHowto/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/ru | • {{#if: UbuntuHelp:UbuntuTracHowto|русский| [[::UbuntuTracHowto/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/si | • {{#if: UbuntuHelp:UbuntuTracHowto|සිංහල| [[::UbuntuTracHowto/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/sq | • {{#if: UbuntuHelp:UbuntuTracHowto|shqip| [[::UbuntuTracHowto/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/sr | • {{#if: UbuntuHelp:UbuntuTracHowto|српски / srpski| [[::UbuntuTracHowto/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/sv | • {{#if: UbuntuHelp:UbuntuTracHowto|svenska| [[::UbuntuTracHowto/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/th | • {{#if: UbuntuHelp:UbuntuTracHowto|ไทย| [[::UbuntuTracHowto/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/tr | • {{#if: UbuntuHelp:UbuntuTracHowto|Türkçe| [[::UbuntuTracHowto/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/vi | • {{#if: UbuntuHelp:UbuntuTracHowto|Tiếng Việt| [[::UbuntuTracHowto/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/yue | • {{#if: UbuntuHelp:UbuntuTracHowto|粵語| [[::UbuntuTracHowto/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/zh | • {{#if: UbuntuHelp:UbuntuTracHowto|中文| [[::UbuntuTracHowto/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/zh-hans | • {{#if: UbuntuHelp:UbuntuTracHowto|中文(简体)| [[::UbuntuTracHowto/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuTracHowto | UbuntuHelp:UbuntuTracHowto | {{#if: | :}}UbuntuTracHowto}}/zh-hant | • {{#if: UbuntuHelp:UbuntuTracHowto|中文(繁體)| [[::UbuntuTracHowto/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:UbuntuTracHowto|:UbuntuTracHowto|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :UbuntuTracHowto/zh | | {{#ifexist: UbuntuTracHowto/zh | | {{#ifeq: {{#titleparts:UbuntuTracHowto|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:UbuntuTracHowto|1|-1|}} | zh | | }}
<<Include(Tag/StyleCleanup)>>
<<Include(Tag/NeedsExpansion)>>
There are "better" instructions at http://trac.edgewall.org/wiki/TracOnUbuntu
<!> Yeah but the "better" instructions there say These instructions are bad, do not follow them.
Suggestions?
<!> Suggestion: The Edgewall page uses the upstream-preferred installation mechanism (i.e. running easy-setup
). This page should discuss the Ubuntu-preferred method, using Ubuntu-provided packages.
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 calledMhzTrac
, both underMhzProjects/
. Socd
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
Install subversion
$ sudo apt-get install subversion
Install apache with subversion module:
$ sudo apt-get install apache2 libapache2-svn $ sudo /etc/init.d/apache2 restart
Edit the dav stuff:
$ sudo gedit /etc/apache2/mods-available/dav_svn.conf
<Location /svn> DAV svn SVNPath /var/lib/svn AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user #AuthzSVNAccessFile /etc/apache2/svn-acl </Location>
Place the files from subversion:
$ /var/lib/svn $ sudo chown -R www-data svn/
Creating the passwordfile:
$ sudo htpasswd -c /etc/apache2/dav_svn.passwd first-svn-user
Adding more users with:
$ sudo htpasswd /etc/apache2/dav_svn.passwd more-user
Restart the webserver:
$ sudo /etc/init.d/apache2 restart
Subversion can now be found at: http://localhost/svn/
Trac enviroment
$ sudo apt-get install trac Password:
Create the containing directory with it's files (our trac project is called "horus")
$ sudo mkdir /var/lib/trac $ sudo chown -R www-data /var/lib/trac/ $ cd /var/lib/trac/ $ sudo trac-admin horus initenv
This will generate the following output:
Creating a new Trac environment at /var/lib/trac/horus 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]> Horus 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]> /var/lib/svn Creating and Initializing Project … … … --------------------------------------------------------------------- Project environment for 'Horus' created. You may now configure the environment by editing the file: /var/lib/trac/horus/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/lib/trac/horus Then point your browser to http://localhost:8000/horus. 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!
Change the owner and do a testrun with the webuser(test at http://localhost:8000/horus):
$ sudo chown -R www-data horus $ sudo -u www-data tracd --port 8000 /var/lib/trac/horus ^C$
Trac in apache =
Create the location
$ sudo gedit /etc/apache2/sites-available/trac.conf
<Location /trac> #set up Trac handling SetHandler mod_python PythonHandler trac.web.modpython_frontend PythonOption TracEnvParentDir /var/lib/trac PythonOption TracUriRoot /trac # Use the SVN password file. AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user </Location>
Install the python module and make the site available
$ sudo apt-get install libapache2-mod-python $ cd /etc/apache2/sites-enabled $ sudo ln -s ../sites-available/trac.conf 010-trac $ sudo /etc/init.d/apache2 restart
location can be reached at: http://localhost/trac/