@@ -24,7 +24,7 @@
2424 <script type="text/javascript" src="../../_static/underscore.js"></script>
2525 <script type="text/javascript" src="../../_static/doctools.js"></script>
2626 <link rel="top" title="searx 0.8.0 documentation" href="../../index.html" />
27− <link rel="next" title="Search API" href="../search_api.html" />
27+ <link rel="next" title="Engine overview" href="../engine_overview.html" />
2828 <link rel="prev" title="How to contribute" href="../contribution_guide.html" />
2929
3030
@@ -40,50 +40,68 @@
4040 <div class="body" role="main">
4141
4242 <div class="section" id="installation">
43−<h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h1>
44−<p>Step by step installation for Debian / Ubuntu with virtualenv.</p>
43+<h1><a class="toc-backref" href="#id2">Installation</a><a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h1>
44+<p>Step by step installation for Debian/Ubuntu with virtualenv.</p>
4545<p>Source: <a class="reference external" href="https://about.okhin.fr/posts/Searx/">https://about.okhin.fr/posts/Searx/</a> with some additions</p>
4646<p>How to: <a class="reference external" href="https://www.reddit.com/r/privacytoolsIO/comments/366kvn/how_to_setup_your_own_privacy_respecting_search/">Setup searx in a couple of hours with a free SSL
4747certificate</a></p>
48+<div class="contents topic" id="contents">
49+<p class="topic-title first">Contents</p>
50+<ul class="simple">
51+<li><a class="reference internal" href="#installation" id="id2">Installation</a><ul>
52+<li><a class="reference internal" href="#basic-installation" id="id3">Basic installation</a></li>
53+<li><a class="reference internal" href="#configuration" id="id4">Configuration</a></li>
54+<li><a class="reference internal" href="#check" id="id5">Check</a></li>
55+<li><a class="reference internal" href="#uwsgi" id="id6">uwsgi</a></li>
56+<li><a class="reference internal" href="#web-server" id="id7">Web server</a><ul>
57+<li><a class="reference internal" href="#with-nginx" id="id8">with nginx</a></li>
58+<li><a class="reference internal" href="#with-apache" id="id9">with apache</a></li>
59+</ul>
60+</li>
61+<li><a class="reference internal" href="#how-to-update" id="id10">How to update</a></li>
62+<li><a class="reference internal" href="#docker" id="id11">Docker</a></li>
63+</ul>
64+</li>
65+</ul>
66+</div>
4867<div class="section" id="basic-installation">
49−<h2>Basic installation<a class="headerlink" href="#basic-installation" title="Permalink to this headline">¶</a></h2>
68+<h2><a class="toc-backref" href="#id3">Basic installation</a><a class="headerlink" href="#basic-installation" title="Permalink to this headline">¶</a></h2>
5069<p>For Ubuntu, be sure to have enable universe repository.</p>
51−<p>Install packages :</p>
70+<p>Install packages:</p>
5271<div class="code sh highlight-python"><div class="highlight"><pre>sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-pybabel zlib1g-dev libffi-dev libssl-dev
5372</pre></div>
5473</div>
55−<p>Install searx :</p>
74+<p>Install searx:</p>
5675<div class="code sh highlight-python"><div class="highlight"><pre>cd /usr/local
5776sudo git clone https://github.com/asciimoo/searx.git
5877sudo useradd searx -d /usr/local/searx
5978sudo chown searx:searx -R /usr/local/searx
6079</pre></div>
6180</div>
62−<p>Install dependencies in a virtualenv :</p>
81+<p>Install dependencies in a virtualenv:</p>
6382<div class="code sh highlight-python"><div class="highlight"><pre>sudo -u searx -i
6483cd /usr/local/searx
6584virtualenv searx-ve
6685. ./searx-ve/bin/activate
67−pip install -r requirements.txt
68−python setup.py install
86+./manage.sh update_packages
6987</pre></div>
7088</div>
7189</div>
7290<div class="section" id="configuration">
73−<h2>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h2>
91+<h2><a class="toc-backref" href="#id4">Configuration</a><a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h2>
7492<div class="code sh highlight-python"><div class="highlight"><pre>sed -i -e "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml
7593</pre></div>
7694</div>
7795<p>Edit searx/settings.yml if necessary.</p>
7896</div>
7997<div class="section" id="check">
80−<h2>Check<a class="headerlink" href="#check" title="Permalink to this headline">¶</a></h2>
81−<p>Start searx :</p>
98+<h2><a class="toc-backref" href="#id5">Check</a><a class="headerlink" href="#check" title="Permalink to this headline">¶</a></h2>
99+<p>Start searx:</p>
82100<div class="code sh highlight-python"><div class="highlight"><pre>python searx/webapp.py
83101</pre></div>
84102</div>
85103<p>Go to <a class="reference external" href="http://localhost:8888">http://localhost:8888</a></p>
86−<p>If everything works fine, disable the debug option in settings.yml :</p>
104+<p>If everything works fine, disable the debug option in settings.yml:</p>
87105<div class="code sh highlight-python"><div class="highlight"><pre>sed -i -e "s/debug : True/debug : False/g" searx/settings.yml
88106</pre></div>
89107</div>
@@ -92,13 +110,13 @@ python setup.py install
92110twice).</p>
93111</div>
94112<div class="section" id="uwsgi">
95−<h2>uwsgi<a class="headerlink" href="#uwsgi" title="Permalink to this headline">¶</a></h2>
96−<p>Install packages :</p>
113+<h2><a class="toc-backref" href="#id6">uwsgi</a><a class="headerlink" href="#uwsgi" title="Permalink to this headline">¶</a></h2>
114+<p>Install packages:</p>
97115<div class="code sh highlight-python"><div class="highlight"><pre>sudo apt-get install uwsgi uwsgi-plugin-python
98116</pre></div>
99117</div>
100118<p>Create the configuration file /etc/uwsgi/apps-available/searx.ini with
101−this content :</p>
119+this content:</p>
102120<div class="highlight-python"><div class="highlight"><pre>[uwsgi]
103121# Who will run the code
104122uid = searx
@@ -127,7 +145,7 @@ pythonpath = /usr/local/searx/
127145chdir = /usr/local/searx/searx/
128146</pre></div>
129147</div>
130−<p>Activate the uwsgi application and restart :</p>
148+<p>Activate the uwsgi application and restart:</p>
131149<div class="code sh highlight-python"><div class="highlight"><pre>cd /etc/uwsgi/apps-enabled
132150ln -s ../apps-available/searx.ini
133151/etc/init.d/uwsgi restart
@@ -135,18 +153,18 @@ ln -s ../apps-available/searx.ini
135153</div>
136154</div>
137155<div class="section" id="web-server">
138−<h2>Web server<a class="headerlink" href="#web-server" title="Permalink to this headline">¶</a></h2>
156+<h2><a class="toc-backref" href="#id7">Web server</a><a class="headerlink" href="#web-server" title="Permalink to this headline">¶</a></h2>
139157<div class="section" id="with-nginx">
140−<h3>with nginx<a class="headerlink" href="#with-nginx" title="Permalink to this headline">¶</a></h3>
158+<h3><a class="toc-backref" href="#id8">with nginx</a><a class="headerlink" href="#with-nginx" title="Permalink to this headline">¶</a></h3>
141159<p>If nginx is not installed (uwsgi will not work with the package
142−nginx-light) :</p>
160+nginx-light):</p>
143161<div class="code sh highlight-python"><div class="highlight"><pre>sudo apt-get install nginx
144162</pre></div>
145163</div>
146164<div class="section" id="hosted-at">
147165<h4>Hosted at /<a class="headerlink" href="#hosted-at" title="Permalink to this headline">¶</a></h4>
148166<p>Create the configuration file /etc/nginx/sites-available/searx with this
149−content :</p>
167+content:</p>
150168<div class="code nginx highlight-python"><div class="highlight"><pre>server {
151169 listen 80;
152170 server_name searx.example.com;
@@ -159,15 +177,16 @@ content :</p>
159177}
160178</pre></div>
161179</div>
162−<p>Restart service :</p>
180+<p>Restart service:</p>
163181<div class="code sh highlight-python"><div class="highlight"><pre>sudo service nginx restart
164182sudo service uwsgi restart
165183</pre></div>
166184</div>
185+</div>
167186<div class="section" id="from-subdirectory-url-searx">
168−<h5>from subdirectory URL (/searx)<a class="headerlink" href="#from-subdirectory-url-searx" title="Permalink to this headline">¶</a></h5>
187+<h4>from subdirectory URL (/searx)<a class="headerlink" href="#from-subdirectory-url-searx" title="Permalink to this headline">¶</a></h4>
169188<p>Add this configuration in the server config file
170−/etc/nginx/sites-available/default :</p>
189+/etc/nginx/sites-available/default:</p>
171190<div class="code nginx highlight-python"><div class="highlight"><pre>location = /searx { rewrite ^ /searx/; }
172191location /searx {
173192 try_files $uri @searx;
@@ -184,37 +203,35 @@ location @searx {
184203<div class="highlight-python"><div class="highlight"><pre>base_url : http://your.domain.tld/searx/
185204</pre></div>
186205</div>
187−<p>Restart service :</p>
206+<p>Restart service:</p>
188207<div class="code sh highlight-python"><div class="highlight"><pre>sudo service nginx restart
189208sudo service uwsgi restart
190209</pre></div>
191210</div>
192−</div>
193211<div class="section" id="disable-logs">
194212<h5>disable logs<a class="headerlink" href="#disable-logs" title="Permalink to this headline">¶</a></h5>
195213<p>for better privacy you can disable nginx logs about searx.</p>
196−<p>how to proceed : below <code class="docutils literal"><span class="pre">uwsgi_pass</span></code> in
214+<p>how to proceed: below <code class="docutils literal"><span class="pre">uwsgi_pass</span></code> in
197215/etc/nginx/sites-available/default add</p>
198216<div class="highlight-python"><div class="highlight"><pre><span class="n">access_log</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">null</span><span class="p">;</span>
199217<span class="n">error_log</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">null</span><span class="p">;</span>
200218</pre></div>
201219</div>
202−<p>Restart service :</p>
220+<p>Restart service:</p>
203221<div class="code sh highlight-python"><div class="highlight"><pre>sudo service nginx restart
204222</pre></div>
205223</div>
206224</div>
207225</div>
208226</div>
209−</div>
210227<div class="section" id="with-apache">
211−<h2>with apache<a class="headerlink" href="#with-apache" title="Permalink to this headline">¶</a></h2>
212−<p>Add wsgi mod :</p>
228+<h3><a class="toc-backref" href="#id9">with apache</a><a class="headerlink" href="#with-apache" title="Permalink to this headline">¶</a></h3>
229+<p>Add wsgi mod:</p>
213230<div class="code sh highlight-python"><div class="highlight"><pre>sudo apt-get install libapache2-mod-uwsgi
214231sudo a2enmod uwsgi
215232</pre></div>
216233</div>
217−<p>Add this configuration in the file /etc/apache2/apache2.conf :</p>
234+<p>Add this configuration in the file /etc/apache2/apache2.conf:</p>
218235<div class="code apache highlight-python"><div class="highlight"><pre><Location />
219236 Options FollowSymLinks Indexes
220237 SetHandler uwsgi-handler
@@ -225,39 +242,56 @@ sudo a2enmod uwsgi
225242<p>Note that if your instance of searx is not at the root, you should
226243change <code class="docutils literal"><span class="pre"><Location</span> <span class="pre">/></span></code> by the location of your instance, like
227244<code class="docutils literal"><span class="pre"><Location</span> <span class="pre">/searx></span></code>.</p>
228−<p>Restart Apache :</p>
245+<p>Restart Apache:</p>
229246<div class="code sh highlight-python"><div class="highlight"><pre>sudo /etc/init.d/apache2 restart
230247</pre></div>
231248</div>
232−</div>
233249<div class="section" id="id1">
234−<h2>disable logs<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
250+<h4>disable logs<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h4>
235251<p>For better privacy you can disable Apache logs.</p>
236−<p>WARNING : not tested</p>
237−<p>WARNING : you can only disable logs for the whole (virtual) server not
252+<p>WARNING: not tested</p>
253+<p>WARNING: you can only disable logs for the whole (virtual) server not
238254for a specific path.</p>
239−<p>Go back to /etc/apache2/apache2.conf and above <code class="docutils literal"><span class="pre"><Location</span> <span class="pre">/></span></code> add :</p>
255+<p>Go back to /etc/apache2/apache2.conf and above <code class="docutils literal"><span class="pre"><Location</span> <span class="pre">/></span></code> add:</p>
240256<div class="code apache highlight-python"><div class="highlight"><pre>CustomLog /dev/null combined
241257</pre></div>
242258</div>
243−<p>Restart Apache :</p>
259+<p>Restart Apache:</p>
244260<div class="code sh highlight-python"><div class="highlight"><pre>sudo /etc/init.d/apache2 restart
245261</pre></div>
246262</div>
247263</div>
264+</div>
265+</div>
248266<div class="section" id="how-to-update">
249−<h2>How to update<a class="headerlink" href="#how-to-update" title="Permalink to this headline">¶</a></h2>
267+<h2><a class="toc-backref" href="#id10">How to update</a><a class="headerlink" href="#how-to-update" title="Permalink to this headline">¶</a></h2>
250268<div class="code sh highlight-python"><div class="highlight"><pre>cd /usr/local/searx
251269sudo -u searx -i
252270. ./searx-ve/bin/activate
253271git stash
254272git pull origin master
255273git stash apply
256−pip install --upgrade -r requirements.txt
274+./manage.sh update_packages
257275sudo service uwsgi restart
258276</pre></div>
259277</div>
260278</div>
279+<div class="section" id="docker">
280+<h2><a class="toc-backref" href="#id11">Docker</a><a class="headerlink" href="#docker" title="Permalink to this headline">¶</a></h2>
281+<p>Make sure you have installed Docker. For instance, you can deploy searx like this:</p>
282+<div class="code sh highlight-python"><div class="highlight"><pre>docker pull wonderfall/searx
283+docker run -d --name searx -p $PORT:8888 wonderfall/searx
284+</pre></div>
285+</div>
286+<p>Go to <a class="reference external" href="http://localhost:$PORT">http://localhost:$PORT</a>.</p>
287+<p>See <a class="reference external" href="https://hub.docker.com/r/wonderfall/searx/">https://hub.docker.com/r/wonderfall/searx/</a> for more informations.</p>
288+<p>It’s also possible to build searx from the embedded Dockerfile.</p>
289+<div class="code sh highlight-python"><div class="highlight"><pre>git clone https://github.com/asciimoo/searx.git
290+cd searx
291+docker build -t whatever/searx .
292+</pre></div>
293+</div>
294+</div>
261295</div>
262296
263297