Trac installation

apps

#1

I’m trying the One Click Trac install of Trac with a Subversion creation - and while the website “works”, there are no authenticated users automatically added to Trac, no way to add them via the web, and when I try via command line, I get errors running the trac-admin utility, noting there’s no “VERSION” directory.

Does anyone have advice of how to get users working?


#2

Had the same problem, along with a few others. Seems theres a few teething problems with trac install, I’ve reported what I’ve found to support.

I’ve managed to get a rather kludgy workaround in place for now by doing the following:

  1. Editing .htaccess and added basic authentication, pointing AuthUserFile to the repository’s .passwd file

  2. Ran trac-admin and added relevent permissions to an account, then was able to use web admin within trac on that account.

It’s not the best way (uses basic http auth, no anonymous users and cannot logout without destroying session), but it works for me until the issues with trac can be resolved and picks up the users from the repository fine.

The issue with trac admin reporting no VERSION usually means that you didn’t get the path to your trac env correct.

trac-admin /path/to/your/trac/ permission add some_username TRAC_ADMIN

Where path is the location of your web accesible trac env and username is the user to give the permissions to.

Like I said, a horrendous kludge but it’s got me up and running until something better comes along :slight_smile:


#3

I saw the workaround to edit .htaccess - and I may not be the best apache admin - but this causes the site to break. Any idea why?:

<Files *.cgi>
SetHandler fastcgi-script

<Location “/trac/login”>
AuthType Basic
AuthName "Trac"
AuthUserFile $HOME///trac.htpasswd
Require valid-user

DirectoryIndex index.fcgi

Make sure rewrites work

Options ExecCGI FollowSymLinks

RewriteEngine On RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f RewriteCond $1 !^index.fcgi/(.*) # Keep the graphics and style sheet the way they are RewriteCond $1 !^(.*).css$ RewriteCond $1 !^(.*).gif$ RewriteCond $1 !^(.*).jpg$ RewriteCond $1 !^(.*).png$ RewriteRule ^(.*)$ index.fcgi/$1 [L]

#4

Sorry for delayed reply, been away for the weekend.

I think its the directive causing your problem.

I’ve done it like this:

AuthUserFile /home/your_username/svn/your_repository_name.passwd
AuthName "Trac Access"
AuthType Basic
Require valid-user

note the AuthUserFile points to the .passwd file for the repository and it’s not Location limited.

This will give you a username/password prompt whenever you visit any page on the trac site, which will be used as your trac login.

Like I said, not ideal but I needed to get this up and running quickly with authentication and using the users from the repository. I can live without anonymous access for now.

If there’s been any updates or there’s a better way to do this on DH that anybody has found I’m all ears :slight_smile:

All I’ve managed to find so far is this : http://wiki.dreamhost.com/Troubleshoot_Trac_One-Click_Install


#5

Above worked for me thanks with respect to auth!

However, I recieved a “Missing or invalid form token. Do you have cookies enabled?” trac error message whenever I tried to save anything. Adding the following in the mod_rewrite section will take care of the error.

RewriteCond? $1 !^(.*).js$


#6

Hi guys,

This info has helped me get Trac running, however I have one major issue left.

Using
RewriteCond $1 !^(.).gif$
RewriteCond $1 !^(.
).jpg$
RewriteCond $1 !^(.).png$
RewriteCond $1 !^(.
).js$

In .htaccess means that viewing these files as attachements produces a 404. Any idea on how to view media files as attachments?? I’m at a loss here… if I turn off the code above, the layout goes to hell… however I can view files again.

pete


#7

Simple. You need to modify the conditions for the rewrite to include doing the rewrite for attachments. And in case its not obvious this means testing the url-path and query string for whatever it is that indicates the request is for an attachment. Here is the documentation to help you out: Apache Module mod_rewrite

:cool: openvein.org -//-


#8

Thanks for the reply Atropos - sadly I am still very lost.

I understand "RewriteCond {subject} {condition} "… and then you can use a RewriteRule if a condition is met…

I don’t quite see what is going on, exactly, in these exact RewriteCond statements. They are all condition tests, right - however there are no RewriteRule entries… so these lines are testing and nothing happens? And I must admit the actual condition is confusing. I know $1 is the variable - however, I don’t understand what “!^(.*).css$” means, for example. Any explanation would be fantastic.

RewriteEngine On RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f RewriteCond $1 !^index.fcgi/(.*) # Keep the graphics and style sheet the way they are RewriteCond $1 !^(.*).css$ RewriteCond $1 !^(.*).gif$ RewriteCond $1 !^(.*).jpg$ RewriteCond $1 !^(.*).png$ RewriteCond $1 !^(.*).js$ RewriteRule ^(.*)$ index.fcgi/$1 [L]

#9

OK that just needs to be replaced with:[code]DirectoryIndex index.fcgi

Options ExecCGI FollowSymLinks

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.fcgi/$1 [L]
[/code]

:cool: openvein.org -//-


#10

Hello everybody,

I follow the instructions of the Solution 1 of this page http://wiki.dreamhost.com/Troubleshoot_Trac_One-Click_Install but when I access to my Trac, several authentication windows appears anytime I navigate in trac.

And the CSS doesn’t work.

Do you have a solution to disable the several auth windows in trac ?

Regards,


#11

I could get authentication going thanks to this thread, but no luck with getting the web admin tab in trac.
assigned the TRAC_ADMIN permission to the SVN user and even to anonymous, but no avail.
tried adding the webadmin.* = enabled in the trac.ini but still no go.

What am I missing?


#12

The email I received from Dreamhost when I created Trac with the one-click installer says:
"
You can begin setting up your users for your Trac install through the panel:

https://panel.dreamhost.com/?tree=goodies.webdav&
"
So to add user authentication click the link, go to domain where you have installed the Trac and add the path to Trac.
e.g.
Domain:
http://www.example.com
Trac path:
http://www.example.com/exampletrac/

Kind regards,
Emil Kjer