最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

docker搭建searx_Searx – 尊重隐私的开源搜索引擎

业界 admin 0浏览 0评论

Searx介绍

Searx,一个基于Python的完全开源免费搜索引擎平台,为你提供来自Google、Bing、Yahoo等70多种各大视频、图片、搜索、磁力等网站结果展示,并对搜索结果进行优化,同时不会存储你的任何搜索信息,搭建也很方便。你完全可以用它来搭建Google镜像等。

Searx安装

以Centos 7x为例

#拉取源码

$ git clone https://github/asciimoo/searx.git

#安装依赖

$ cd searx

$ pip install -r requirements.txt

#编辑配置文件

$ nano searx/settings.yml

1

2

3

4

5

6

7#拉取源码

$gitclonehttps://github/asciimoo/searx.git

#安装依赖

$cdsearx

$pipinstall-rrequirements.txt

#编辑配置文件

$nanosearx/settings.yml

settings.yml 配置

参考settings.yml,当然你也可以全部使用默认(不建议)

language:为搜索语言,默认en-US,如果你的搜索以中文为主,那就改成zh-CN,当然这个语言在搜索界面也可以设置

port:为监听端口,默认8888,可自行修改。

bind_address:为监控地址,默认为127.0.0.1,如果需要让ip地址能被外网访问,就修改为0.0.0.0,这里建议默认,然后再用域名反代即可。

secret_key:该参数为加密密匙,可自行设置,数值可以在ssh客户端使用openssl rand -hex 16命令生成。

1

2

3

4language:为搜索语言,默认en-US,如果你的搜索以中文为主,那就改成zh-CN,当然这个语言在搜索界面也可以设置

port:为监听端口,默认8888,可自行修改。

bind_address:为监控地址,默认为127.0.0.1,如果需要让ip地址能被外网访问,就修改为0.0.0.0,这里建议默认,然后再用域名反代即可。

secret_key:该参数为加密密匙,可自行设置,数值可以在ssh客户端使用opensslrand-hex16命令生成。

运行Searx

yum install screen -y

screen -dmS searx python searx/webapp.py

1

2yuminstallscreen-y

screen-dmSsearxpythonsearx/webapp.py

然后使用ip:port访问,如果你的bind_address地址没修改,可能浏览器会访问不了,就需要反代了,方法后面会说。

如果你修改了bind_address地址为0.0.0.0,还打不开媒体界面的话,还需要开启防火墙端口,使用命令:

#CentOS 7

firewall-cmd --zone=public --add-port=8888/tcp --permanent

firewall-cmd --reload

1

2

3#CentOS 7

firewall-cmd--zone=public--add-port=8888/tcp--permanent

firewall-cmd--reload

如果你开了端口还不能打开,可能还需要去服务商后台开启对应的端口。

Docker安装Searx

建立searx

git clone https://github/asciimoo/searx.git

cd searx

docker build -t searx .

1

2

3gitclonehttps://github/asciimoo/searx.git

cdsearx

dockerbuild-tsearx.

您可以使用两个环境变量自定义您的searx实例:MAGE_PROXY (default : False), 如果设置为True,则searx将代理所有图像。

BASE_URL (default : False) 应该设置为您的域名 (with http/https).

运行searx

在反向代理后面运行一个searx容器:

docker run -d --name searx -e IMAGE_PROXY=True -e BASE_URL=https://domain.tld searx

1dockerrun-d--namesearx-eIMAGE_PROXY=True-eBASE_URL=https://domain.tld searx

使用nginx(反向代理),使用以下内容创建一个vhost:

...

location / {

proxy_pass http://searx:8888;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Remote-Port $remote_port;

proxy_set_header X-Forwarded-Proto $scheme;

proxy_redirect off;

}

...

1

2

3

4

5

6

7

8

9

10

11...

location/{

proxy_passhttp://searx:8888;

proxy_set_headerHost$host;

proxy_set_headerX-Real-IP$remote_addr;

proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;

proxy_set_headerX-Remote-Port$remote_port;

proxy_set_headerX-Forwarded-Proto$scheme;

proxy_redirectoff;

}

...

至此,你可以去http://localhost:$PORT使用searx了。

Searx项目

Searx介绍

Searx,一个基于Python的完全开源免费搜索引擎平台,为你提供来自Google、Bing、Yahoo等70多种各大视频、图片、搜索、磁力等网站结果展示,并对搜索结果进行优化,同时不会存储你的任何搜索信息,搭建也很方便。你完全可以用它来搭建Google镜像等。

Searx安装

以Centos 7x为例

#拉取源码

$ git clone https://github/asciimoo/searx.git

#安装依赖

$ cd searx

$ pip install -r requirements.txt

#编辑配置文件

$ nano searx/settings.yml

1

2

3

4

5

6

7#拉取源码

$gitclonehttps://github/asciimoo/searx.git

#安装依赖

$cdsearx

$pipinstall-rrequirements.txt

#编辑配置文件

$nanosearx/settings.yml

settings.yml 配置

参考settings.yml,当然你也可以全部使用默认(不建议)

language:为搜索语言,默认en-US,如果你的搜索以中文为主,那就改成zh-CN,当然这个语言在搜索界面也可以设置

port:为监听端口,默认8888,可自行修改。

bind_address:为监控地址,默认为127.0.0.1,如果需要让ip地址能被外网访问,就修改为0.0.0.0,这里建议默认,然后再用域名反代即可。

secret_key:该参数为加密密匙,可自行设置,数值可以在ssh客户端使用openssl rand -hex 16命令生成。

1

2

3

4language:为搜索语言,默认en-US,如果你的搜索以中文为主,那就改成zh-CN,当然这个语言在搜索界面也可以设置

port:为监听端口,默认8888,可自行修改。

bind_address:为监控地址,默认为127.0.0.1,如果需要让ip地址能被外网访问,就修改为0.0.0.0,这里建议默认,然后再用域名反代即可。

secret_key:该参数为加密密匙,可自行设置,数值可以在ssh客户端使用opensslrand-hex16命令生成。

运行Searx

yum install screen -y

screen -dmS searx python searx/webapp.py

1

2yuminstallscreen-y

screen-dmSsearxpythonsearx/webapp.py

然后使用ip:port访问,如果你的bind_address地址没修改,可能浏览器会访问不了,就需要反代了,方法后面会说。

如果你修改了bind_address地址为0.0.0.0,还打不开媒体界面的话,还需要开启防火墙端口,使用命令:

#CentOS 7

firewall-cmd --zone=public --add-port=8888/tcp --permanent

firewall-cmd --reload

1

2

3#CentOS 7

firewall-cmd--zone=public--add-port=8888/tcp--permanent

firewall-cmd--reload

如果你开了端口还不能打开,可能还需要去服务商后台开启对应的端口。

Docker安装Searx

建立searx

git clone https://github/asciimoo/searx.git

cd searx

docker build -t searx .

1

2

3gitclonehttps://github/asciimoo/searx.git

cdsearx

dockerbuild-tsearx.

您可以使用两个环境变量自定义您的searx实例:MAGE_PROXY (default : False), 如果设置为True,则searx将代理所有图像。

BASE_URL (default : False) 应该设置为您的域名 (with http/https).

运行searx

在反向代理后面运行一个searx容器:

docker run -d --name searx -e IMAGE_PROXY=True -e BASE_URL=https://domain.tld searx

1dockerrun-d--namesearx-eIMAGE_PROXY=True-eBASE_URL=https://domain.tld searx

使用nginx(反向代理),使用以下内容创建一个vhost:

...

location / {

proxy_pass http://searx:8888;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Remote-Port $remote_port;

proxy_set_header X-Forwarded-Proto $scheme;

proxy_redirect off;

}

...

1

2

3

4

5

6

7

8

9

10

11...

location/{

proxy_passhttp://searx:8888;

proxy_set_headerHost$host;

proxy_set_headerX-Real-IP$remote_addr;

proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;

proxy_set_headerX-Remote-Port$remote_port;

proxy_set_headerX-Forwarded-Proto$scheme;

proxy_redirectoff;

}

...

至此,你可以去http://localhost:$PORT使用searx了。

Searx项目

发布评论

评论列表 (0)

  1. 暂无评论