Searx 互联网元搜索引擎

开源网站开源项目 24-06-29 13:30:54

Searx是一个免费的互联网元搜索引擎,汇集了70多种搜索服务的结果。 用户既不被跟踪也不被分析。 此外,searx可以在Tor上实现在线匿名搜索。

基本安装

下面是基于 Debian/Ubuntu 和 virtualenv 的安装指南,如果是 Ubuntu 请确认使用的是universe 仓库。

安装依赖包:

sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-babel zlib1g-dev libffi-dev libssl-dev

安装searx:

cd /usr/localsudo git clone https://github.com/asciimoo/searx.gitsudo useradd searx -d /usr/local/searxsudo chown searx:searx -R /usr/local/searx

在 virtualenv 中安装依赖:

sudo -u searx -icd /usr/local/searxvirtualenv searx-ve. ./searx-ve/bin/activate./manage.sh update_packages

配置

sed -i -e "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml

根据需要修改searx/settings.yml

检查

启动 searx:

python searx/webapp.py

浏览器访问http://localhost:8888

如果一切工作正常,可以在 settings.yml 中禁用调试选项:

sed -i -e "s/debug : True/debug : False/g" searx/settings.yml

配合uwsgi使用

安装依赖包

sudo apt-get install uwsgi uwsgi-plugin-python

创建配置文件 /etc/uwsgi/apps-available/searx.ini,内容如下:

[uwsgi]# Who will run the codeuid = searxgid = searx# disable logging for privacydisable-logging = true# Number of workers (usually CPU count)workers = 4# The right granted on the created socketchmod-socket = 666# Plugin to use and interpretor configsingle-interpreter = truemaster = trueplugin = pythonlazy-apps = trueenable-threads = true# Module to importmodule = searx.webapp# Virtualenv and python pathvirtualenv = /usr/local/searx/searx-ve/pythonpath = /usr/local/searx/chdir = /usr/local/searx/searx/

激活 uwsgi 应用并重启

cd /etc/uwsgi/apps-enabledln -s ../apps-available/searx.ini/etc/init.d/uwsgi restart

Web 服务器nginx

使用如下命令安装 Nginx

sudo apt-get install nginx

配置到 / 根路径

创建配置文件 /etc/nginx/sites-available/searx 内容如下:

server {    listen 80;    server_name searx.example.com;    root /usr/local/searx;    location / {            include uwsgi_params;            uwsgi_pass unix:/run/uwsgi/app/searx/socket;    }}

重启服务:

sudo service nginx restartsudo service uwsgi restart

配置到指定路径 (/searx)

添加配置文件 /etc/nginx/sites-enabled/default 内容如下:

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;}

或者使用反向代理(适合单用户使用或者低访问量的实例)

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;}

编辑 searx/settings.xml 中的 base_url

base_url : http://your.domain.tld/searx/

重启服务:

sudo service nginx restartsudo service uwsgi restart

为了更好的保护隐私,可以禁用日志,在/etc/nginx/sites-available/default 的uwsgi_pass下面增加如下内容:

access_log /dev/null;error_log /dev/null;

重启服务

sudo service nginx restart

apache

增加 wsgi mod:

sudo apt-get install libapache2-mod-uwsgisudo a2enmod uwsgi

增加配置内容到 /etc/apache2/apache2.conf:

<Location />    Options FollowSymLinks Indexes    SetHandler uwsgi-handler    uWSGISocket /run/uwsgi/app/searx/socket</Location>

N注意,如果你的 searx 实例不是部署在根路径,需要修改<Location/>配置信息,如<Location/searx>.

重启 Apache:

sudo /etc/init.d/apache2 restart

禁用日志

回到配置文件 /etc/apache2/apache2.conf 在<Location/>指令上方增加:

CustomLog /dev/null combined

重启 Apache:

sudo /etc/init.d/apache2 restart

如何更新

cd /usr/local/searxsudo -u searx -i. ./searx-ve/bin/activategit stashgit pull origin mastergit stash apply./manage.sh update_packagessudo service uwsgi restart

Docker

确认你已装有 Docker ,然后使用如下命令来部署 searx:

docker pull wonderfall/searxdocker run -d --name searx -p $PORT:8888 wonderfall/searx

打开浏览器访问http://localhost:$PORT.

更多的帮助请看https://hub.docker.com/r/wonderfall/searx/

你也可以通过 Dockerfile 来构建 searx

git clone https://github.com/asciimoo/searx.gitcd searxdocker build -t whatever/searx .

参考资料

https://about.okhin.fr/posts/Searx/with some additions

How to:Setup searx in a couple of hours with a free SSL certificate

[Searx 互联网元搜索引擎]相关推荐
Friends Web 上 P2P 聊天应用

Friends Web 上 P2P 聊天应用

Friends 是 Web 平台的 P2P 聊天应用,Slack 的开源替代品。 主要特性: 纯 JavaScript (NodeJS) GitH……...

Tslib 触摸屏驱动扩展

Tslib是一个开源的程序,能够为触摸屏驱动获得的采样提供诸如滤波、去抖、校准等功能,通常作为触摸屏驱……...

RubyMine Ruby开发工具

RubyMine Ruby开发工具

RubyMine 是一个全新的为Ruby 和 Rails开发者准备的 IDE (非开源且收费),RubyMine由 JetBrains 开发(J……...

brutal 异步聊天机器人框架

基于 Twisted 的多网络异步聊天机器人框架。 有多种方法可以用 python 编写聊天机器人,但是大多数线程都……...

npm Node.js 包管理工具

npm Node.js 包管理工具

npm 是Node.js的包管理工具,用来安装各种 Node.js 的扩展。 npm 是 JavaScript 的包管理工具,也是世界……...

VirtualBox 开源虚拟机

VirtualBox 是一款开源虚拟机软件。VirtualBox 是由德国 Innotek 公司开发,由SunMicrosystems公司出品的……...

今日开源
  1. fishhook iOS 上提供动态绑定功能

    fishhook 是一个非常简单的库,它允许支持在 iOS 上的模拟器和设备运行Mach-O,并提供动态绑定服务。此功能类似在OS X 系统上使用的 DYLD_INTERPOSE 功能。你可以通过使用 fishhook 实现呼叫/跟踪功能(如:auditi……

    开源软件 2024-07-07

  2. Moto 模拟 AWS 服务

    Moto 是一个允许你轻松模拟出基于 AWS 基础设施的测试的库。 如果你有以下的 Python 代码想测试: import boto3class MyModel(object): def __init__(self, name, value): self.name = name self……

    开源软件 2024-07-07

  3. Haven 将手机变成个人监控系统

    Haven 将手机变成个人监控系统

    Haven 可将 Android 智能手机转变为个人监控系统,以监控任何试图窃取隐私和安全的意外入侵者,可保护自己的个人空间和财物而不会泄露自己的隐私。 Haven 会利用设备上的传感器来提供对物理空间的监视和保护。 当……

    开源软件 2024-07-07

返回顶部小火箭