149
149
some path into the site, you'll need to specify it using
150
150
``--prefix=/some_path``.
152
Serving Loggerhead with mod_wsgi
153
--------------------------------
155
A second method for using Loggerhead with apache is to have apache itself
156
execute Loggerhead via mod_wsgi. You need to add configuration for apache and
157
for bazaar to make this work. Example config files are in the Loggerhead doc
158
directory as apache-loggerhead.conf and bazaar.conf. You can copy them into
159
place and use them as a starting point following these directions:
161
1) Install mod_wsgi. On Ubuntu and other Debian derived distros::
163
sudo apt-get install libapache2-mod-wsgi
165
On Fedora-derived distros::
167
su -c yum install mod_wsgi
169
2) Copy the bazaar.conf file where apache will find it (May be done for you if
170
you installed Loggerhead from a distribution package)::
172
# install -d -o apache -g apache -m 0755 /etc/loggerhead
173
# cp -p /usr/share/doc/loggerhead*/bazaar.conf /etc/loggerhead/
174
# ln -s /etc/loggerhead /var/www/.bazaar
176
3) Create the cache directory (May be done for you if you installed Loggerhead
177
from a distribution package)::
179
# install -d -o apache -g apache -m 0700 /var/cache/loggerhead/
181
4) Edit /etc/loggerhead/bazaar.conf. You need to set http_root_dir to the filesystem
182
path that you will find your bzr branches under. Note that normal
183
directories under that path will also be visible in Loggerhead.
185
5) Install the apache conf file::
187
# cp -p /usr/share/doc/loggerhead*/apache-loggerhead.conf /etc/httpd/conf.d/loggerhead.conf
189
6) Edit /etc/httpd/conf.d/loggerhead.conf to point to the url you desire to
190
serve Loggerhead on. This should match with the setting for
191
http_user_prefix in bazaar.conf
193
7) Restart apache and you should be able to start browsing
195
.. note:: If you have SELinux enabled on your system you may need to allow
196
apache to execute files in temporary directories. You will get a
197
MemoryError traceback from python if this is the case. This is because of
198
the way that python ctypes interacts with libffi. To rectify this, you may
199
have to do several things, such as mounting tmpdirs so programs can be
200
executed on them and setting this SELinux boolean::
202
setsebool httpd_tmp_exec on
204
This bug has information about how python and/or Linux distros might solve
205
this issue permanently and links to bugs which diagnose the root cause.
206
https://bugzilla.redhat.com/show_bug.cgi?id=582009