From charlesreid1

Trac Installation

Installing

(saved terminal output 11-22)

unzipped (or, should have unzipped) to ~/pkg/_sources/Trac-0.12 (wait... what??? I thought I had 0.13???)

I think I downloaded the tarball for 0.12 but I installed Trac via easy_install, using easy_install Trac==0.13. Well... whatever. Just look through terminal saved output.)

Creating New Project

http://trac.edgewall.org/wiki/0.13/TracInstall

Subversion

If you're going to associate a subversion server with this Trac wiki, create the subversion server first:

$ svnadmin create /svn

$ svnadmin import /path/to/stuff file:///svn/projectname

Next, start the SVN server:

$ svnserve -d

and test to make sure the svn server is working properly:

$ svn co svn://localhost/svn/projectname

Create Trac Environment

First (failed) try

To create trac environment:

$ trac-admin /path/to/project initenv

Then it whines about no database called "trac":

 $ trac-admin $PWD/ucg-trac initenv
Creating a new Trac environment at /Users/reid24/codes/ucg-trac

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]> UndergroundCoalGasification
 
 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]> mysql://root:root@localhost:8889/trac

Creating and Initializing Project
Initenv for '/Users/reid24/codes/ucg-trac' failed. 
Failed to create environment.
(1049, "Unknown database 'trac'")
Traceback (most recent call last):
  File "build/bdist.macosx-10.6-intel/egg/trac/admin/console.py", line 437, in do_initenv
    options=options)
  File "build/bdist.macosx-10.6-intel/egg/trac/core.py", line 124, in __call__
    self.__init__(*args, **kwargs)
  File "build/bdist.macosx-10.6-intel/egg/trac/env.py", line 262, in __init__
    self.create(options)
  File "build/bdist.macosx-10.6-intel/egg/trac/env.py", line 549, in create
    DatabaseManager(self).init_db()
  File "build/bdist.macosx-10.6-intel/egg/trac/db/api.py", line 239, in init_db
    connector.init_db(**args)
  File "build/bdist.macosx-10.6-intel/egg/trac/db/mysql_backend.py", line 111, in init_db
    params)
  File "build/bdist.macosx-10.6-intel/egg/trac/db/mysql_backend.py", line 92, in get_connection
    cnx = MySQLConnection(path, log, user, password, host, port, params)
  File "build/bdist.macosx-10.6-intel/egg/trac/db/mysql_backend.py", line 262, in __init__
    port=port, charset='utf8', **opts)
  File "build/bdist.macosx-10.6-intel/egg/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "build/bdist.macosx-10.6-intel/egg/MySQLdb/connections.py", line 187, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
OperationalError: (1049, "Unknown database 'trac'")

That's about when everything starts to crumble apart and the Trac user's manual becomes basically useless. It wants authentication, and a configure file to be edited, and then I'm told to jump around and visit all these other pages about authentication and htpasswd, and somewhere in the middle of it I'm staring at this huge configuration file and I have no idea what I'm even doing.

Then there's a bunch of handwaving, and a message that says "Once you have everything up and running..." - and of course I'm going WHAT???

Where am I supposed to be putting ucg-trac directory? In my htdocs folder? If not, then why does it have its own htdocs folder? And what about config files??? This is so screwed up.

Trac detected an internal error:

ProgrammingError: (1146, "Table 'trac.repository' doesn't exist")

What does that even mean? Who was supposed to create the Trac tables? Why didn't they?

Recovering and Making It Work

Make a trac table:

$ mysqladmin -u root -p create trac
Enter password: 

reid24@mach via  - 30 

Then it fails:

$ trac-admin $PWD/ucg-trac initenv
Initenv for '/Users/reid24/codes/ucg-trac' failed. 
Does an environment already exist?

Ok, so I remove it:

$ rm -rf ucg-trac

Then I try again:


$ trac-admin $PWD/ucg-trac initenv
Creating a new Trac environment at /Users/reid24/codes/ucg-trac

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]> UndergroundCoalGasification
 
 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]> mysql://root:root@localhost:8889/trac

Creating and Initializing Project
 Installing default wiki pages
  CamelCase imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/CamelCase
  InterMapTxt imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/InterMapTxt
  InterTrac imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/InterTrac
  InterWiki imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/InterWiki
  PageTemplates imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/PageTemplates
  RecentChanges imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/RecentChanges
  SandBox imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/SandBox
  TitleIndex imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TitleIndex
  TracAccessibility imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracAccessibility
  TracAdmin imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracAdmin
  TracBackup imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracBackup
  TracBrowser imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracBrowser
  TracCgi imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracCgi
  TracChangeset imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracChangeset
  TracEnvironment imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracEnvironment
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Trac-0.13dev_r10872-py2.7.egg/trac/db/util.py:65: Warning: Incorrect string value: '\xE2\x86\x92 Ex...' for column 'text' at row 1
  TracFastCgi imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracFastCgi
  TracFineGrainedPermissions imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracFineGrainedPermissions
  TracGuide imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracGuide
  TracImport imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracImport
  TracIni imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracIni
  TracInstall imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracInstall
  TracInterfaceCustomization imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracInterfaceCustomization
  TracLinks imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracLinks
  TracLogging imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracLogging
  TracModPython imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracModPython
  TracModWSGI imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracModWSGI
  TracNavigation imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracNavigation
  TracNotification imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracNotification
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Trac-0.13dev_r10872-py2.7.egg/trac/db/util.py:65: Warning: Incorrect string value: '\xE2\x80\x83  '...' for column 'text' at row 1
  TracPermissions imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracPermissions
  TracPlugins imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracPlugins
  TracQuery imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracQuery
  TracReports imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracReports
  TracRepositoryAdmin imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracRepositoryAdmin
  TracRevisionLog imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracRevisionLog
  TracRoadmap imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracRoadmap
  TracRss imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracRss
  TracSearch imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracSearch
  TracStandalone imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracStandalone
  TracSupport imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracSupport
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Trac-0.13dev_r10872-py2.7.egg/trac/db/util.py:65: Warning: Incorrect string value: '\xE2\x9C\x93   ...' for column 'text' at row 1
  TracSyntaxColoring imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracSyntaxColoring
  TracTickets imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracTickets
  TracTicketsCustomFields imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracTicketsCustomFields
  TracTimeline imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracTimeline
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Trac-0.13dev_r10872-py2.7.egg/trac/db/util.py:65: Warning: Incorrect string value: '\xD8\xAA\xD8\xB1\xD8\xA7...' for column 'text' at row 1
  TracUnicode imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracUnicode
  TracUpgrade imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracUpgrade
  TracWiki imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracWiki
  TracWorkflow imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/TracWorkflow
  WikiDeletePage imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/WikiDeletePage
  WikiFormatting imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/WikiFormatting
  WikiHtml imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/WikiHtml
  WikiMacros imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/WikiMacros
  WikiNewPage imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/WikiNewPage
  WikiPageNames imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/WikiPageNames
  WikiProcessors imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/WikiProcessors
  WikiRestructuredText imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/WikiRestructuredText
  WikiRestructuredTextLinks imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/WikiRestructuredTextLinks
  WikiStart imported from /Users/reid24/.python-eggs/Trac-0.13dev_r10872-py2.7.egg-tmp/trac/wiki/default-pages/WikiStart

---------------------------------------------------------------------
Project environment for 'UndergroundCoalGasification' created.

You may now configure the environment by editing the file:

  /Users/reid24/codes/ucg-trac/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 /Users/reid24/codes/ucg-trac

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

And when I point browser to http://localhost:8000/ucg-trac, hey, what do you know, it all worked.

Authentication

http://trac.edgewall.org/wiki/TracStandalone#UsingAuthentication

No Trac documentation worked, most documentation was less helpful than it was confusing. I ended up figuring out the stinking process on my own.

Here's what I had to do:

1. add user using htdigest:

$ cd /path/to/trac/project/conf

$ htdigest -c users.digest RealmName charles

The RealmName should match the realm name given to tracd when you start the trac browser. Here is the syntax and more info on htdigest: http://httpd.apache.org/docs/2.0/programs/htdigest.html

2. start the tracd server using a start line like this:

$ tracd -s --port 8000 --auth="projectname,/path/to/projectname/conf/users.digest,RealmName" /path/to/projectname

This will use the htdigest-created file for user authentication.

3. once you have done all of this (and tracd is running), you can go to http://localhost:8000/login to get to the login page and test out your username/password.