Quite a lot of time and additional configuration, like for example, setting up a subdomain is involved, so for anyone who would just like to try Debian's searx without all this rigmarole, a far simpler method is outlined in my other topic for Buster:
viewtopic.php?f=16&t=149458. This is for a server, not a desktop.
Please note that one cannot mix the Debian way of installing searx from the main repository with for example that given at the official, upstream site. My conclusion, if I've got the configuration right, is that the Debian way of installing it seems a lot simpler than cloning and configuring the latest version from upstream. I also notice that the version in Bullseye, 0.18.0 works really well. [Edit] However, searx 1.0.0+dfsg1-1 can now be backported from testing to stable; for details, please see
viewtopic.php?f=20&t=150975
To install it on Bullseye wasn't so easy specially since the only example given in /usr/share/doc/searx/examples/ was for nginx, not apache2, which I use. I intend some time to try and repeat the entire installation process in order to document it better so any commments would be welcome. I think a complete installation guide should be for both nginx and apache2. Some additional packages need to be installed in addition to searx including libapache2-mod-uwsgi. To check for these a command like this can be used:
Code: Select all
# apt-cache depends searx python3-searx libapache2-mod-uwsgi
I came across some notes at
install-searx-on-apache2-and-uwsgi, which came in handy as a reference for sites-available and, for conf-available, I simply used the configuration found for searx in Freedombox. But it was a bit confusing because freedombox is set up to work with a user-friendly panel called plinth and there was no specific conf file to be found in sites-available there
Note that a Letsencrypt certificate is used for SSL.
Here's my apache2 configuration, which does in fact work:
In sites-available:
Code: Select all
root@server:/etc/apache2/sites-available# cat searx.example.tld-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName searx.example.tld
ServerAlias www.searx.example.tld
ServerAdmin info@example.tld
RewriteEngine on
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.
# ReWriteCond %{SERVER_PORT} !^443$
# RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
<Location />
Options FollowSymLinks Indexes
SetHandler uwsgi-handler
uWSGISocket /run/uwsgi/app/searx/socket
</Location>
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/searx.example.tld/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/searx.example.tld/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
In conf-available:
root@server: cat /etc/apache2/conf-available# cat searx-searx.example.tld.conf
Code: Select all
# Redirect /searx to /searx/
<Location ~ ^/searx$>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/searx$
RewriteRule .* /searx/ [R=301,L]
</IfModule>
</Location>
<Location /searx/>
ProxyPass unix:/run/uwsgi/app/searx/socket|uwsgi://uwsgi-uds-searx/
</Location>
# This exclusion rule is to allow Searx to be added as a search engine in Firefox.
<LocationMatch "^/searx/(opensearch.xml|static/themes/oscar/img/favicon.png)$">
Require all granted
ProxyPassMatch "unix:/run/uwsgi/app/searx/socket|uwsgi://uwsgi-uds-searx/$1"
</LocationMatch>
it was also necessary to edit settings in /etc/searx/settings.yml at line 14:
Code: Select all
bind_address : "xx.xxx.xxx.xxx" # address to listen on
where xx.xxx.xxx.xxx is the external IP address.
Thanks for reading.