From 12a9c859e2b7f27160cb3039490e49482403b6b7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Feb 2020 16:28:41 +0800 Subject: [PATCH] TSL --- ...ernet with an open source search engine.md | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/sources/tech/20200207 Customize your internet with an open source search engine.md b/sources/tech/20200207 Customize your internet with an open source search engine.md index 040d262d62..86b929a3ef 100644 --- a/sources/tech/20200207 Customize your internet with an open source search engine.md +++ b/sources/tech/20200207 Customize your internet with an open source search engine.md @@ -7,90 +7,90 @@ [#]: via: (https://opensource.com/article/20/2/open-source-search-engine) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -Customize your internet with an open source search engine +用开源搜索引擎定制你的互联网 ====== -Get started with YaCy, an open source, P2P web indexer. + +> 上手开源的对等 Web 索引器 YaCy。 + ![Person using a laptop][1] -A long time ago, the internet was small enough to be indexed by a few people who gathered the names and locations of all websites and listed them each by topic on a page or in a printed book. As the World Wide Web network grew, the "web rings" convention developed, in which sites with a similar theme or topic or sensibility banded together to form a circular path to each member. A visitor to any site in the ring could click a button to proceed to the next or previous site in the ring to discover new sites relevant to their interest. +很久以前,互联网很小,小到几个人就可以索引它们,这些人收集了所有网站的名称和链接,并按主题将它们分别列在页面或印刷书籍中。随着万维网网络的发展,“网络环”惯例得到了发展,在该惯例中,具有类似的内容、主题或敏感性的站点捆绑在一起,形成了通往每个成员的循环路径。环中任何站点的访问者都可以单击按钮以转到环中的下一个或上一个站点,以发现与其兴趣相关的新站点。 -Then for a while, it seemed the internet outgrew itself. Everyone was online, there was a lot of redundancy and spam, and there was no way to find anything. Yahoo and AOL and CompuServe and similar services had unique approaches, but it wasn't until Google came along that the modern model took hold. According to Google, the internet was meant to be indexed, sorted, and ranked through a search engine. +过了一段时间,互联网似乎变得臃肿不堪了。每个人都在线上,有很多冗余和垃圾邮件,多到让你无法找到任何东西。Yahoo 和 AOL、CompuServe 以及类似的服务各自采用了不同的方法来解决这个问题,但是直到谷歌出现后,现代的搜索模型才得以普及。按谷歌的做法,互联网应该通过搜索引擎进行索引、排序和排名。 -### Why choose an open source alternative? +### 为什么选择开源替代品? -Search engines like Google and DuckDuckGo are demonstrably effective. You may have reached this site through a search engine. While there's a debate to be had about content falling through the cracks because a host chooses not to follow best practices for search engine optimization, the modern solution for managing the wealth of culture and knowledge and frivolity that is the internet is relentless indexing. +像谷歌和 DuckDuckGo 这样的搜索引擎显然是卓有成效的。你可能是通过搜索引擎访问的本站。尽管对于因主机选择不遵循最佳实践来优化搜索引擎从而使内容陷入困境仍存在争论,但用于管理丰富的文化、知识和轻率的信息(即互联网)的现代解决方案是无情的索引。 -But maybe you prefer not to use Google or DuckDuckGo because of privacy concerns or because you're looking to contribute to an effort to make the internet more independent. If that appeals to you, then consider participating in [YaCy][2], the peer-to-peer internet indexer and search engine. +但是也许出于隐私方面的考虑,或者你希望为使互联网更加独立而做出的贡献,你或许不愿意使用谷歌或 DuckDuckGo。如果你对此感兴趣,那么可以考虑参加 [YaCy] [2],这是一个对等互联网索引器和搜索引擎。 -### Install YaCy +### 安装 YaCy -To install and try YaCy, first ensure you have Java installed. If you're on Linux, you can follow the instructions in my [_How to install Java on Linux_][3] article. If you're on Windows or MacOS, obtain an installer from [AdoptOpenJDK.net][4]. +要安装并尝试 YaCy,请首先确保已安装 Java。如果你使用的是 Linux,则可以按照我的《[如何在 Linux 上安装 Java][3]》中的说明进行操作。如果你使用 Windows 或 MacOS,请从 [AdoptOpenJDK.net][4] 获取安装程序。 -Once you have Java installed, [download the installer][5] for your platform. - -If you're on Linux, unarchive the tarball and move it to the **/opt** directory: +安装 Java 后,请根据你的平台[下载安装程序][5]。 +如果你使用的是 Linux,请解压缩 tarball 并将其移至 `/opt` 目录: ``` -`$ sudo tar --extract --file  yacy_*z --directory /opt` +$ sudo tar --extract --file  yacy_*z --directory /opt ``` -Start YaCy according to instructions for the installer you downloaded. - -On Linux, start YaCy running in the background: +根据下载的安装程序的说明启动 YaCy。 +在 Linux 上,启动在后台运行的 YaCy: ``` -`$ /opt/startYACY.sh &` +$ /opt/startYACY.sh & ``` -In a web browser, navigate to **localhost:8090** and search. +在 Web 浏览器中,导航到 `localhost:8090` 并进行搜索。 ![YaCy start page][6] -### Add YaCy to your URL bar +### 将 YaCy 添加到你的地址栏 -If you're using the Firefox web browser, you can make YaCy your default search engine in the Awesome Bar (that's Mozilla's name for the URL field) with just a few clicks. +如果你使用的是 Firefox Web 浏览器,则只需单击几下,即可在 Awesome Bar(Mozilla 给 URL 栏起的名称)中将 YaCy 设置为默认搜索引擎。 -First, make the dedicated search bar visible in the Firefox toolbar, if it's not already (you don't have to keep the search bar visible; you only need it active long enough to add a custom search engine). The search bar is available in the hamburger menu in the upper-right corner of Firefox in the **Customize** menu. Once the search bar is visible in your Firefox toolbar, navigate to **localhost:8090**, and click the magnifying glass icon in the Firefox search bar you just added. Click the option to add YaCy to your Firefox search engines. +首先,如果尚未显示,在 Firefox 工具栏中使专用搜索栏显示出来(你不必使搜索栏保持一直可见;只需要激活它足够长的时间即可添加自定义搜索引擎)。Firefox 右上角的“汉堡”菜单中的“自定义”菜单中提供了搜索栏。在 Firefox 工具栏上的搜索栏可见后,导航至 `localhost:8090`,然后单击刚添加的 Firefox 搜索栏中的放大镜图标。单击选项将 YaCy 添加到你的 Firefox 搜索引擎。 ![Adding YaCy to Firefox][7] -Once this is done, you can mark it as your default in Firefox preferences, or just use it selectively in searches performed in the Firefox search bar. If you set it as your default search engine, then you may have no need for the dedicated search bar because the default engine is also used by the Awesome Bar, so you can remove it from your toolbar. +完成此操作后,你可以在 Firefox 首选项中将其标记为默认值,或者仅在 Firefox 搜索栏中执行的搜索中选择性地使用它。如果将其设置为默认搜索引擎,则可能不需要专用的搜索栏,因为 Awesome Bar 也使用默认引擎,因此可以将其从工具栏中删除。 -### How to a P2P search engine works +### 对等搜索引擎如何工作 -YaCy is an open source and distributed search engine. It's written in [Java][8], so it runs on any platform, and it performs web crawls, indexing, and searching. It's a peer-to-peer (P2P) network, so every user running YaCy joins in the effort to track the internet as it changes from day to day. Of course, no single user possesses a full index of the entire internet because that would take a data center to house, but the index is distributed and redundant across all YaCy users. It's a lot like BitTorrent (as it uses distributed hash tables, or DHT, to reference index entries), except the data you're sharing is a matrix of words and URL associations. By mixing the results returned by the hash tables, no one can tell who has searched for what words, so all searches are functionally anonymous. It's an effective system for unbiased, ad-free, untracked, and anonymous searches, and you can join in just by using it. +YaCy 是一个开源的分布式搜索引擎。它是用 [Java][8] 编写的,因此可以在任何平台上运行,并且可以执行 Web 爬网、索引和搜索。这是一个对等(P2P)网络,因此每个运行 YaCy 的用户都将努力地不断跟踪互联网的变化情况。当然,没有单个用户能拥有整个互联网的完整索引,因为这将需要一个数据中心来容纳,但是该索引分布在所有 YaCy 用户中且是冗余的。它与 BitTorrent 非常相似(因为它使用分布式哈希表 DHT 来引用索引条目),只不过你所共享的数据是单词和 URL 关联的矩阵。通过混合哈希表返回的结果,没人能告诉谁搜索了哪些单词,因此所有搜索在功能上都是匿名的。这是用于无偏见、无广告、未跟踪和匿名搜索的有效系统,你只需要使用它就加入了它。 -### Search engines and algorithms +### 搜索引擎和算法 -The act of indexing the internet refers to separating a web page into the singular words on it, then associating the page's URL with each word. Searching for one or more words in a search engine fetches all URLs associated with the query. That's one thing the YaCy client does while running. +索引互联网的行为是指将网页分成单个单词,然后将页面的 URL 与每个单词相关联。在搜索引擎中搜索一个或多个单词将获取与该查询关联的所有 URL。YaCy 客户端在运行时也是如此。 -The other thing the client does is provide a search interface for your browser. Instead of navigating to Google when you want to search, you can point your web browser to **localhost:8090** to search YaCy. You may even be able to add it to your browser's search bar (depending on your browser's extensibility), so you can search from the URL bar. +客户端要做的另一件事是为你的浏览器提供搜索界面。你可以将网络浏览器指向 `localhost:8090` 来搜索 YaCy,而不是在要搜索时导航到谷歌。你甚至可以将其添加到浏览器的搜索栏中(取决于浏览器的可扩展性),因此可以从 URL 栏中进行搜索。 -### Firewall settings for YaCy +### YaCy 的防火墙设置 -When you first start using YaCy, it's probably running in "junior" mode. This means that the sites your client crawls are available only to you because no other YaCy client can reach your index entries. To join the P2P experience, you must open port 8090 in your router's firewall and possibly your software firewall if you're running one. This is called "senior" mode. +首次开始使用 YaCy 时,它可能运行在“初级”模式下。这意味着你的客户端爬网的站点仅对你可用,因为其他 YaCy 客户端无法访问你的索引条目。要加入对等环境,必须在路由器的防火墙(或者你正在运行的软件防火墙)中打开端口 8090, 这称为“高级”模式。 -If you're on Linux, you can find out more about your computer's firewall in [_Make Linux stronger with firewalls_][9]. On other platforms, refer to your operating system's documentation. +如果你使用的是 Linux,则可以在《[使用防火墙让你的 Linux 更加强大][9]》中找到有关计算机防火墙的更多信息。 在其他平台上,请参考操作系统的文档。 -A firewall is almost always active on the router provided by your internet service provider (ISP), and there are far too many varieties of them to document accurately here. Most routers provide the option to "poke a hole" in your firewall because many popular networked games require two-way traffic. +互联网服务提供商(ISP)提供的路由器上几乎总是启用防火墙,并且这里有太多种类的防火墙无法准确说明。大多数路由器都提供了在防火墙中“打洞”的选项,因为许多流行的联网游戏都需要双向流量。 -If you know how to log into your router (it's often either 192.168.0.1 or 10.1.0.1, but can vary depending on the manufacturer's settings), then log in and look for a configuration panel controlling the _firewall_ or _port forwarding_ or _applications_. +如果你知道如何登录路由器(通常为 192.168.0.1 或 10.1.0.1,但可能因制造商的设置而异),则登录并查找配置面板来控制“防火墙”或“端口转发”或“应用”。 -Once you find the preferences for your router's firewall, add port 8090 to the whitelist. For example: +找到路由器防火墙的首选项后,将端口 8090 添加到白名单。例如: ![Adding YaCy to an ISP router][10] -If your router is doing port forwarding, then you must forward the incoming traffic to your computer's IP address, using the same port. For example: +如果路由器正在进行端口转发,则必须使用相同的端口将传入的流量转发到计算机的 IP 地址。例如: ![Adding YaCy to an ISP router][11] -If you can't adjust your firewall settings for any reason, that's OK. YaCy will continue to run and operate as a client of the P2P search network in junior mode. +如果由于某种原因无法调整防火墙设置,那也没事。YaCy 将继续以初级模式运行并作为对等搜索网络的客户端运行。 -### An internet of your own +### 你的互联网 -There's much more you can do with the YaCy search engine than just search passively. You can force crawls of underrepresented websites, you can request the network crawl a site, you can choose to use YaCy for just on-premises searches, and much more. You have better control over what _your_ internet looks like. The more senior users there are, the more sites indexed. The more sites indexed, the better the experience for all users. Join in! +使用 YaCy 搜索引擎可以做的不仅仅是被动搜索。你可以强制抓取不太显眼的网站,可以请求对网站进行网络抓取,可以选择使用 YaCy 进行本地搜索,等等。你可以更好地控制*你的*互联网的外观。高级用户越多,索引的网站就越多。索引的网站越多,所有用户的体验就越好。加入吧! -------------------------------------------------------------------------------- @@ -98,7 +98,7 @@ via: https://opensource.com/article/20/2/open-source-search-engine 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -107,7 +107,7 @@ via: https://opensource.com/article/20/2/open-source-search-engine [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) [2]: https://yacy.net/ -[3]: https://opensource.com/article/19/11/install-java-linux +[3]: https://linux.cn/article-11614-1.html [4]: https://adoptopenjdk.net/releases.html [5]: https://yacy.net/download_installation/ [6]: https://opensource.com/sites/default/files/uploads/yacy-startpage.jpg (YaCy start page)