WebFaction
Community site: login faq

Hello,

I'm installing Trac 0.12.3 via easy_install and run it with Python 2.7 inner Apache/WSGI-configuration which starts Trac on the subdomain 'trac.mutetella.org'. This is my Apache 'httpd.conf':

ServerRoot "/home/claus/webapps/apache/apache2"

LoadModule alias_module       modules/mod_alias.so
LoadModule authz_host_module  modules/mod_authz_host.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authz_user_module  modules/mod_authz_user.so
LoadModule authn_file_module  modules/mod_authn_file.so
LoadModule dir_module         modules/mod_dir.so
LoadModule env_module         modules/mod_env.so
LoadModule log_config_module  modules/mod_log_config.so
LoadModule mime_module        modules/mod_mime.so
LoadModule rewrite_module     modules/mod_rewrite.so
LoadModule setenvif_module    modules/mod_setenvif.so
LoadModule wsgi_module        modules/mod_wsgi.so

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /home/claus/logs/user/access_apache.log combined
DirectoryIndex index.py
DocumentRoot /home/claus/webapps/apache/htdocs
ErrorLog /home/claus/logs/user/error_apache.log
KeepAlive Off
Listen 25482
MaxSpareThreads 3
MinSpareThreads 1
ServerLimit 1
SetEnvIf X-Forwarded-SSL on HTTPS=1
ThreadsPerChild 5
WSGIDaemonProcess apache processes=5 python-path=/home/claus/webapps/apache/lib/python2.7 threads=1
WSGIProcessGroup apache
WSGIRestrictEmbedded On
WSGILazyInitialization On

Alias /chrome/common /home/claus/webapps/trac/.static/htdocs/common
Alias /chrome/site /home/claus/webapps/trac/.static/htdocs/site

<Directory /home/claus/webapps/trac/.static>
  Order Allow,Deny
  Allow from All
</Directory>

WSGIScriptAlias / /home/claus/webapps/trac/.static/cgi-bin/trac.wsgi

<Directory /home/claus/webapps/trac/.static/cgi-bin>
    WSGIApplicationGroup %{GLOBAL}
    Order allow,deny
    Allow from all
</Directory>

<LocationMatch "/[^/]+/login">
    AuthType Digest
    AuthName "trac"
    AuthDigestDomain /
    AuthUserFile /home/claus/webapps/trac/.htpasswd
    Require valid-user
</LocationMatch>

<Directory "/home/claus/webapps/apache/htdocs">
    AddHandler wsgi-script .py
</Directory>

The Trac documentation says, if Trac runs under an Apache server, it is recommended to make an alias to the static files (see the 2 'Alias'-definitions above in my 'httpd.conf').

But it makes no difference if I run Apache with or without this Alias-definitions. Trac takes the static files never from the '.static'-path but only from the '.egg-cache'-path in the '/home/claus/webapps/trac'-path.

This is my 'trac.wsgi':

import os
import site

site.addsitedir('/home/claus/lib/python2.7')

os.environ['TRAC_ENV_PARENT_DIR'] = '/home/claus/webapps/trac'
os.environ['PYTHON_EGG_CACHE'] = '/home/claus/webapps/trac/.egg-cache'

import trac.web.main
application = trac.web.main.dispatch_request

Why ignores Trac the Apache-Aliases? What is wrong?

Thank you much for your help and sorry for my horrible english... ;-(

Claus

asked 04 Aug '12, 10:59

mutetella
23258
accept rate: 0%

Looks like your alias' are working correctly because the trac logo is being served from your Alias path: http://trac.mutetella.org/wiki/chrome/common/trac_logo_mini.png

(04 Aug '12, 13:02) timg ♦♦

It seems so, but even if I remove the '.static/htdocs'-path the trac logo is display nevertheless from the Alias path. How can this be true? Even if I use the following 'httpd.conf' without any Aliases except the Script-Alias and restart Apache nothing changed:

ServerRoot "/home/claus/webapps/apache/apache2"

LoadModule alias_module       modules/mod_alias.so
LoadModule authz_host_module  modules/mod_authz_host.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authz_user_module  modules/mod_authz_user.so
LoadModule authn_file_module  modules/mod_authn_file.so
LoadModule dir_module         modules/mod_dir.so
LoadModule env_module         modules/mod_env.so
LoadModule log_config_module  modules/mod_log_config.so
LoadModule mime_module        modules/mod_mime.so
LoadModule rewrite_module     modules/mod_rewrite.so
LoadModule setenvif_module    modules/mod_setenvif.so
LoadModule wsgi_module        modules/mod_wsgi.so

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /home/claus/logs/user/access_apache.log combined
DirectoryIndex index.py
DocumentRoot /home/claus/webapps/apache/htdocs
ErrorLog /home/claus/logs/user/error_apache.log
KeepAlive Off
Listen 25482
MaxSpareThreads 3
MinSpareThreads 1
ServerLimit 1
SetEnvIf X-Forwarded-SSL on HTTPS=1
ThreadsPerChild 5
WSGIDaemonProcess apache processes=5 python-path=/home/claus/webapps/apache/lib/python2.7 threads=1
WSGIProcessGroup apache
WSGIRestrictEmbedded On
WSGILazyInitialization On

#Alias /chrome/common /home/claus/webapps/trac/.static/htdocs/common
#Alias /chrome/site /home/claus/webapps/trac/.static/htdocs/site

#<Directory /home/claus/webapps/trac/.static/>
#  Order Allow,Deny
#  Allow from All
#</Directory>

WSGIScriptAlias / /home/claus/webapps/trac/.static/cgi-bin/trac.wsgi

#<Directory /home/claus/webapps/trac/.static/>
#    WSGIApplicationGroup %{GLOBAL}
#    Order allow,deny
#    Allow from all
#</Directory>

<LocationMatch "/[^/]+/login">
    AuthType Digest
    AuthName "trac"
    AuthDigestDomain /
    AuthUserFile /home/claus/webapps/trac/.htpasswd
    Require valid-user
</LocationMatch>

#<Directory "/home/claus/webapps/apache/htdocs">
#    AddHandler wsgi-script .py
#</Directory>

Could it be a caching-problem?

I'm so confused...

Claus

permanent link

answered 04 Aug '12, 16:28

mutetella
23258
accept rate: 0%

It is possibly a caching issue. Is the path to the logo file correct?

http://trac.mutetella.org/wiki/chrome/site/your_project_logo.png

The logo code has a note in it,

<img src="/wiki/chrome/site/your_project_logo.png" alt="(please configure the [header_logo] section in trac.ini)">

Have you configured this file correctly? Does it indeed exist on disk?

You may also consider using nginx to serve the media.

(04 Aug '12, 17:27) johns

I have not yet set an own project-logo but this is not the problem... I can't understand, why the following urls by example exists at all:

http://trac.mutetella.org/wiki/chrome/common/trac.ico

http://trac.mutetella.org/wiki/chrome/common/trac_logo_mini.png

http://trac.mutetella.org/wiki/chrome/common/dots.gif

and so on...

Currently I haven't set any Aliases to that '/wiki/chrom/common'-path. Neither in the Apache 'httpd.conf' nor in the 'trac.ini'. This urls should not be exist...??

(05 Aug '12, 03:46) mutetella

All those files are being located in your /home/claus/webapps/trac/.static/htdocs/common directory and they are files used by Trac's default template, so you don't have to set any aliases for them.

You can check Trac's Interface Customization wiki entry, as well as the files in your templates directory in your trac instance, for a little bit more depth on that.

(05 Aug '12, 11:13) iliasr ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×225
×125
×62
×26
×9

question asked: 04 Aug '12, 10:59

question was seen: 10,029 times

last updated: 05 Aug '12, 11:13

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM