一、安装minio
1.官网下载需要的版本
https://min.io/
2.给minio添加执行权限
chmod +x minio
3.创建目录
mkdir -p /miniodata/data/minio/bin
mkdir -p /miniodata/data/minio/etc
mkdir -p /miniodata/data/minio/data
4.将下载的minio拷贝至/data/minio/bin
./mini --version 查看权限
5.创建用户组喝创建用户
groupadd minio
useradd minio -g minio
6.创建minio配置文件
vi /miniodata/data/minio/etc/minio.conf
MINIO_VOLUMES="/data/minio/data"
MINIO_OPTS=“-C /data/minio/etc --console-address "ip:41203" -address ip:9000”MINIO_ACCESS_KEY=”minioadmint"
MINIO_SECRET_KEY="123456"
7.创建一个minio.server服务
vi /etc/systemd/system/minio.service
[Unit]
Description=MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/miniodata/data/minio/bin/minio
[Service]
#User and group
User=minio
Group=minio
EnvironmentFile=/miniodata/data/minio/etc/minio.conf
ExecStart=/miniodata/data/minio/bin/minio server $MINIO_OPTS $MINIO_VOLUMES
#Let systemd restart this service always
Restart=always
#Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536
#Disable timeout logic and wait until process is stopped
TimeoutStopSec=infinity
SendSIGKILL=no
[Install]
WantedBy=multi-user.target
###注意#User and group
User=minio
Group=minio
配置了用户是minio启动 需要注意文件权限,不然会启动失败,我后来改成root用户,省的麻烦
8.更改文件目录属性
Chmod -R minio:minioo /data/minio
9.启动服务
systemctl daemon-reload
systemctl enable minio.service
systemctl start minio.service
systemctl status minio.service
systemctl stop minio.service
二、修改https(nginx实现)
必备条件:需要有备案域名以及证书,
1、修改minio.server文件
ExecStart=/miniodata/data/minio/bin/minio server $MINIO_OPTS $MINIO_API $MINIO_VOLUMES
2、nginx配置
server {
listen 443 ssl;
server_name 域名;
ssl_certificate /usr/local/nginx/ssl/*.pem;
ssl_certificate_key /usr/local/nginx/ssl/*.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
location ^~/pic/ {
proxy_pass http://172.1.11.1:9000;
proxy_buffering off;
proxy_set_header Host $http_host;
rewrite ^/pic/(.*)$ /$1 break;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
3、上传证书到nginx和minio服务器
nginx服务器证书上传需要放到配置文件指定的目录
ssl_certificate /usr/local/nginx/ssl/*.pem;
ssl_certificate_key /usr/local/nginx/ssl/*.key;
minio服务器上传证书需要修改名字。
private.key
public.crt
如果不知道上传到哪里,可以如下查看:
echo $HOME
我这边返回的是/root 所以我证书需要上传到/root/.minio/certs/目录下
注意: minio这边证书是一定要上传到的,不然会访问会报错
文章来源:https://www.toymoban.com/news/detail-673442.html
4、重启minio验证
文章来源地址https://www.toymoban.com/news/detail-673442.html
到了这里,关于记录一下minio安装及配置https+域名访问的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!