From 1d6597b40773b688ca317e1ab1ffe133b370afb1 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Tue, 17 Nov 2015 23:13:30 +0100 Subject: [enh] initial structure --- docs/dev/install/installation.rst | 277 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 277 insertions(+) create mode 100644 docs/dev/install/installation.rst (limited to 'docs/dev/install') diff --git a/docs/dev/install/installation.rst b/docs/dev/install/installation.rst new file mode 100644 index 000000000..2ce6a6b54 --- /dev/null +++ b/docs/dev/install/installation.rst @@ -0,0 +1,277 @@ +Installation +============ + +Step by step installation for Debian / Ubuntu with virtualenv. + +Source: https://about.okhin.fr/posts/Searx/ with some additions + +How to: `Setup searx in a couple of hours with a free SSL +certificate `__ + +Basic installation +------------------ + +For Ubuntu, be sure to have enable universe repository. + +Install packages : + +.. code:: sh + + sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-pybabel zlib1g-dev libffi-dev libssl-dev + +Install searx : + +.. code:: sh + + cd /usr/local + sudo git clone https://github.com/asciimoo/searx.git + sudo useradd searx -d /usr/local/searx + sudo chown searx:searx -R /usr/local/searx + +Install dependencies in a virtualenv : + +.. code:: sh + + sudo -u searx -i + cd /usr/local/searx + virtualenv searx-ve + . ./searx-ve/bin/activate + pip install -r requirements.txt + python setup.py install + +Configuration +------------- + +.. code:: sh + + sed -i -e "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml + +Edit searx/settings.yml if necessary. + +Check +----- + +Start searx : + +.. code:: sh + + python searx/webapp.py + +Go to http://localhost:8888 + +If everything works fine, disable the debug option in settings.yml : + +.. code:: sh + + sed -i -e "s/debug : True/debug : False/g" searx/settings.yml + +At this point searx is not demonized ; uwsgi allows this. + +You can exit the virtualenv and the searx user bash (enter exit command +twice). + +uwsgi +----- + +Install packages : + +.. code:: sh + + sudo apt-get install uwsgi uwsgi-plugin-python + +Create the configuration file /etc/uwsgi/apps-available/searx.ini with +this content : + +:: + + [uwsgi] + # Who will run the code + uid = searx + gid = searx + + # disable logging for privacy + disable-logging = true + + # Number of workers (usually CPU count) + workers = 4 + + # The right granted on the created socket + chmod-socket = 666 + + # Plugin to use and interpretor config + single-interpreter = true + master = true + plugin = python + + # Module to import + module = searx.webapp + + # Virtualenv and python path + virtualenv = /usr/local/searx/searx-ve/ + pythonpath = /usr/local/searx/ + chdir = /usr/local/searx/searx/ + +Activate the uwsgi application and restart : + +.. code:: sh + + cd /etc/uwsgi/apps-enabled + ln -s ../apps-available/searx.ini + /etc/init.d/uwsgi restart + +Web server +---------- + +with nginx +^^^^^^^^^^ + +If nginx is not installed (uwsgi will not work with the package +nginx-light) : + +.. code:: sh + + sudo apt-get install nginx + +Hosted at / +""""""""""" + +Create the configuration file /etc/nginx/sites-available/searx with this +content : + +.. code:: nginx + + server { + listen 80; + server_name searx.example.com; + root /usr/local/searx; + + location / { + include uwsgi_params; + uwsgi_pass unix:/run/uwsgi/app/searx/socket; + } + } + +Restart service : + +.. code:: sh + + sudo service nginx restart + sudo service uwsgi restart + +from subdirectory URL (/searx) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Add this configuration in the server config file +/etc/nginx/sites-available/default : + +.. code:: nginx + + location = /searx { rewrite ^ /searx/; } + location /searx { + try_files $uri @searx; + } + location @searx { + uwsgi_param SCRIPT_NAME /searx; + include uwsgi_params; + uwsgi_modifier1 30; + uwsgi_pass unix:/run/uwsgi/app/searx/socket; + } + +Enable base\_url in searx/settings.yml + +:: + + base_url : http://your.domain.tld/searx/ + +Restart service : + +.. code:: sh + + sudo service nginx restart + sudo service uwsgi restart + +disable logs +~~~~~~~~~~~~ + +for better privacy you can disable nginx logs about searx. + +how to proceed : below ``uwsgi_pass`` in +/etc/nginx/sites-available/default add + +:: + + access_log /dev/null; + error_log /dev/null; + +Restart service : + +.. code:: sh + + sudo service nginx restart + +with apache +----------- + +Add wsgi mod : + +.. code:: sh + + sudo apt-get install libapache2-mod-uwsgi + sudo a2enmod uwsgi + +Add this configuration in the file /etc/apache2/apache2.conf : + +.. code:: apache + + + Options FollowSymLinks Indexes + SetHandler uwsgi-handler + uWSGISocket /run/uwsgi/app/searx/socket + + +Note that if your instance of searx is not at the root, you should +change ```` by the location of your instance, like +````. + +Restart Apache : + +.. code:: sh + + sudo /etc/init.d/apache2 restart + +disable logs +------------ + +For better privacy you can disable Apache logs. + +WARNING : not tested + +WARNING : you can only disable logs for the whole (virtual) server not +for a specific path. + +Go back to /etc/apache2/apache2.conf and above ```` add : + +.. code:: apache + + CustomLog /dev/null combined + +Restart Apache : + +.. code:: sh + + sudo /etc/init.d/apache2 restart + +How to update +------------- + +.. code:: sh + + cd /usr/local/searx + sudo -u searx -i + . ./searx-ve/bin/activate + git stash + git pull origin master + git stash apply + pip install --upgrade -r requirements.txt + sudo service uwsgi restart + -- cgit v1.2.3 From 08d26609a5cffa1c70d6aa22cfa4455e1feb2002 Mon Sep 17 00:00:00 2001 From: Noemi Vanyi Date: Sun, 10 Jan 2016 20:10:53 +0100 Subject: update & fix install guide after install refactor --- docs/dev/install/installation.rst | 81 +++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 29 deletions(-) (limited to 'docs/dev/install') diff --git a/docs/dev/install/installation.rst b/docs/dev/install/installation.rst index 2ce6a6b54..e15ff8b25 100644 --- a/docs/dev/install/installation.rst +++ b/docs/dev/install/installation.rst @@ -1,25 +1,28 @@ Installation ============ -Step by step installation for Debian / Ubuntu with virtualenv. +Step by step installation for Debian/Ubuntu with virtualenv. Source: https://about.okhin.fr/posts/Searx/ with some additions How to: `Setup searx in a couple of hours with a free SSL certificate `__ +.. contents:: + :depth: 3 + Basic installation ------------------ For Ubuntu, be sure to have enable universe repository. -Install packages : +Install packages: .. code:: sh sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-pybabel zlib1g-dev libffi-dev libssl-dev -Install searx : +Install searx: .. code:: sh @@ -28,7 +31,7 @@ Install searx : sudo useradd searx -d /usr/local/searx sudo chown searx:searx -R /usr/local/searx -Install dependencies in a virtualenv : +Install dependencies in a virtualenv: .. code:: sh @@ -36,8 +39,7 @@ Install dependencies in a virtualenv : cd /usr/local/searx virtualenv searx-ve . ./searx-ve/bin/activate - pip install -r requirements.txt - python setup.py install + ./manage.sh update_packages Configuration ------------- @@ -51,7 +53,7 @@ Edit searx/settings.yml if necessary. Check ----- -Start searx : +Start searx: .. code:: sh @@ -59,7 +61,7 @@ Start searx : Go to http://localhost:8888 -If everything works fine, disable the debug option in settings.yml : +If everything works fine, disable the debug option in settings.yml: .. code:: sh @@ -73,14 +75,14 @@ twice). uwsgi ----- -Install packages : +Install packages: .. code:: sh sudo apt-get install uwsgi uwsgi-plugin-python Create the configuration file /etc/uwsgi/apps-available/searx.ini with -this content : +this content: :: @@ -111,7 +113,7 @@ this content : pythonpath = /usr/local/searx/ chdir = /usr/local/searx/searx/ -Activate the uwsgi application and restart : +Activate the uwsgi application and restart: .. code:: sh @@ -126,7 +128,7 @@ with nginx ^^^^^^^^^^ If nginx is not installed (uwsgi will not work with the package -nginx-light) : +nginx-light): .. code:: sh @@ -136,7 +138,7 @@ Hosted at / """"""""""" Create the configuration file /etc/nginx/sites-available/searx with this -content : +content: .. code:: nginx @@ -151,7 +153,7 @@ content : } } -Restart service : +Restart service: .. code:: sh @@ -159,10 +161,10 @@ Restart service : sudo service uwsgi restart from subdirectory URL (/searx) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +"""""""""""""""""""""""""""""" Add this configuration in the server config file -/etc/nginx/sites-available/default : +/etc/nginx/sites-available/default: .. code:: nginx @@ -183,7 +185,7 @@ Enable base\_url in searx/settings.yml base_url : http://your.domain.tld/searx/ -Restart service : +Restart service: .. code:: sh @@ -195,7 +197,7 @@ disable logs for better privacy you can disable nginx logs about searx. -how to proceed : below ``uwsgi_pass`` in +how to proceed: below ``uwsgi_pass`` in /etc/nginx/sites-available/default add :: @@ -203,23 +205,23 @@ how to proceed : below ``uwsgi_pass`` in access_log /dev/null; error_log /dev/null; -Restart service : +Restart service: .. code:: sh sudo service nginx restart with apache ------------ +^^^^^^^^^^^ -Add wsgi mod : +Add wsgi mod: .. code:: sh sudo apt-get install libapache2-mod-uwsgi sudo a2enmod uwsgi -Add this configuration in the file /etc/apache2/apache2.conf : +Add this configuration in the file /etc/apache2/apache2.conf: .. code:: apache @@ -233,29 +235,29 @@ Note that if your instance of searx is not at the root, you should change ```` by the location of your instance, like ````. -Restart Apache : +Restart Apache: .. code:: sh sudo /etc/init.d/apache2 restart disable logs ------------- +"""""""""""" For better privacy you can disable Apache logs. -WARNING : not tested +WARNING: not tested -WARNING : you can only disable logs for the whole (virtual) server not +WARNING: you can only disable logs for the whole (virtual) server not for a specific path. -Go back to /etc/apache2/apache2.conf and above ```` add : +Go back to /etc/apache2/apache2.conf and above ```` add: .. code:: apache CustomLog /dev/null combined -Restart Apache : +Restart Apache: .. code:: sh @@ -272,6 +274,27 @@ How to update git stash git pull origin master git stash apply - pip install --upgrade -r requirements.txt + ./manage.sh update_packages sudo service uwsgi restart +Docker +------ + +Make sure you have installed Docker. For instance, you can deploy searx like this: + +.. code:: sh + + docker pull wonderfall/searx + docker run -d --name searx -p $PORT:8888 wonderfall/searx + +Go to http://localhost:$PORT. + +See https://hub.docker.com/r/wonderfall/searx/ for more informations. + +It's also possible to build searx from the embedded Dockerfile. + +.. code:: sh + + git clone https://github.com/asciimoo/searx.git + cd searx + docker build -t whatever/searx . -- cgit v1.2.3 From 2430baa1fd6e4ecba4bc72a8e71c49a38b424216 Mon Sep 17 00:00:00 2001 From: Noemi Vanyi Date: Thu, 21 Apr 2016 13:16:18 +0200 Subject: update install docs on reverse proxy --- docs/dev/install/installation.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs/dev/install') diff --git a/docs/dev/install/installation.rst b/docs/dev/install/installation.rst index e15ff8b25..d69f30e8f 100644 --- a/docs/dev/install/installation.rst +++ b/docs/dev/install/installation.rst @@ -171,6 +171,8 @@ Add this configuration in the server config file location = /searx { rewrite ^ /searx/; } location /searx { try_files $uri @searx; + proxy_pass http://localhost:9999/; + proxy_set_header X-Script-Name /searx; } location @searx { uwsgi_param SCRIPT_NAME /searx; @@ -179,6 +181,7 @@ Add this configuration in the server config file uwsgi_pass unix:/run/uwsgi/app/searx/socket; } + Enable base\_url in searx/settings.yml :: -- cgit v1.2.3 From b40d7a2b36014f8db825c06350ed84db7eed67d5 Mon Sep 17 00:00:00 2001 From: Noemi Vanyi Date: Thu, 21 Apr 2016 14:30:17 +0200 Subject: add reverse proxy configuration --- docs/dev/install/installation.rst | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'docs/dev/install') diff --git a/docs/dev/install/installation.rst b/docs/dev/install/installation.rst index d69f30e8f..cbbd25f57 100644 --- a/docs/dev/install/installation.rst +++ b/docs/dev/install/installation.rst @@ -171,8 +171,6 @@ Add this configuration in the server config file location = /searx { rewrite ^ /searx/; } location /searx { try_files $uri @searx; - proxy_pass http://localhost:9999/; - proxy_set_header X-Script-Name /searx; } location @searx { uwsgi_param SCRIPT_NAME /searx; @@ -182,6 +180,23 @@ Add this configuration in the server config file } +OR + +using reverse proxy +(Please, note that reverse proxy advised to be used in case of single-user or low-traffic instances.) + +.. code:: nginx + + location /searx { + proxy_pass http://127.0.0.1:8888; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Scheme $scheme; + proxy_set_header X-Script-Name /searx; + proxy_buffering off; + } + + Enable base\_url in searx/settings.yml :: -- cgit v1.2.3 From 9e135f9fab3894cc86264cb7552252ef0cf10581 Mon Sep 17 00:00:00 2001 From: Noemi Vanyi Date: Fri, 15 Jul 2016 18:41:05 +0200 Subject: simplify index page --- docs/dev/install/installation.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/dev/install') diff --git a/docs/dev/install/installation.rst b/docs/dev/install/installation.rst index cbbd25f57..b641a628e 100644 --- a/docs/dev/install/installation.rst +++ b/docs/dev/install/installation.rst @@ -1,3 +1,5 @@ +.. _installation: + Installation ============ -- cgit v1.2.3 From 6ecd8e3bd72df43d903800ee05e33185efe22ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Sun, 20 Nov 2016 21:12:52 +0100 Subject: installation: nginx mod to sites-enabled --- docs/dev/install/installation.rst | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'docs/dev/install') diff --git a/docs/dev/install/installation.rst b/docs/dev/install/installation.rst index b641a628e..b02718fe3 100644 --- a/docs/dev/install/installation.rst +++ b/docs/dev/install/installation.rst @@ -3,20 +3,13 @@ Installation ============ -Step by step installation for Debian/Ubuntu with virtualenv. - -Source: https://about.okhin.fr/posts/Searx/ with some additions - -How to: `Setup searx in a couple of hours with a free SSL -certificate `__ - .. contents:: :depth: 3 Basic installation ------------------ -For Ubuntu, be sure to have enable universe repository. +Step by step installation for Debian/Ubuntu with virtualenv. For Ubuntu, be sure to have enable universe repository. Install packages: @@ -166,7 +159,7 @@ from subdirectory URL (/searx) """""""""""""""""""""""""""""" Add this configuration in the server config file -/etc/nginx/sites-available/default: +/etc/nginx/sites-enabled/default: .. code:: nginx @@ -318,3 +311,11 @@ It's also possible to build searx from the embedded Dockerfile. git clone https://github.com/asciimoo/searx.git cd searx docker build -t whatever/searx . + +References +========== + + * https://about.okhin.fr/posts/Searx/ with some additions + + * How to: `Setup searx in a couple of hours with a free SSL certificate `__ + -- cgit v1.2.3 From b92631bf8c36a8b7fa1fada219428af8e2abb566 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Mon, 12 Jun 2017 12:34:30 +0200 Subject: various mods: uwsgi setup and version update ++ py3 img src fix ++ new sphinx version - closes #939 --- docs/dev/install/installation.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/dev/install') diff --git a/docs/dev/install/installation.rst b/docs/dev/install/installation.rst index b02718fe3..e1ae3f2a1 100644 --- a/docs/dev/install/installation.rst +++ b/docs/dev/install/installation.rst @@ -99,6 +99,8 @@ this content: single-interpreter = true master = true plugin = python + lazy-apps = true + enable-threads = true # Module to import module = searx.webapp -- cgit v1.2.3 From 2134c7c6939ce4f20fbb6ffca330ad7af0ff673a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Wed, 17 Jan 2018 22:05:10 +0100 Subject: change python-pybabel to python-babel in package requirements Closes #1147 --- docs/dev/install/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/dev/install') diff --git a/docs/dev/install/installation.rst b/docs/dev/install/installation.rst index e1ae3f2a1..8b6bb69b0 100644 --- a/docs/dev/install/installation.rst +++ b/docs/dev/install/installation.rst @@ -15,7 +15,7 @@ Install packages: .. code:: sh - sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-pybabel zlib1g-dev libffi-dev libssl-dev + sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-babel zlib1g-dev libffi-dev libssl-dev Install searx: -- cgit v1.2.3 From 10ebe8cec9d926ca1c7c19336bf60c1ee88d9300 Mon Sep 17 00:00:00 2001 From: tmikaeld Date: Sun, 21 Oct 2018 11:36:11 +0200 Subject: Added missing symlink instruction --- docs/dev/install/installation.rst | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/dev/install') diff --git a/docs/dev/install/installation.rst b/docs/dev/install/installation.rst index 8b6bb69b0..6c3f773a5 100644 --- a/docs/dev/install/installation.rst +++ b/docs/dev/install/installation.rst @@ -150,6 +150,10 @@ content: } } +Create a symlink to sites-enabled: + +sudo ln -s /etc/nginx/sites-available/searx /etc/nginx/sites-enabled/searx + Restart service: .. code:: sh -- cgit v1.2.3 From 77494166d2c61dcc5e62447e88e6d3bb4e5254c2 Mon Sep 17 00:00:00 2001 From: tmikaeld Date: Sun, 21 Oct 2018 11:42:00 +0200 Subject: Formatting... --- docs/dev/install/installation.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docs/dev/install') diff --git a/docs/dev/install/installation.rst b/docs/dev/install/installation.rst index 6c3f773a5..50b33a324 100644 --- a/docs/dev/install/installation.rst +++ b/docs/dev/install/installation.rst @@ -152,7 +152,9 @@ content: Create a symlink to sites-enabled: -sudo ln -s /etc/nginx/sites-available/searx /etc/nginx/sites-enabled/searx +.. code:: sh + + sudo ln -s /etc/nginx/sites-available/searx /etc/nginx/sites-enabled/searx Restart service: -- cgit v1.2.3