3

I installed trac (v 0.11.7) on my debian box. Everything runs fine except I couldn't get logo to display. I used mod-wsgi and deployed the project to a folder named 'deploy'. Inside deploy folder, I have a htdocs folder that has two subfolders: common and site. I changed the [header_logo] of trac.ini so it read

src=site/logo.jpg
width=200
height=100

It won't display while logo.jpg was stored under site folder. When I changed the src to common/trac_logo_mini.png, it did show up. I then moved my logo.jpg to the common subfolder and changed the src to common/logo.jpg. Still no go.

In my browser if I used

https://192.168.1.10/myproject/chrome/common/trac_logo_mini.png

, the browser would showed the picture. When I copied trac_logo_mini.png to mylogo.png and used

https://192.168.1.10/myproject/chrome/common/mylogo.png

, the browser won't display mylogo.png.

I wonder why.

Here is my settings. I did trac-admin myproject/env deploy myproject/deploy. The logo is in myproject/deploy/site folder.

In the default-ssl file, I have

WSGIScriptAlias /myproject /trac_pool/myproject/deploy/cgi-bin/trac.wsgi
<Directory /trac_pool/myproject/deploy>
    WSGIApplicationGroup %{GLOBAL}
    Order deny,allow
    Allow from all
</Directory>

<Location "/myproject">
    AuthType Basic
    AuthName "My Project Trac"
    AuthUserFile /trac_pool/myproject/trac.htpasswd
    Require valid-user
</Location>'
Unplug
  • 709
  • 10
  • 27

4 Answers4

3

Here is how my server is set up, it may help resolve your issue.

trac.ini:

[header_logo]
src = site/mylogo.gif

File system:

/srv/trac$ ls -1F
  attachments/
  conf/
  db/
  deploy/
  htdocs/
  log/
  plugins/
  README
  templates/
  VERSION
/srv/trac$ ls -1F htdocs/
  mylogo.gif
  index.html@
  print.css
  site_custom.js
  style.css

Essentially, using the 'site/' prefix in trac.ini maps to the 'htdocs' folder in the Trac folder hierarchy.

bta
  • 43,959
  • 6
  • 69
  • 99
2

I also had problems with my trac logo. It turned out that the file permissions were such that user www-data could not read the logo file. Fixed that through chmod +r <logofile> and the problem was gone.

Waldir Leoncio
  • 10,853
  • 19
  • 77
  • 107
Michiel
  • 21
  • 1
0

Great answer. Place your logo in the htdocs folder and configure your trac.ini header logo section as expressed below. site redirects to the htdocs folder and mylogo.gif is the image.

[header_logo]

src = site/mylogo.gif

0

Have you tried setting the src of your logo to just src=/logo.jpg?

When I look in my Admin section of trac, I see that I have the logo set to to root and when I look at my trac install, I have the logo located in the root of htdocs.

enter image description here

Josh Laase
  • 326
  • 1
  • 13
  • I just tried that but it didn't work. I checked the logo url, it was: https://192.168.1.10/logo.jpg – Unplug Mar 12 '12 at 02:05
  • That URL is the same for my trac install. Do you have a tool like Firebug installed or access to the http logs to see what type of response code the web server is returning when the browser requests the URL. That often helps pin point the issue to a file not found or access denied, etc. Let me know what you find out if you can get that information. – Josh Laase Mar 12 '12 at 19:03
  • It says "Failed to load resource: the server responded with a status of 404 (Not Found)." and the url is >https://my.domain.name/MyProjectTrac/chrome/site/logo.jpg – Unplug Mar 13 '12 at 19:19
  • What is the file path to your logo.jpg file? Does that path match up to the root of your web server? From what you said before, the URL in the web page was 192.168.1.10/logo, which does not match what the 404 error is. I would assume that the file must be located at something like /MyProjectTrac/chrome/site/logo.jpg based on the 404 error. – Josh Laase Mar 13 '12 at 22:56
  • In your question, you have this listed for your trac.ini file `src=site/logo.jpg width=200 height=100` Then you list `https://192.168.1.10/myproject/chrome/common/mylogo.png` as the path to your logo file on the file system. The first thing that jumps out at me is that you have the file called **logo.jpg** in your ini file but **mylogo.png** in your URLs. Does the file name on the filesystem match what is in your ini file? – Josh Laase Mar 15 '12 at 14:59
  • My bad. I did check the file names and they matched. I used logo.jpg. – Unplug Mar 16 '12 at 15:34
  • At this point, I would have to play around with what the URL to the image in the Trac website is and keep moving the file until I found the correct directory. That is how we got it working on our side. Sorry I do not have a solution for you. – Josh Laase Mar 19 '12 at 16:34
  • It's cool. I will double check everything and see if I can find out why. – Unplug Mar 20 '12 at 19:43