minum necessary for installation
安装依赖
yum -y install gcc automake autoconf libtool make yum -y install pcre-devel openssl openssl-devel gd-devel gcc gcc-c++ yasm-1.3.0 安装 cd yasm-1.3.0 ./configure make && make install
方法2
sudo dnf -y update
sudo dnf -y install epel-release
sudo dnf -y install supervisor net-tools iproute procps-ng
安装ffmpeg
方法1
download Download FFmpeg cd ffmpeg-xxx ./configure --prefix=/usr/local/ffmpeg make -j && make install ln /usr/local/ffmpeg/bin/ffmpeg /usr/bin/ffmpeg ln /usr/local/ffmpeg/bin/ffprobe /usr/bin/ffprobe 方法2,有可能互道报错 “ffmpeg: error while loading shared libraries: libmp3lame.so.0”
sudo dnf install epel-release
sudo yum config-manager --set-enabled powertools
sudo yum config-manager --add-repo=https://negativo17.org/repos/epel-multimedia.repo
sudo dnf install ffmpeg
#ffmpeg -version 如果遇到报错执行
cp /usr/local/lib/libmp3lame.so.0 /usr/lib64/
nginx安装
http://nginx.org/download/ 下载版本
GitHub - arut/nginx-rtmp-module: NGINX-based Media Streaming Server rtmp模块下载
yum -y install openssl openssl-devel #若没有安装依赖执行此步
./configure --prefix=/usr/local/nginx --add-module=/root/nginx-rtmp-module-master
make && make install
如果启动失败尝试下面命令 yum -y install compat-openssl10 # systemctl stop firewalld # systemctl disable firewalld
配置帮助
https://nginx.org/en/docs/http/ngx_http_core_module.html#directives
跨域问题:
http中增加
add_header Access-Control-Allow-Origin *;
制作为服务
vi /usr/lib/systemd/system/nginx.service
[Unit]
Description=Nginx HTTP Server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target
systemctl daemon-reload #重新加载 systemd 配置文件
systemctl start nginx
systemctl enable nginx
安装python3
dnf -y update dnf install python39 python3 --version
mv /usr/bin/python3 /usr/bin/python3.original
ln -s /usr/bin/python3.12 /usr/bin/python3
安装samba
yum install samba 配置 vi /etc/samba/smb.conf [global] workgroup = WORKGROUP server string = Samba Server %v netbios name = almaLinux-8 security = user map to guest = bad user dns proxy = no ntlm auth = true [opt] path = /opt browsable = yes writable = yes guest ok = yes read only = no 启动和设置自启动 systemctl start smb systemctl status smb systemctl enable smb 开机启动
添加用户
useradd -g root admin
passwd admin
smbpasswd -a admin
若samba启动了,但遇到权限问题,执行下面三步 sudo chmod -R 777 /opt sudo chown -R nobody:nobody /opt sudo chcon -t samba_share_t /opt 要关闭SELINUX : 很关键,不然也只能读不能写 setenforce 0 #临时关闭 # vi /etc/sysconfig/selinux then reboot 永久关闭 SELINUX=permissive # getenforce #查看状态 Permissive #这个状态就可写了
FTP服务器
安装 yum -y install vsftpd
配置,若不配置端口则默认端口如下, • 20端口用于建立数据连接,并传输文件数据 • 21端口用于建立控制连接,并传输FTP控制命令 vi /etc/vsftpd/vsftpd.conf pam_service_name=vsftpd userlist_enable=NO tcp_wrappers=YES #ftp访问目录 local_root=/home/ftproot #被动模式 pasv_enable=YES #高端口 pasv_min_port=65000 pasv_max_port=65010 用户和文件权限 useradd ftpseven -s /sbin/nologin -d /home/ftproot passwd ftpseven chown -R ftpseven /home/ftproot chmod 777 /home/ftproot echo 'ftpseven' >> /etc/vsftpd/user_lis 若selinux被禁用 vim /etc/pam.d/vsftpd 注释掉如下内容 #auth required pam_shells.so #防火墙设置 systemctl stop firewalld firewall-cmd --permanent --zone=public --add-port=21/tcp firewall-cmd --permanent --zone=public --add-port=65000-65010/tcp firewall-cmd --reload #重新加载 firewall-cmd --zone=public --list-port #参考开发端口 #firewall-cmd --permanent --zone=public --remove-port=8886/tcp #禁用端口 #开机启动 systemctl enable vsftpd.service #重启服务 systemctl restart vsftpd.service #启动 systemctl start vsftpd.service #停止 systemctl stop vsftpd.service #状态 systemctl status vsftpd.service
设置sftp
vi /etc/ssh/sftpd_config 放开以下两个配置,并将其设置大一点 MaxSessions 200 MaxStartups 100:30:200 systemctl restart sshd
安装jenkins
https://www.cnblogs.com/idccoupon/p/15126770.html
docker
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo dnf -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin sudo systemctl --now enable docker
防火墙
iptables -nL yum install firewalld systemd -y firewall-cmd --list-ports firewall-cmd --zone=public --add-port=80/tcp --permanent systemctl start firewalld systemctl reload firewalld systemctl stop firewalld iptables -t filter -A INPUT -s 192.168.1.5 -i eth0 -j DROP 禁止IP为192.168.1.5的主机从eth0访问本机 iptables -t filter -I INPUT 2 -s 192.168.5.0/24 -p tcp --dport 80 -j DROP 禁止子网192.168.5.0访问web服务 iptables -t filter -I INPUT 2 -s 192.168.7.9 -p tcp --dport ftp -j DROP 禁止IP为192.168.7.9访问FTP服务 dport:目的端口 sport:来源端口 accept:接收数据包。 DROP:丢弃数据包。
安装allure
#安装依赖
yum list | grep jdk
yum install java-17-openjdk-devel.x86_64
#下载allure,如 allure-2.30.0.tgz
https://github.com/allure-framework/allure2/releases
#解压
tar -zxvf allure-2.30.0.tgz -C /usr/local/
#设置环境变量
vi /etc/profile
#最后一行加入下面一行,保存退出
export PATH=$PATH:/usr/local/allure-2.30.0/bin
#使之立即生效
source /etc/profile
#python也需要插件与allure exe链接才能使用
pip3 install allure_pytest
nodejs安装
#rocky安装
sudo dnf module list nodejs
sudo dnf -y module enable nodejs:18
sudo dnf -y install nodejs
node -v
#centos安装nodejs curl -sL https://rpm.nodesource.com/setup_16.x | bash - yum install -y nodejs
npm config set registry https://registry.npmjs.org/ #默认镜像源
npm config set registry http://registry.npmmirror.com #
设置为淘宝镜像源
npm config get registry #查看当前镜像源
#init.sh
#!/bin/bash
echo "service initialization..."
echo "installing all project dependencies..."
npm install
echo "...done!"
# Set npm global installation path to /usr
npm config set prefix /usr
echo "install pm2..."
npm install pm2 -g
echo "pm2 installation done."
pm2 delete "xxx" #删除不需要的服务
pm2 start ./ecosystem.config.js --env production
pm2 save
pm2 startup
参考:Centos7 修改硬盘分区大小_centos7磁盘更改分区-CSDN博客
umount /home lvremove /dev/mapper/centos-home lvextend -L +500G /dev/mapper/centos-root xfs_growfs /dev/mapper/centos-root df -h /dev/mapper/centos-root 550G 7.0G 544G 2% / #增加了500G lvcreate -L 480G -n home centos mkfs.xfs /dev/centos/home mount /dev/centos/home /home df -h /dev/mapper/centos-root 550G 7.0G 544G 2% / /dev/mapper/centos-home 480G 33M 480G 1% /home #home恢复正常
设置rocky时间、时区、NTP
手动设置时间 sudo date MMDDhhmm[[CC]YY] 设置时区 timedatectl set-timezone Asia/Shanghai timedatectl status 设置NTP dnf install chrony -y systemctl start chronyd systemctl enable chronyd
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· NetPad:一个.NET开源、跨平台的C#编辑器
· PowerShell开发游戏 · 打蜜蜂
· 凌晨三点救火实录:Java内存泄漏的七个神坑,你至少踩过三个!