Installation on RHEL 7 CentOS 7 - ozzmos/searx GitHub Wiki
Step by step installation for RHEL7 / CentOS 7, based on the official installation instructions on this wiki.
Basic installation
You need EPEL repo for zlib-devel mod_proxy_uwsgi uwsgi-plugin-python
Install EPEL :
yum install epel-release && yum update
Install packages :
yum install gcc zlib-devel git openssl-devel libffi-devel python-babel python-virtualenv libxslt-devel
Install searx :
cd /usr/local
git clone https://github.com/asciimoo/searx.git
useradd searx -d /usr/local/searx
chown searx:searx -R /usr/local/searx
Install dependencies in a virtualenv :
su - searx
cd /usr/local/searx
virtualenv searx-ve
. ./searx-ve/bin/activate
pip install -r requirements.txt
python setup.py install
Configuration
sed -i -e "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml
Edit searx/settings.yml if necessary.
Check
Start searx :
python searx/webapp.py
Go to http://localhost:8888
At this point searx is not demonized ; uwsgi allows this.
You can exit the virtualenv and the searx user bash (enter exit).
uwsgi
Install packages :
yum install uwsgi uwsgi-plugin-python
Create the configuration file /etc/uwsgi.d/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
socket = 127.0.0.1:8888
# 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/
Change ownership of the new config file :
chown uwsgi:uwsgi /etc/uwsgi.d/searx.ini
Activate the uwsgi application and restart :
systemctl enable uwsgi
systemctl start uwsgi
Web server
with nginx
TODO ...
with apache
Add and enable wsgi mod :
yum install mod_proxy_uwsgi
echo "LoadModule proxy_uwsgi_module modules/mod_proxy_uwsgi.so" > /etc/httpd/conf.modules.d/00-uwsgi.conf
Create a proxy configuration file :
echo "ProxyPass / uwsgi://127.0.0.1:8888/" > /etc/httpd/conf.d/searx.conf
Note that if your instance of searx is not at the root, you should change ProxyPass /
by the location of your instance, like ProxyPass /searx
.
Restart Apache :
systemctl restart httpd
If you have SELinux enabled, you must allow httpd to allow network connect :
setsebool -P httpd_can_network_connect 1
How to update (no tested)
cd /usr/local/searx
su - searx
. ./searx-ve/bin/activate
git stash
git pull origin master
git stash apply
pip install --upgrade -r requirements.txt
exit
systemctl restart uwsgi