当前位置:网站首页>centos 安装php7.4,搭建hyperf,转发RDS
centos 安装php7.4,搭建hyperf,转发RDS
2022-08-01 07:19:00 【游鱼_】
安装php7.4,搭建hyperf
8 sudo yum install epel-release
9 sudo yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
10 sudo yum -y install yum-utils
11 sudo yum-config-manager --enable remi-php74
12 sudo yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-redis php74-php-pecl-swoole4
13 php -v
14 php --ri swoole
15 yum wget
16 yum install wget
17 cd /home
18 mkdir temp
19 cd temp
20 wget https://github.com/swoole/swoole-src/archive/refs/tags/v4.5.11.tar.gz
21 tar -zxvf v4.5.11.tar.gz
22 cd swoole-src-4.5.11/
23 phpize
24 openssl version
25 openssl
26 ./configure
27 make
28 make install
29 vim /etc/php.ini
30 yum install -y vim
31 vim /etc/php.ini
32 php --ri swoole
33 yum install -y lrzsz
34 yum -y install docker
35 systemctl start docker
36 docker -v
有时RDS不请允许本地所在区域登录,就在服务器做个中转
安装nignx,做端口数据转发
在nginx.conf最后面加上
stream{
include /etc/nginx/conf.d/*.stream;
}
在conf.d里创建一个mysql.stream的文件
upstream tcpLink {
hash $remote_addr consistent;
server database-1.cr.ap-southeast-1.rds.amazonaws.com:3306 weight=5 max_fails=3 fail_timeout=30s;
}
server {
listen 8087;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass tcpLink;
}
运行nginx后会报错:
nginx: [emerg] unknown directive "stream" in /etc/nginx/nginx.conf:84
需要安装stream模块
在这比较懒,直接全装了
yum install -y nginx-all-modules
hyperf项目装好后,用docker运行
docker build -t admin-api:1.0.1 .
docker run --rm -p 9501:9501 -d --name admin-api admin-api:1.0.1
//进入docker
docker exec -it admin-api /bin/bash
记录几个docker命令
docker ps 列出当前运行的image
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5135a12fc06c admin-api:1.0.1 "php /opt/www/bin/..." 17 hours ago Up 17 hours 0.0.0.0:9501->9501/tcp admin-api
docker stop 513 根据上面CONTAINER ID,停止
边栏推荐
- 搜索框字符自动补全
- NIO编程
- Golang: go to connect and use mysql
- Introduction to the basic principles, implementation and problem solving of crawler
- rhcsa 第四天
- Create, modify and delete tables
- 05-SDRAM: Arbitration
- Fist game copyright-free music download, League of Legends copyright-free music, can be used for video creation, live broadcast
- MATLAB program design and application of MATLAB 2.5
- Compare two objects are the same depth
猜你喜欢

第02章 MySQL的数据目录【1.MySQL架构篇】【MySQL高级】

响应式织梦模板园林花卉类网站

Electromagnetic compatibility introductory tutorial (6) test project

小程序全面屏手势配置案例

Dell PowerEdge Server R450 RAID Configuration Steps

crypto-js uses

我说过无数遍了:从来没有一种技术是为灵活组合这个目标而设计的

Image lossless compression software which works: try completely free JPG - C image batch finishing compression reduces weight tools | latest JPG batch dressing tools download

Srping bean in the life cycle

爆肝3万字,最硬核丨Mysql 知识体系、命令全集 【建议收藏 】
随机推荐
2022杭电多校第二场1011 DOS Card(线段树)
特别数的和
Dart 异常详解
pytest接口自动化测试框架 | 跳过测试类
【南瓜书ML】(task4)神经网络中的数学推导(更新ing)
配置我的kitty
app 自动化 打开app (二)
I have three degrees, and I have five faces. I was "confessed" by the interviewer, and I got an offer of 33*15.
表的创建、修改与删除
pytest接口自动化测试框架 | parametrize中ids的用法
关于App不同方式更新的测试点归纳
插入排序—直接插入排序和希尔排序
rhcsa 第三次
研发过程中的文档管理与工具
curl (7) Failed connect to localhost8080; Connection refused
聊一聊ICMP协议以及ping的过程
LevelSequence源码分析
sum of special numbers
基于百度OCR的网站验证码在线识别
Golang:go连接和使用mysql