首页
Search
1
安装docker时报错container-selinux >= 2:2.74
124 阅读
2
rsync命令(可替代rm删除巨量文件)
101 阅读
3
docker 镜像加速器配置,daemon.json文件详解
90 阅读
4
使用国内镜像地址拉取k8s安装需要的images
79 阅读
5
Redhat 8版本安装ansible步骤
75 阅读
运维
自动化运维
数据库
容器与k8s
环境
云计算
脚本
登录
Search
标签搜索
命令
nginx
Mingrui
累计撰写
64
篇文章
累计收到
0
条评论
首页
栏目
运维
自动化运维
数据库
容器与k8s
环境
云计算
脚本
页面
搜索到
19
篇与
的结果
2024-01-29
linux三剑客之grep,sed,awk常用命令
本文详细介绍了grep,sed,awk的常用用法及选项,并额外介绍了find命令
2024年01月29日
54 阅读
0 评论
0 点赞
2024-01-29
虚拟机初始化配置信息
1.配置yum源本地源#将光盘镜像挂载到/dvd/目录上 mount /dev/cdrom /dvd #将挂载信息写入配置文件,永久挂载(重启后依旧生效) sed -i '$a/dev/cdrom /dvd iso9660 defaults 0 0 ' /etc/fstab #-i选项:修改目标文件 #$a:在最后一行下面追加内容 #删除无用的yum配置信息 rm -rf /etc/yum.repos.d/*.repo #修改yum配置信息 cat >/etc/yum.repos.d/local.repo<<EOF [localrepo] name=centos baseurl=file:///dvd enabled=1 gpgcheck=0 EOF #[localrepo]:yum源名称 #name:yum源描述信息 #baseurl:yum仓库地址 #enabled:是否启用此yum源。1启用0禁用 #gpgcheck:是否验证待安装的RPM包。1启用0禁用 #若启用gpgcheck,则需指定验证所用秘钥文件的地址。 #需要添加gpgkey字段。如:gpgkey=file:///mnt/RPM-GPG-KEY-CentOS-7 yum clean all yum makecache yum repolist 网络源#腾讯云 wget -O /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-7.repo #阿里云 Epel软件包:Extra Packages for Enterprise Linux, 是Enterprise Linux(RHEL、CentOS)中经常用到的包。 #阿里云镜像仓库:https://developer.aliyun.com/mirror/ #阿里云RepoForge镜像地址:https://developer.aliyun.com/mirror/repoforge/ #RepoForge镜像:Repoforge是RHEL系统下的软件仓库,拥有10000多个软件包,被认为是最安全、最稳定的一个软件仓库。Epel软件包地址 {collapse}{collapse-item label="RepoForge配置方式" open}向系统中添加 Repoforge 的 GPG 公钥: rpm --import https://mirrors.aliyun.com/repoforge/RPM-GPG-KEY.dag.txt 运行下列命令sudo cat > /etc/yum.repos.d/rpmforge.repo << EOF [rpmforge] name = RHEL $releasever - RPMforge.net - dag baseurl = https://mirrors.aliyun.com/repoforge/redhat/el7/en/$basearch/rpmforge mirrorlist = http://mirrorlist.repoforge.org/el7/mirrors-rpmforge enabled = 1 protect = 0 gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag gpgcheck = 1 [rpmforge-extras] name = RHEL $releasever - RPMforge.net - extras baseurl = https://mirrors.aliyun.com/repoforge/redhat/el7/en/$basearch/extras mirrorlist = http://mirrorlist.repoforge.org/el7/mirrors-rpmforge-extras enabled = 0 protect = 0 gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag gpgcheck = 1 [rpmforge-testing] name = RHEL $releasever - RPMforge.net - testing baseurl = https://mirrors.aliyun.com/repoforge/redhat/el7/en/$basearch/testing mirrorlist = http://mirrorlist.repoforge.org/el7/mirrors-rpmforge-testing enabled = 0 protect = 0 gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag gpgcheck = 1 EOF 官方主页:http://repoforge.org/{/collapse-item}{/collapse}2.修改网卡信息修改网卡命名规则,以eth0开始,将网卡命名为eth0,eth1,eth2...# grub内核引导程序 vim /etc/default/grub GRUB_CMDLINE_LINUX="…….. quiet net.ifnames=0 biosdevname=0" #在GRUB_CMDLINE_LINUX字段末尾添加net.ifnames,bisodevname字段 #重新生成网卡命名的规则 grub2-mkconfig -o /boot/grub2/grub.cfg配置网卡信息 #查看网卡命名信息 nmcli connection show #给网卡添加别名 nmcli connection add type ethernet ifname eth0 con-name eth0 #修改ip信息 nmcli connection modify eth0 ipv4.method manual ipv4.addresses 192.168.88.1/24 ipv4.gateway 192.168.88.200 connection.autoconnect yes #激活网卡 nmcli connection up eth0 #或者使用ifdowd ifup 命令 didown eth0 && ifup eth0网卡配置文件地址:/etc/sysconfig/network-scripts/3.安装常用软件包#安装vim yum -y install vim #安装支持tab键的软件包,装好之后需重启生效 yum -y install bash-completion #安装网络相关工具 yum -y install net-tools #安装支持killall命令的软件 yum -y install psmisc
2024年01月29日
60 阅读
0 评论
0 点赞
2024-01-25
nginx配置https网站和按照域名划分虚拟主机
server { listen 80; listen [::]:80; server_name zhangmingrui.cool; return 301 https://$host$request_uri; } server { listen 80; listen [::]:80; server_name doc.zhangmingrui.cool; return 301 https://$host$request_uri; } {callout color="#f0ad4e"}说明:此处按域名不同配置了两个虚拟主机,监听ipv4/ipv6网段对80端口的访问;return行的目的是把所有的HTTP请求重定向到https,强制所有的访问都走https模式。{/callout}server { if (!-e $request_filename) { rewrite ^(.*)$ /index.php$1 last; } listen 443 ssl; server_tokens off; keepalive_timeout 5; root /usr/share/nginx/html; index index.php index.html; server_name zhangmingrui.cool; ssl_certificate /etc/nginx/conf.d/zhangmingrui.cool_bundle.crt; ssl_certificate_key /etc/nginx/conf.d/zhangmingrui.cool.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 ~ \.php(\/.*)*$ { root /usr/share/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi_params; client_max_body_size 20m; fastcgi_connect_timeout 30s; fastcgi_send_timeout 30s; fastcgi_read_timeout 30s; fastcgi_intercept_errors on; } }{callout color="#f0ad4e"}说明:该段配置是启用https功能。if判断的功能是为了将动态链接伪装成静态链接。ssl_certificate 与 ssl_certificate_key是配置公私钥,其后跟的是公私钥的存储地址。{/callout}{abtn icon="fa-download" color="#ff6800" href="https://doc.zhangmingrui.cool/usr/uploads/2024/01/2854896986.conf" radius="17.5" content="下载nginx配置文件(default.conf)"/}{abtn icon="fa-download" color="#ff6800" href="https://doc.zhangmingrui.cool/usr/uploads/2024/01/807304331.conf" radius="17.5" content="下载nginx配置文件(https.conf)"/}
2024年01月25日
61 阅读
0 评论
0 点赞
2023-12-29
php 8.2 安装过程
本次安装php8.2使用的是源码包安装方法。该方法可以按照实际需要配置php模块,灵活度较高。安装过程比较简单,主要是安装php所需要的依赖比较繁琐。下文就比较常见的依赖包安装方法进行了归纳汇总。#下载php8.3.1软件包 curl -o /root/php-8.3.1.tar.gz https://www.php.net/distributions/php-8.3.1.tar.gz #解压缩 tar xf php-8.3.1.tar.gz #配置阿里云yum源 rm -rf /etc/yum.repos.d/*.repo curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo yum makecache #安装编译工具 yum -y install gcc make #进入php源码包目录 cd php-8.3.1 #使用./configure自定义需要的模块,生成Makefile文件 ./configure --prefix=/usr/local/php/ --build=x86_64-linux-gnu --with-config-file-path=/usr/local/etc/php --with-config-file-scan-dir=/usr/local/etc/php/conf.d --enable-option-checking=fatal --with-mhash --with-pic --enable-ftp --enable-mbstring --enable-mysqlnd --with-password-argon2 --with-sodium=shared --with-pdo-sqlite=/usr --with-sqlite3=/usr --with-curl --with-iconv --with-openssl --with-readline --with-zlib --disable-phpdbg --with-pear --with-libdir=lib/x86_64-linux-gnu --disable-cgi --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --with-mysqli #根据提示安装需要的依赖 yum -y install libxml2 libxml2-devel yum -y install openssl-devel yum -y install sqlite-devel yum -y install libcurl-devel yum -y install readline-devel #安装依赖oniguruma包 mkdir /root/onigur cd /root/onigur/ curl -o /root/onigur/oniguruma-devel-6.8.2-2.el8.x86_64.rpm \ http://mirror.centos.org/centos/8-stream/PowerTools/x86_64/os/Packages/oniguruma-devel-6.8.2-2.el8.x86_64.rpm curl -o /root/onigur/oniguruma-6.8.2-2.el8.x86_64.rpm \ http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/oniguruma-6.8.2-2.el8.x86_64.rpm yum -y install oniguruma-devel-6.8.2-2.el8.x86_64.rpm yum -y install oniguruma-6.8.2-2.el8.x86_64.rpm #安装依赖libsodium包 curl -o /root/last.tar https://download.libsodium.org/libsodium/releases/LATEST.tar.gz tar -zxf LATEST.tar.gz cd libsodium-stable/ ./configure make && make install vim /etc/profile export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig source /etc/profile pkg-config --list-all | grep libsodium #查看是否安装成功 #安装依赖libargon2 curl -O https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/l/libargon2-20171227-3.el8.x86_64.rpm curl -O https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/l/libargon2-devel-20171227-3.el8.x86_64.rpm yum -y install libargon2-20171227-3.el8.x86_64.rpm libargon2-devel-20171227-3.el8.x86_64.rpm #安装php cd /root/php-8.3 make && make installphp ./configure通过后,会出现下图所示提示make install后会显示如下界面
2023年12月29日
55 阅读
0 评论
0 点赞
1
...
3
4