Trac 1.4.3 new install: htdocs is nearly empty and pages not getting formatted

17 views
Skip to first unread message

Rick Macdonald

unread,
Mar 20, 2023, 9:38:21 PM3/20/23
to Trac Users
My new install of 1.4.3 has very little in htdocs, such that the pages are almost plain text instead of being nicely formatted.

As a test, I replaced the htdocs with the directory from my previous 1.0.3 instance, and all the nice formatting came back. The old directory doesn't have the subdirs common or ticketopt. The README file states that these are files used by the genshi templates.

I'm aware 1.4.3 uses Jinja2 instead of Genshi, but what could I have missed? The htdocs created by trac-admin/deploy doesn't seem to have what it needs.

Here are the things that I installed:

$ pip install -U Jinja2
$ pip install -U genshi
$ pip install -U babel
$ pip install Trac
$ pip install -U docutils pygments textile

Yikes! I didn't realize until just now that I also installed Genshi. I'm not sure I intended to do that! A closer look finds the genshi files in htdocs/common. If I move them up a level from that "common" subdir, then the nice formatting comes back.

Is the .htaccess file (copied from trac 1.0.3) wrong? I'm currently testing using tracd. I don't think my ISP will fix any apace settings if that's what I need to go back to apache. I can get by with tracd if need be; I ran that way for 2 years a few years ago.

$ cat $TRAC_ENV/.htaccess
#<Files *.cgi>
#       SetHandler fastcgi-script
#</Files>

DirectoryIndex index.fcgi


# Make sure rewrites work
Options ExecCGI FollowSymLinks

<IfModule mod_rewrite.c>
        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 !^htdocs(.*).css$
        RewriteCond $1 !^htdocs(.*).js$
        RewriteCond $1 !^htdocs(.*).gif$
        RewriteCond $1 !^htdocs(.*).jpg$
        RewriteCond $1 !^htdocs(.*).png$
        RewriteRule ^(.*)$ index.fcgi/$1 [L]

        RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
        RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_URI} attachment
        RewriteCond $1 !^index.fcgi/(.*)
        RewriteRule ^(.*)$ index.fcgi/$1 [L]
</IfModule>


I'm sure I screwed this up. I don't mind starting over again. Can anybody shed some light on this?

Rick Macdonald

unread,
Mar 21, 2023, 2:51:16 AM3/21/23
to Trac Users
I wrote:

Yikes! I didn't realize until just now that I also installed Genshi. I'm not sure I intended to do that! A closer look finds the genshi files in htdocs/common. If I move them up a level from that "common" subdir, then the nice formatting comes back.

I figured out and fixed the cause of having to copy the Genshi files from htdocs/commom to htdocs. I had leftover cruft of a link at the top-level account directory and that got into some settings instead of the actual path. I think that was screwing up some relative path manipulations. (never mind if that doesn't make sense!). I fixed that, and now the genshi files are found in htdocs/common.

However, given that I read that Jinja2 has replaced Genshi, what does it mean that I've installed both but it still seems to work? Should I clean this up?

Markus Rosjat

unread,
Mar 21, 2023, 2:51:28 AM3/21/23
to trac-...@googlegroups.com
hey rick,

as far as i remember the htdocs folder of the project folders are not really connected to the "appearance" of the Tac system. It is for static content you might wanna add fo be reachable by trac with relative paths.
So you might wanna try to run tracd without apache an check how your formatting looks like.

regarding genshi, if you got some templates that still use genshi you might need to keep it until you replace the templates with jinja2 ones but this should give you an error anyway and if you dont get them you might be ok on that front.

hope the pointers gets you a little further 

cheers

MArkus 

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/792db24a-d7cf-454a-964a-9344fa739191n%40googlegroups.com.

Markus Rosjat

unread,
Mar 21, 2023, 3:13:36 AM3/21/23
to trac-...@googlegroups.com
as i stated if you dont have plugins with templates using genshi anymore it should be save to remove it. If you are not sure just leave it since the code will call the proper library. I have both still and no problems but then again i have a few plugins using genshi and i run on my production trac on a 1.4.2

cheers 

Markus

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.

Rick Macdonald

unread,
Mar 21, 2023, 3:15:40 AM3/21/23
to Trac Users
MArkus,

Thanks for the reply. I think you were typing this at the same time I was tying up some additional info. The Genshi files in htdocs are definitely used for the formatting, at least in my case. I move the files in and out and the formatting comes and goes. That's fixed now as I described, but I should still sort out what I've done by installing both genshi and jinja2.

I see I hadn't mentioned it, but I am running tracd. Something happened again with the ISP which totally broke our Trac. It was time I upgraded to 1.4.x anyway, and going forward I think it's safer for us to use tracd.

Markus Rosjat

unread,
Mar 21, 2023, 3:22:53 AM3/21/23
to trac-...@googlegroups.com
well tracd will always run but usually you put it behind a webserver like apache or nginx  that does the work for tls so you got a proper encryption till you hit your machine and then redirects the traffic to the tracd  (assumong both running on the same machine but rewrite can easily direct the traffic to other internal machines anyway)
what i meant with running tracd without the webserver is running it in foreground to see whats happening but since you solved the problem i guess we can skip that :)

Cheers

MArkus

Jun Omae

unread,
Mar 21, 2023, 3:23:24 AM3/21/23
to trac-...@googlegroups.com
Trac environment should not be put under the document root directory.
If you try to configure with mod_fastcgi/mod_fcgid, the following page
may help it.
https://trac.edgewall.org/wiki/TracFastCgi


--
Jun Omae <jun...@gmail.com> (大前 潤)

Rick Macdonald

unread,
Mar 21, 2023, 12:40:10 PM3/21/23
to Trac Users
I've been running Trac for 12 years. It's on a shared host at dreamhost.com, so I don't have root or sudo access. It was originally set up with their "one-click install". Several years ago they stopped supporting Trac and won't help me with any apache setup issues. It stopped working a few years ago so I had to switch to tracd for about 2 years. I somehow noticed that apache was working again so we changed back to the web server. Now it's broken again. I've taken the opportunity to ditch my old 1.0.3 instance and rebuild with 1.4.3. For now, I have no choice but to use tracd. It's all working now except for basic-auth (which always worked before), but I'll start a new topic for that if I can't get it to work.

Thanks everyone!
Reply all
Reply to author
Forward
0 new messages