Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 107577 - www-apps/trac-0.8.4: tracd does not serve default CSS/images from /trac_common
Summary: www-apps/trac-0.8.4: tracd does not serve default CSS/images from /trac_common
Status: VERIFIED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Julien Allanos (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-29 02:46 UTC by Thomas Nichols
Modified: 2008-01-08 16:03 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Nichols 2005-09-29 02:46:50 UTC
emerge www-apps/trac installs ok, but tracd does not serve the static
(image/CSS/JS) content - so pages display as white-screen, without formatting or
styles.


Reproducible: Always
Steps to Reproduce:
1.emerge www-apps/trac
2.tracd -p 9999
3.firefox http://localhost:9999/

Actual Results:  
Unstyled page displayed

Expected Results:  
Delivered static content from, for example,
 http://host:port/trac_common/trac_banner.png - so pages are styled

Fixed with: 
$ ln -s /var/www/localhost/htdocs/trac /usr/share/trac/htdocs

Reference:
http://lists.edgewall.com/archive/trac/2005-September/004923.html
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-09-29 06:53:53 UTC
It definitely does serve images and CSS here without any symlinks, so you must
have misconfigured the thing. 
Comment 2 Thomas Nichols 2005-09-30 14:13:02 UTC
Ok - if you say so :-)
My notes just say I did:
# emerge www-apps/trac

then created a project and ran
$ nohup tracd -a projname,digestfile,realm -p 9090 <projdir> &

In /usr/share/htdocs there were, after emerge:
drwxr-xr-x   2 root root 4096 Sep 25 01:16 templates
drwxr-xr-x   2 root root 4096 Sep 25 01:16 wiki-default

All worked fine when I added
lrwxrwxrwx   1 root root   30 Sep 29 10:19 htdocs -> /var/www/localhost/htdocs/trac

So I'm not clear what I messed up - but what the heck, just having the Trac
subprojects integrated has been a real timesaver, if anyone else has the same
problem they can read this thread :-)

Thanks for your time on this.
Thomas.
Comment 3 Roland Rasmussen 2005-10-12 18:07:23 UTC
I had the same problem. Setting the symlink fixes it.
Comment 4 Julien Allanos (RETIRED) gentoo-dev 2005-10-13 15:27:15 UTC
Can you try with 0.9_beta2?
Comment 5 Rob Rosenfeld 2005-11-13 10:40:42 UTC
I need to symlink /var/www/localhost/htdocs/trac to /usr/share/trac/htdocs to
get the js, images, etc. on an install using trac-0.9
Comment 6 Julien Allanos (RETIRED) gentoo-dev 2006-02-05 02:40:41 UTC
I still can't reproduce that bug with 0.9.3.

I emerged trac-0.9.3, using USE="-cgi -enscript -fastcgi -postgres +silvercity +sqlite -vhosts".

Trac installs itself in /var/www/localhost (webapp-config -I -h localhost -u root -d /trac trac 0.9.3), which does almost nothing (due to -cgi and -fastcgi).

Now, as a simple user, I created a project (svnadmin create, followed by trac-admin initenv), and ran tracd (tracd -p 9999 project).

Access to http://localhost:9999/project/ display the Trac homepage, with images, CSS and everything. No need to symlink. I even believe that /var/www/localhost isn't used at all with tracd, at least with 0.9.3.
Comment 7 Jari-Matti Mäkelä 2006-04-18 06:18:16 UTC
I tested this with trac 0.9.4. Serving the static content from /usr/share/... with apache/lighttpd can be done easily. One can always use the alias-commands of the http server to do the correct "symbolic links".

But tracd didn't want to show some parts of the static content. I even tried
chmod 777 -R /usr/share/trac/htdocs
chmod 777 -R /var/www/localhost/htdocs/trac

and first copied htdocs from /usr/share/... to /var/www/... and then symlinked the directory.

/projectname/chrome/common/trac.ico works, but /trac/trac_logo_mini.png and all the other files in /trac/ are inaccessible. In my webserver I've aliased these to another location - without aliases it's the same result there too.
Comment 8 Julien Allanos (RETIRED) gentoo-dev 2006-09-28 11:10:22 UTC
Please, can you test with trac-0.9.6 and report?
Comment 9 Julien Allanos (RETIRED) gentoo-dev 2008-01-06 00:50:55 UTC
No answer, closing.
Comment 10 Thomas Nichols 2008-01-08 11:51:37 UTC
(In reply to comment #9)
> No answer, closing.
> 

Apologies, I missed this earlier. I no longer use Trac (switched to Retrospectiva) but I just attempted a trac install in case I could confirm the bug as closed:

# emerge www-apps/trac 

Then, as non-root user:

$ cd /tmp
$ trac-admin test

and then press Enter for all prompts -- and I get:

Creating and Initializing Project
Failed to create environment. global name 'sqlite' is not defined
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/scripts/admin.py", line 613, in do_initenv
    options=options)
  File "/usr/lib/python2.4/site-packages/trac/env.py", line 124, in __init__
    self.create(options)
  File "/usr/lib/python2.4/site-packages/trac/env.py", line 229, in create
    DatabaseManager(self).init_db()
  File "/usr/lib/python2.4/site-packages/trac/db/api.py", line 69, in init_db
    connector.init_db(**args)
  File "/usr/lib/python2.4/site-packages/trac/db/sqlite_backend.py", line 121, in init_db
    cnx = sqlite.connect(path, timeout=int(params.get('timeout', 10000)))
NameError: global name 'sqlite' is not defined
Failed to initialize environment. 1
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/scripts/admin.py", line 617, in do_initenv
    sys.exit(1)
SystemExit: 1


dev-db/sqlite is installed:

# emerge -pv www-apps/trac dev-db/sqlite

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] www-apps/trac-0.10.3.1  USE="fastcgi mysql postgres vhosts -cgi -enscript -silvercity -sqlite" 0 kB
[ebuild   R   ] dev-db/sqlite-3.4.1  USE="-debug -doc -nothreadsafe -soundex -tcl" 0 kB

Sorry, I'm out of time on this -- but maybe these notes will inspire someone who is still using Trac to test this further (and open a new bug if necessary).

I can see that /usr/share/trac/htdocs/ has images and a css directory, so the original ticket is probably fixed.
Comment 11 Thomas Nichols 2008-01-08 12:02:11 UTC
Oops! My bad, I failed to notice that trac has -sqlite by default. Added
www-apps/trac sqlite
to /etc/portage/package.use and all is fine after re-emerge, I get CSS and images as expected.

Bug confirmed closed in trac 0.10.3.1

-- Thomas.
Comment 12 Julien Allanos (RETIRED) gentoo-dev 2008-01-08 12:19:39 UTC
Can you try with 0.11_beta1 as a last test ? htdocs location has changed again (it seems they are now located as a python package). tracd works fine here, but it has always worked fine, so I'm interested in your testing. Thanks.
Comment 13 Thomas Nichols 2008-01-08 12:48:53 UTC
(In reply to comment #12)
> Can you try with 0.11_beta1 as a last test ? 

Had a quick look -- unmasked =www-apps/trac-0.11_beta2 in package.unmask and then unmasked 
www-apps/trac **
dev-python/pygments **
dev-python/genshi **
in package.keywords -- and now it saya it needs apache as a dependency :-(

Sorry, but I'll have to defer on this one, project deadline looms...

# emerge -pv trac

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ] www-servers/apache-2.2.6-r7  USE="ldap ssl -debug -doc (-selinux) -sni -static -suexec -threads" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -auth_digest -authn_dbd -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker" 61 kB
[ebuild  N    ] dev-python/pytz-2005m  106 kB
[ebuild  N    ] dev-python/pygments-0.9  USE="-doc" 763 kB
[ebuild  N    ] dev-python/genshi-0.4.4  USE="-doc -examples" 227 kB
[ebuild  N    ] virtual/httpd-fastcgi-0  0 kB
[ebuild     U ] www-apps/trac-0.11_beta1 [0.10.3.1] USE="fastcgi mysql postgres sqlite vhosts -cgi -subversion% (-enscript%) (-silvercity%)" 620 kB


Happy hacking :-)

-- Thomas.

Comment 14 Julien Allanos (RETIRED) gentoo-dev 2008-01-08 13:21:09 UTC
That's because you have USE +fastcgi, which makes trac depend on virtual/httpd-cgi. Apache is the default if no other web servers (see the virtual/httpd-cgi ebuild) is installed. You might also disable this use flag for testing with tracd, which is what this bug is about.
Comment 15 Thomas Nichols 2008-01-08 15:04:26 UTC
(In reply to comment #14)
> That's because you have USE +fastcgi, which makes trac depend on
> virtual/httpd-cgi. Apache is the default if no other web servers (see the
> virtual/httpd-cgi ebuild) is installed. You might also disable this use flag
> for testing with tracd, which is what this bug is about.

Thanks Julien. Bug confirmed fixed in 0.11_beta1. I've not set subversion or auth up, but can navigate the wiki ok, the Trac* documentation pages seem to work and CSS and images are sorted. If I were still using Trac I'd be overjoyed to have it packaged so smoothly ;-)

For the record, to use 0.11_beta1 I needed:

# /etc/portage/package.keywords:
www-apps/trac **
dev-python/pygments **
dev-python/genshi **

# /etc/portage/package.use:
www-apps/trac sqlite -fastcgi

# /etc/portage/package.unmask:
=www-apps/trac-0.11_beta1

Best regards,
Thomas.

Comment 16 Julien Allanos (RETIRED) gentoo-dev 2008-01-08 16:03:40 UTC
Fine, thanks for your report.