~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to docs/index.rst

  • Committer: Jelmer Vernooij
  • Date: 2009-06-02 22:10:00 UTC
  • mto: This revision was merged to the branch mainline in revision 360.
  • Revision ID: jelmer@samba.org-20090602221000-qdrc9hagb5h3w6to
Install the bzr plugin for loggerhead in setup.py.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Loggerhead:  A web viewer for ``bzr`` branches
2
 
==============================================
3
 
 
4
 
Loggerhead is a web viewer for projects in Bazaar. It can be used to navigate 
5
 
a branch history, annotate files, view patches, perform searches, etc.
6
 
Loggerhead is heavily based on `bazaar-webserve
7
 
<https://launchpad.net/bzr-webserve>`_, which was, in turn, loosely
8
 
based on `hgweb <http://mercurial.selenic.com/wiki/HgWebDirStepByStep>`_.
9
 
 
10
 
 
11
 
Getting Started
12
 
---------------
13
 
 
14
 
Loggerhead depends on the following Python libraries.:
15
 
 
16
 
- SimpleTAL for templating.
17
 
 
18
 
- simplejson for producing JSON data.
19
 
 
20
 
- Paste for the server. (You need version 1.2 or newer of Paste).
21
 
 
22
 
- Paste Deploy  (optional, needed when proxying through Apache).
23
 
 
24
 
- flup (optional, needed to use FastCGI, SCGI or AJP).
25
 
 
26
 
 
27
 
Installing Dependencies Using Ubuntu Packages
28
 
#############################################
29
 
 
30
 
.. code-block:: sh
31
 
 
32
 
   $ sudo apt-get install python-simpletal
33
 
   $ sudo apt-get install python-simplejson
34
 
   $ sudo apt-get install python-paste
35
 
   $ sudo apt-get install python-pastedeploy
36
 
   $ sudo apt-get install python-flup
37
 
 
38
 
Installing Dependencies Using :command:`easy_install`
39
 
#####################################################
40
 
 
41
 
.. code-block:: sh
42
 
 
43
 
   $ easy_install \
44
 
     -f http://www.owlfish.com/software/simpleTAL/py2compatible/download.html \
45
 
     SimpleTAL
46
 
   $ easy_install simplejson
47
 
   $ easy_install Paste
48
 
   $ easy_install PasteDeploy
49
 
   $ easy_install flup
50
 
 
51
 
 
52
 
Running the Standalone Loggerhead Server
53
 
----------------------------------------
54
 
 
55
 
After installing all the dependencies, you should be able to run
56
 
:command:`serve-branches` with the branch you want to serve on the
57
 
command line:
58
 
 
59
 
.. code-block:: sh
60
 
 
61
 
    ./serve-branches ~/path/to/branch
62
 
 
63
 
By default, the script listens on port 8080, so head to
64
 
http://localhost:8080/ in your browser to see the branch.
65
 
 
66
 
You can also pass a directory that contains branches to the script,
67
 
and it will serve a very simple directory listing at other pages.
68
 
 
69
 
You may update the Bazaar branches being viewed at any time.
70
 
Loggerhead will notice and refresh, and Bazaar uses its own branch
71
 
locking to prevent corruption.
72
 
 
73
 
See :doc:`serve-branches` for all command line options.
74
 
 
75
 
Running Loggerhead as a Daemon
76
 
------------------------------
77
 
 
78
 
To run Loggerhead as a linux daemon:
79
 
 
80
 
1) Copy the ``loggerheadd`` scipt to ``/etc/init.d``
81
 
 
82
 
.. code-block:: sh
83
 
 
84
 
   $ sudo cp ./loggerheadd /etc/init.d
85
 
 
86
 
2) Edit the file to configure where your Loggerhead is installed, and which
87
 
   serve-branches options you would like.
88
 
 
89
 
.. code-block:: sh
90
 
 
91
 
   $ sudo vim /etc/init.d/loggerheadd
92
 
 
93
 
3) Register the service
94
 
 
95
 
.. code-block:: sh
96
 
 
97
 
   # on upstart based systems like Ubuntu run: 
98
 
   $ sudo update-rc.d loggerheadd defaults
99
 
 
100
 
   # on Sysvinit based systems like Centos or SuSE run:
101
 
   $ sudo chkconfig --add loggerheadd
102
 
 
103
 
 
104
 
Using Loggerhead as a Bazaar Plugin
105
 
------------------------------------
106
 
 
107
 
This branch contains experimental support for using Loggerhead as a Bazaar
108
 
plugin.  To use it, place the top-level Loggerhead directory (the one
109
 
containing COPYING.txt) at ``~/.bazaar/plugins/loggerhead``.  E.g.:
110
 
 
111
 
.. code-block:: sh
112
 
 
113
 
   $ bzr branch lp:loggerhead ~/.bazaar/plugins/loggerhead
114
 
   $ cd ~/myproject
115
 
   $ bzr serve --http
116
 
 
117
 
 
118
 
Using a Config File
119
 
-------------------
120
 
 
121
 
To hide branches from being displayed, add to ``~/.bazaar/locations.conf``,
122
 
under the branch's section:
123
 
 
124
 
.. code-block:: ini
125
 
 
126
 
    [/path/to/branch]
127
 
    http_serve = False
128
 
 
129
 
More configuration options to come soon.
130
 
 
131
 
 
132
 
Serving Loggerhead behind Apache
133
 
--------------------------------
134
 
 
135
 
If you want to view Bazaar branches from your existing Apache
136
 
installation, you'll need to configure Apache to proxy certain
137
 
requests to Loggerhead.  Adding lines like this to your Apache
138
 
configuration is one way to do this:
139
 
 
140
 
.. code-block:: apache
141
 
 
142
 
    <Location "/branches/">
143
 
        ProxyPass http://127.0.0.1:8080/branches/
144
 
        ProxyPassReverse http://127.0.0.1:8080/branches/
145
 
    </Location>
146
 
 
147
 
If Paste Deploy is installed, the :command:`serve-branches` script can be
148
 
run behind a proxy at the root of a site, but if you're running it at
149
 
some path into the site, you'll need to specify it using
150
 
``--prefix=/some_path``.
151
 
 
152
 
Serving Loggerhead with mod_wsgi
153
 
--------------------------------
154
 
 
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:
160
 
 
161
 
1) Install mod_wsgi.  On Ubuntu and other Debian derived distros::
162
 
 
163
 
    sudo apt-get install libapache2-mod-wsgi
164
 
 
165
 
   On Fedora-derived distros::
166
 
 
167
 
    su -c yum install mod_wsgi
168
 
 
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)::
171
 
 
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
175
 
 
176
 
3) Create the cache directory (May be done for you if you installed Loggerhead
177
 
   from a distribution package)::
178
 
 
179
 
    # install -d -o apache -g apache -m 0700 /var/cache/loggerhead/
180
 
 
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.
184
 
 
185
 
5) Install the apache conf file::
186
 
 
187
 
     # cp -p /usr/share/doc/loggerhead*/apache-loggerhead.conf /etc/httpd/conf.d/loggerhead.conf
188
 
 
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
192
 
 
193
 
7) Restart apache and you should be able to start browsing
194
 
 
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::
201
 
 
202
 
       setsebool httpd_tmp_exec on
203
 
 
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
207
 
 
208
 
Search
209
 
------
210
 
 
211
 
Search is currently supported by using the bzr-search plugin (available
212
 
at: https://launchpad.net/bzr-search ).
213
 
 
214
 
You need to have the plugin installed and each branch indexed to allow
215
 
searching on branches.
216
 
 
217
 
Command-Line Reference
218
 
----------------------
219
 
 
220
 
.. toctree::
221
 
   :maxdepth: 2
222
 
 
223
 
   serve-branches
224
 
 
225
 
 
226
 
Support
227
 
-------
228
 
 
229
 
Discussion should take place on the bazaar-dev mailing list at
230
 
mailto:bazaar@lists.canonical.com.  You can join the list at
231
 
<https://lists.ubuntu.com/mailman/listinfo/bazaar>.  You don't need to
232
 
subscribe to post, but your first post will be held briefly for manual
233
 
moderation.
234
 
 
235
 
Bugs, support questions and merge proposals are tracked on Launchpad, e.g:
236
 
 
237
 
    https://bugs.launchpad.net/loggerhead
238
 
 
239
 
 
240
 
Hacking
241
 
-------
242
 
 
243
 
To run Loggerhead tests, you will need to install the package ``python-nose``,
244
 
and run its :command:`nosetests` script in the Loggerhead directory:
245
 
 
246
 
.. code-block:: sh
247
 
 
248
 
    nosetests
249
 
 
250
 
 
251
 
License
252
 
-------
253
 
 
254
 
GNU GPLv2 or later.
255
 
 
256
 
See Also
257
 
--------
258
 
 
259
 
https://launchpad.net/loggerhead
260
 
 
261
 
Index
262
 
=====
263
 
 
264
 
- :ref:`genindex`