Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Install Searx, the Free Metasearch Engine on Bullseye Server

Here you can discuss every aspect of Debian. Note: not for support requests!
Post Reply
Message
Author
kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Install Searx, the Free Metasearch Engine on Bullseye Server

#1 Post by kedaha »

For folks who take an interest in such things, I'm now looking at getting Searx up and running on a home server, which is running testing, for purely testing purposes, naturally, with the objective of using this Debian package when Bullseye is released as stable.This can be done very easily as explained in Debian's very own FreedomBox/Manual/Searx and I intend look into all the configuration details involved there with a view to using them for a manually-configured server. Until I do so, I assume that the Freedombox setup uses the Debian package:

Code: Select all

# apt policy searx 
searx:
  Installed: 0.18.0+dfsg1-1
  Candidate: 0.18.0+dfsg1-1
  Version table:
 *** 0.18.0+dfsg1-1 500
        500 http://deb.debian.org/debian bullseye/main amd64 Packages
        100 /var/lib/dpkg/status
As some other forum members who are familiar with my posts will be aware, I'm a firm advocate of using packages, which have gone through Debian's developmental stages: unstable -->testing -->stable, specially on a server. But as with so much other software packaged by Debian, like, for example Wordpress (which I'll post my notes about some time, elsewhere), this method is flouted in most online guides, including those written by upstream developers, who provide instructions for obtaining the software either by downloading the latest tarball or through git. Even though Bullseye hasn't even been released yet, such Debian packages as searx may already be regarded as too old!

Maybe I haven't looked sufficiently but I have yet to find a guide anywhere to installing searx from the Debian repository by means of apt install searx and documentation is sadly lacking about how to do this, which isn't even included in /usr/share/doc/searx once the package has been installed, let alone on the Debian Wiki.

To cut a long story short, you can't just apt install searx and expect the thing to work out-of-the-box, but finding a step-by-step guide seems to be too much to ask, unless one writes it oneself! Well,I don't mind; If I can get it to work the Debian way, I'll post again.
Thanks for reading & any comments.
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: Install Searx, the Free Metasearch Engine on Bullseye Se

#2 Post by kedaha »

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.
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

Post Reply