问题
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>'
回答1:
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.
回答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.
回答3:
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.
回答4:
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
来源:https://stackoverflow.com/questions/9629887/trac-logo-issue