FTP、ISCSI、CHRONY、DNS、NFS、DOCKER、MARIADB、NGINX、PHP、CA各服务开启方法

2.1 FTP 服务 (vsftpd)

安装 vsftpd:

复制代码
sudo yum install vsftpd -y

启动并设置开机自启:

复制代码
sudo systemctl start vsftpd

sudo systemctl enable vsftpd

配置文件位于 /etc/vsftpd/vsftpd.conf,可根据需要修改配置。

2.2 SCSI 服务

SCSI 配置通常涉及磁盘管理和硬件设备设置。如果系统中有 SCSI 磁盘,通常只需要通过 lsblk、fdisk 等命令查看并管理磁盘。如果有特定的 SCSI 配置需求,可以编辑 /etc/fstab 来挂载 SCSI 磁盘,或者根据需求安装相关驱动程序。

2.3 Chrony 服务 (时间同步)

安装 Chrony:

复制代码
sudo yum install chrony -y

启动并设置开机自启:

复制代码
sudo systemctl start chronyd

sudo systemctl enable chronyd

可以编辑 /etc/chrony.conf 文件配置时间服务器。然后同步系统时间:

复制代码
sudo chronyc tracking

2.4 DNS 服务 (BIND)

安装 BIND(DNS 服务器):

复制代码
sudo yum install bind bind-utils -y

启动并设置开机自启:

复制代码
sudo systemctl start named

sudo systemctl enable named

配置文件位于 /etc/named.conf 和 /var/named/ 目录中。你需要根据需求配置 DNS 区域和主机记录。

2.5 NFS 服务

安装 NFS:

复制代码
sudo yum install nfs-utils -y

启动并设置开机自启:

复制代码
sudo systemctl start nfs-server

sudo systemctl enable nfs-server

编辑 /etc/exports 文件来配置共享目录,例如:

复制代码
/home   *(rw,sync,no_root_squash)

然后重新加载配置:

复制代码
sudo exportfs -a

2.6 Docker 服务

安装 Docker:

复制代码
sudo yum install -y yum-utils device-mapper-persistent-data lvm2

sudo yum install -y docker

启动并设置开机自启:

复制代码
sudo systemctl start docker

sudo systemctl enable docker

确认 Docker 正常运行:

复制代码
sudo docker --version

2.7 MariaDB 数据库服务

安装 MariaDB:

复制代码
sudo yum install mariadb-server -y

启动并设置开机自启:

复制代码
sudo systemctl start mariadb

sudo systemctl enable mariadb

进行初始化设置(设置 root 密码等):

复制代码
sudo mysql_secure_installation

2.8 Nginx 服务

安装 Nginx:

复制代码
sudo yum install nginx -y

启动并设置开机自启:

复制代码
sudo systemctl start nginx

sudo systemctl enable nginx

Nginx 的配置文件位于 /etc/nginx/nginx.conf,你可以根据需求进行修改。

2.9 PHP 服务

安装 PHP:

复制代码
sudo yum install php php-fpm php-mysqlnd -y

启动 PHP-FPM 服务:

复制代码
sudo systemctl start php-fpm

sudo systemctl enable php-fpm

配置 /etc/php-fpm.d/www.conf 使其与 Nginx 配合工作。

2.10 CA (证书管理服务)

对于证书管理,你可以使用 openssl 来生成证书,或者安装并配置 certbot 来获得 Let's Encrypt 证书。

安装 OpenSSL:

复制代码
sudo yum install openssl -y

使用 openssl 创建自签名证书:

复制代码
openssl req -new -newkey rsa:2048 -days 365 -nodes -keyout /etc/ssl/private/server.key -out /etc/ssl/certs/server.crt

或者使用 certbot 配置 Let's Encrypt 证书。

相关推荐
Patrick_Wilson18 小时前
从「改个端口」到 502:Next.js on k8s 的容器端口、Service 映射与 env 覆盖
docker·kubernetes·next.js
Suroy1 天前
DockerView-Go:用 Go 写一个终端 Docker 监控工具,顺便做了个 Web 仪表盘
docker
云恒要逆袭1 天前
运行你的第一个Docker容器
后端·docker·容器
宋均浩2 天前
# Docker 镜像瘦身实战:从 1.2G 到 80MB 的五个优化步骤
ci/cd·docker
Avan_菜菜3 天前
FRP 内网穿透完整实战:从 HTTP 映射到 HTTPS 自签代理
运维·nginx·https
程序员老赵3 天前
10 分钟部署 OpenCode:Docker 一键安装,浏览器打开就能用 AI 写代码(附完整命令与排错)
docker·容器·ai编程
WangMingHua1113 天前
LM Studio Docker 部署——本地大模型一键启动
docker
曲幽4 天前
别再用网页翻译看源码了!你的私人翻译神器LibreTranslate,部署避坑指南来了
python·docker·web·pot·translate·libretranslate·arogstranslate
武子康6 天前
调查研究-183 Apple container:Mac 上用轻量 VM 跑 Linux 容器,Swift 会改写本地容器体验吗?
docker·容器·apple
ping某7 天前
为什么 Nginx 明明监听了 80,转发后端时却用了 4xxxx 端口?
后端·nginx