Mickaël

You are a hero!

That means thank you very much. Your documentation skills are as amazing as your dev-ops skills.

I struggle with both ...

Cheers

Mike

On 10/10/2019 12:20 am, Mickaël Bucas wrote:
Hi Mike

I encountered the same issue when I changed my system Python to
version 3.6, so I'm currently running Trac 1.2 in a virtualenv I've
created with the following commands :
--------------8<--------------
mkdir -p /var/lib/trac/$PROJECT/venv
virtualenv -p python2 /var/lib/trac/$PROJECT/venv
source /var/lib/trac/$PROJECT/venv/bin/activate
pip install trac==1.2.2 mysql-python Babel pygments
# Subversion bindings
ln -s /usr/lib64/python2.7/site-packages/libsvn
/var/lib/trac/$PROJECT/venv/lib/python2.7/site-packages/
ln -s /usr/lib64/python2.7/site-packages/svn
/var/lib/trac/$PROJECT/venv/lib/python2.7/site-packages/
--------------8<--------------

To start Trac, I use `tracd`, but it must run when the virtualenv is activated
--------------8<--------------
start-stop-daemon --start \
     --user ${TRACD_USER:-tracd} --group ${TRACD_GROUP:-tracd} \
     --pidfile /var/run/tracd-${TRACD_PROJECT}.pid --make-pidfile --background \
     --exec /opt/bin/tracd-start-server.sh -- \
     ${TRACD_PROJECT} ${TRACD_PORT} ${TRACD_OPTS}
--------------8<--------------

`/opt/bin/tracd-start-server.sh` contains :
--------------8<--------------
# Parameters
TRACD_PROJECT=$1
shift
TRACD_PORT=$1
shift
TRACD_OPTS=$*

# Virtualenv
source /var/lib/trac/${TRACD_PROJECT}/venv/bin/activate

export PYTHON_EGG_CACHE="/var/lib/trac/${TRACD_PROJECT}/trac/egg-cache"

# Exec to keep the PID recorded by start-stop-daemon
exec /var/lib/trac/${TRACD_PROJECT}/venv/bin/tracd \
     -p ${TRACD_PORT} --single-env ${TRACD_OPTS}    \
     --base-path=/trac/${TRACD_PROJECT}             \
     /var/lib/trac/${TRACD_PROJECT}/trac            \
     >> /var/lib/trac/${TRACD_PROJECT}/trac/log/tracd-output.log 2>&1
--------------8<--------------

Then you must tell Apache to proxy to the `tracd` server :
--------------8<--------------
<Location /trac/$PROJECT >
     # Proxy to tracd
     ProxyPass http://$SITE:$NUMBER/trac/$PROJECT ttl=60
     ProxyPassReverse http://$SITE:$NUMBER/trac/$PROJECT
</Location>
--------------8<--------------

So far it works as expected.

I still have to work on upgrading to Trac 1.4, whose dependencies are
different. And I will have to check if the extensions I use are still
working.

Best regards

Mickaël Bucas


--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/f1164d63-723b-9d13-2029-d7210bfdf13d%40dewhirst.com.au.

Reply via email to