首页
提效神器
常用运维脚本汇总
电子书阅读
推荐
电子书阅读
事物管理
Search
1
安装docker时报错container-selinux >= 2:2.74
207 阅读
2
rsync命令介绍(可替代rm删除巨量文件)
168 阅读
3
kubernetes集群各组件安装过程汇总
163 阅读
4
docker 镜像加速器配置,daemon.json文件详解
148 阅读
5
docker search命令提示i/o timeout的解决方案
106 阅读
运维
自动化运维
数据库
容器与k8s
环境
云计算
脚本
ai
登录
/
注册
Search
标签搜索
命令
nginx
zabbix
Mingrui
累计撰写
113
篇文章
累计收到
8
条评论
首页
栏目
运维
自动化运维
数据库
容器与k8s
环境
云计算
脚本
ai
页面
提效神器
常用运维脚本汇总
电子书阅读
推荐
电子书阅读
事物管理
搜索到
88
篇与
的结果
2023-12-29
docker搭建nginx与php的compose文件
说明: 1.php容器为了能与nginx容器通信,网络模式需要设置为container,与nginx共用网卡。为确保php容器的正常启动,需要设置容器间的启动顺序,也就是依赖,因此添加了 depends_on字段,以确保先启动nginx容器,之后再启动php容器。 2.为了保存网站数据,需要设置存储映射。html目录下存在网站文件,conf目录下存放nginx配置文件,log目录下存放日志文件。本文中的示例是一个容器内配置了两个网址,故存储映射分别做了两遍。为了确保php也能访问到网站数据,需要在php容器中进行html目录的映射。 3.开启https需要配置公钥与私钥,相关配置需要在nginx配置中修改。 4.nginx与php通信有两种方式。一种是通过9000端口,这需要php监听9000端口。当nginx发现有php访问请求时会把该请求转发给9000端口,php监听到请求后处理请求然后将处理结果返回给nginx,nginx再将结果返回给用户。另一种方式是使用sock文件。 5.对小网站而言两种处理php请求的效率区别不大,但在高并发大访问量的网站中,使用sock文件来处理php请求效率会高一些。 {mtitle title="yaml代码"/}{lamp/}version: "2" services: nginx: container_name: nginx image: nginx:latest environment: - TZ=Asia/Shanghai ports: - 80:80 - 443:443 volumes: - /website/html/:/usr/share/nginx/html/ - /website/conf/:/etc/nginx/conf.d/ - /website/log/:/var/log/nginx/ - /website/doc_html/:/usr/share/nginx/doc_html/ php: container_name: php image: php:7.4-fpm volumes: - /website/html/:/usr/share/nginx/html - /website/doc_html/:/usr/share/nginx/doc_html/ network_mode: "container:nginx" restart: always depends_on: - nginx {abtn icon="fa-arrow-circle-o-down" color="#ff6800" href="https://doc.zhangmingrui.cool/usr/uploads/2024/01/96183612.yaml" radius="17.5px" content="点击下载yaml文件"/}
2023年12月29日
75 阅读
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日
64 阅读
0 评论
0 点赞
2023-01-01
此内容被密码保护
加密文章,请前往内页查看详情
2023年01月01日
8 阅读
0 评论
1 点赞
1
...
17
18