Commit f26a04e0 authored by koniu's avatar koniu
Browse files

Merge pull request #27 from jobe451/master

Headless setup under apache2 / ubuntu 12.04
parents 51aa2f67 9590821c
......@@ -40,7 +40,7 @@ Run standalone
--------------
Run ``webui-standalone.py`` and connect to ``http://localhost:8080``.
There's some optional command-line arguments available:::
There's some optional command-line arguments available::
-h, --help show this help message and exit
-a ADDR, --addr ADDR address to bind to [127.0.0.1]
......@@ -48,7 +48,48 @@ There's some optional command-line arguments available:::
Run as WSGI/CGI
---------------
TODO
Example WSGI/Apache2 config::
WSGIDaemonProcess recoll user=recoll group=recoll threads=5 display-name=%{GROUP} python-path=/var/recoll-webui-master
WSGIScriptAlias /recoll /var/recoll-webui-master/webui-wsgi.py
<Directory /var/recoll-webui-master>
WSGIProcessGroup recoll
Order allow,deny
allow from all
</Directory>
Remarks:
* Without "python-path=" you might see errors that it can't import webui
* Run the WSGIDeamonProcess run under the username (user=xyz) of the user that you want to have exposed via web
Example Upstart-Script for Ubuntu to run the indexer as daemon::
description "recoll indexer"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
pre-start script
exec sudo -u recoll sh -c "/usr/local/share/recoll/examples/rclmon.sh start"
end script
pre-stop script
exec sudo -u recoll sh -c "/usr/local/share/recoll/examples/rclmon.sh stop"
end script
Remarks:
* You need to configure the user for which the indexer should run ("sudo -u [myuser])
Example Crontab entry to have the indexer at least once a day::
22 5 * * * recoll recollindex
Issues
......
......@@ -6,7 +6,9 @@
%for dr, prefix in config['mounts'].items():
%url = url.replace(dr, prefix)
%end
<div class="search-result-title" id="r{{d['sha']}}" title="{{d['abstract']}}"><a href="{{url}}">{{d['label']}}</a></div>
<div class="search-result-title" id="r{{d['sha']}}" title="{{d['abstract']}}">
<a href="download/{{number-1}}?{{query_string}}">{{d['label']}}</a>
</div>
%if len(d['ipath']) > 0:
<div class="search-result-ipath">[{{d['ipath']}}]</div>
%end
......@@ -22,8 +24,7 @@
</div>
%if hasrclextract:
<div class="search-result-links">
<a href="/preview/{{number-1}}?{{query_string}}" target="_blank">Preview</a>
<a href="/download/{{number-1}}?{{query_string}}">Download</a>
<a href="preview/{{number-1}}?{{query_string}}" target="_blank">Preview</a>
</div>
%end
<div class="search-result-date">{{d['time']}}</div>
......
......@@ -295,7 +295,7 @@ def edit(resnum):
pathismine = True
bottle.response.headers['Content-Disposition'] = \
'attachment; filename="%s"' % os.path.basename(path).encode('utf-8')
print >> sys.stderr, "Sending %s with mimetype %s" % (path, doc.mimetype)
path = path.encode('utf-8')
f = open(path, 'r')
if pathismine:
os.unlink(path)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment