# Update the list of available packages and their versions
apt update
# Install curl which is required to install Meilisearch in the next step
apt install curl -y
# Install Meilisearch latest version from the script
curl -L https://install.meilisearch.com | sh
In Linux environments, a is a process that can be launched when the operating system is booting and which will keep running in the background. One of its biggest advantages is making your program available at any moment. Even if some execution problems or crashes occur, the service will be restarted and your program will be run again.service
NOTE
If you are new to services and , you can learn more about the basics of Linux services systemdhere.
In Debian and other Linux distributions, allows you to create and manage your own custom services. In order to make sure that Meilisearch will always respond to your requests, you can build your own service. This way, you will ensure its availability in case of a crash or in case of system reboot. If any of these occur, will automatically restart Meilisearch.systemdsystemd
4.1. Create a service file
Service files are text files that tell your operating system how to run your program, and when. They live in the directory, and your system will load them at boot time. In this case, let’s use a very simple service file that will run Meilisearch on port ./etc/systemd/system7700
To run Meilisearch in a production environment, use the flag. Set a master key of at least 16 bytes using the option. When you launch an instance for the first time, Meilisearch creates two default API keys: Default Search API Key and Default Admin API Key. With the , you can control who can access or create new documents, indexes, or change the configuration.--env--master-keyDefault Admin API Key
Remember to choose a safe and random key and avoid exposing it in publicly accessible applications. You can change the master key with the following command:
# Set the service meilisearch
systemctl enable meilisearch
# Start the meilisearch service
systemctl start meilisearch
# Verify that the service is actually running
systemctl status meilisearch
砰砰��
-# --- Expected output ---
● meilisearch.service - MeiliSearch
Loaded: loaded (/etc/systemd/system/meilisearch.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-04-10 14:27:49 UTC; 1min 8s ago
Main PID: 14960 (meilisearch)
在大多数情况下,启用 SSL 时,您可能希望使用自己的域名(或子域)。您需要遵循的第一步是注册自己的域名并更改 DNS 记录。要使您的域名指向新安装的Meilisearch服务器,您只需添加一个指向用于连接到您自己的服务器的IP地址的指向即可。此过程简单快捷,但可能因每个域名提供商而异。因此,我们不会在本文中介绍该过程。A record
设置域名后,您就可以配置 SSL/TLS 并使用 HTTPS。您有两种不同的选择来实现此目标。第一个是使用塞特博特,一个惊人的,免费的,非常易于使用的工具。如果您已经为您的域名颁发了 SSL 证书,则第二个选项涵盖了您需要遵循的步骤。然后,您就可以在生产中安全地使用美利搜索了!Certificate Authority or CA
5.2.1. 选项 A:认证机器人
在Linux服务器中使用certbot非常简单。此工具将为您的域名生成免费的SSL / TLS证书,并自动处理其在服务器上的安装。certbot 文档包含许多操作系统和服务器的详细说明,但我们将按照以下说明进行操作Certbot on Debian with Nginx.
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
# Create a directory /etc/ssl/example to store the certificate files
mkdir -p /etc/ssl/example
# Move your files to /etc/ssl/example. We will suppose that your
# files are called example.pem and example.key
mv path-to-your-files/example.pem /etc/ssl/example/
mv path-to-your-files/example.key /etc/ssl/example/
最后,我们创建一个新的 Nginx 配置文件,并重新启动守护进程和 Nginx 服务
请记住将两个字段中的域名替换为您自己的域名example.comserver_name
砰砰��
# Replace example.com in both `server_name` fields with your own domain name
cat << EOF > /etc/nginx/sites-enabled/meilisearch
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com;
return 301 https://\$server_name\$request_uri;
}
server {
server_name example.com;
location / {
proxy_pass http://localhost:7700;
}
listen [::]:443 ssl ipv6only=on;
listen 443 ssl;
access_log /var/log/nginx/nginx.vhost.access.log;
error_log /var/log/nginx/nginx.vhost.error.log;
ssl_certificate /etc/ssl/example/example.pem;
ssl_certificate_key /etc/ssl/example/example.key;
}
EOF
systemctl restart nginx
您已按照主要步骤提供安全稳定的服务。您的 Meilisearch 实例应在安全的环境中启动并运行,并且即使在出现最常见问题时也能随时可用。此外,它受具有您自己的域名和 API 密钥的反向代理保护,因此您的数据和配置只能由受信任的客户端访问。与服务器的通信现已加密。此外,在以快速和自动的方式发送敏感数据之前,每次都会验证其身份。
1、CentOS 7.7 (已关闭防火墙及SELinux,默认密码Pwd@CentOS) 2、CentOS 7 (默认密码cxthhhhh.com) 3、CentOS 7 (支持ARM64、UEFI,默认密码cxthhhhh.com) 4、CentOS 8 (默认密码cxthhhhh.com) 5、Rocky 8 (默认密码cxthhhhh.com) 6、Rocky 8 (支持UEFI,默认密码cxthhhhh.com) 7、Rocky 8 (支持ARM64、UEFI,默认密码cxthhhhh.com) 8、CentOS 9 (默认密码cxthhhhh.com) 9、CentOS 6 (官方源原版,默认密码Minijer.com) 10、Debian 11 (官方源原版,默认密码Minijer.com) 11、Debian 10 (官方源原版,默认密码Minijer.com) 12、Debian 9 (官方源原版,默认密码Minijer.com) 13、Debian 8 (官方源原版,默认密码Minijer.com) 14、Ubuntu 20.04 (官方源原版,默认密码Minijer.com) 15、Ubuntu 18.04 (官方源原版,默认密码Minijer.com) 16、Ubuntu 16.04 (官方源原版,默认密码Minijer.com) 17、Windows Server 2022 (默认密码cxthhhhh.com) 18、Windows Server 2022 (支持UEFI,默认密码cxthhhhh.com) 19、Windows Server 2019 (默认密码cxthhhhh.com) 20、Windows Server 2016 (默认密码cxthhhhh.com) 21、Windows Server 2012 (默认密码cxthhhhh.com) 22、Windows Server 2008 (默认密码cxthhhhh.com) 23、Windows Server 2003 (默认密码cxthhhhh.com) 24、Windows 10 LTSC (默认密码Teddysun.com) 25、Windows 10 LTSC (支持UEFI,默认密码Teddysun.com) 26、Windows 7 x86 Lite (默认密码nat.ee) 27、Windows 7 x86 Lite (阿里云专用,默认密码nat.ee) 28、Windows 7 x64 Lite (默认密码nat.ee) 29、Windows 7 x64 Lite (支持UEFI,默认密码nat.ee) 30、Windows 10 LTSC Lite (默认密码nat.ee) 31、Windows 10 LTSC Lite (阿里云专用,默认密码nat.ee) 32、Windows 10 LTSC Lite (支持UEFI,默认密码nat.ee) 33、Windows Server 2003 Lite (C盘默认10G,默认密码WinSrv2003x86-Chinese) 34、Windows Server 2008 Lite (默认密码nat.ee) 35、Windows Server 2008 Lite (支持UEFI,默认密码nat.ee) 36、Windows Server 2012 Lite (默认密码nat.ee) 37、Windows Server 2012 Lite (支持UEFI,默认密码nat.ee) 38、Windows Server 2016 Lite (默认密码nat.ee) 39、Windows Server 2016 Lite (支持UEFI,默认密码nat.ee) 40、Windows Server 2022 Lite (默认密码nat.ee) 41、Windows Server 2022 Lite (支持UEFI,默认密码nat.ee) 99、自定义镜像