项目部署:
不论自己搭建环境还是用集成lnmp ,需要按以下步骤执行单:
第一:
Php 7.4
开启扩展:
redis
Mysql
Pdo-mysql
swoole
第二:
Windows 安装,并设置密码比如123456
Redis-server
跑起来。。。
第三步:
将后端代码下载到本地放到 任意目录,比如D:/projects/server目录
第四部
安装composer 很简单,请百度
第五部执行:
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
composer require easyswoole/redis
composer require easyswoole/queue
第六步
导入server.sql 数据库文件,
进入后端代码根目录,执行 php easyswoole server start ,启动后端服务
在nginx 里添加配置如下:
server {
listen 80;
server_name 127.0.0.1;
access_log /var/log/nginx/host.access.log;
location / {
autoindex on;
root /Users/siweichen/Desktop/vueex/dist; //vue path
index index.html;
try_files $uri $uri/ /index.html;
}
location /api {
proxy_pass http://127.0.0.1:9506/;
proxy_redirect default;
}
}
重启nginx,即可在浏览器访问
https://127.0.0.1
跑起来:
docker run -ti -v /home/chesw11/projects/lasha:/easyswoole -p 9503:9501 easyswoole/easyswoole3
更改镜像地址
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
php vendor/easyswoole/easyswoole/bin/easyswoole install
安装redis扩展及其他组件
cd /etc/yum.repos.d/,
cd /etc/yum.repos.d/
4 sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
5 sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
6 wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
7 yum clean all
8 yum makecache
yum install php74-php-pecl-redis5
composer require easyswoole/redis
composer require easyswoole/queue 3.x
nginx 配置
server {
listen 80;
listen [::]:80;
server_name domain.com;
#access_log /var/log/nginx/host.access.log main;
location / {
root /lasha/lasha/lashweb;
index index.html index.htm;
}
location /api {
proxy_pass http://127.0.0.1:port/;
proxy_redirect default;
}
location /files/ {
alias /uploadfiles/;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
docker run -d -p 3306:3306 \
-e MYSQL_ROOT_PASSWORD=123456 \
--name mysql mysql \
--default-authentication-plugin=mysql_native_password
docker run --name myadmin -d -e PMA_ARBITRARY=1 -p 9000:80 phpmyadmin/phpmyadmin
create user ly identified by '123456';
grant all on *.* to 'ly'@'%';
flush privileges;
##################blog syatem*******
docker run -d --name=typecho-blog --restart always -e PHP_TZ=Asia/Shanghai -e PHP_MAX_EXECUTION_TIME=600 -p 80:80 80x86/typecho:latest
docker run -ti -v /projects/erversbase:/easyswoole -p 9506:9501 easyswoole/easyswoole3
mayun
Siwei1234
Chen1210
docker run -itd --name fpmtyp -v /projects/bloghelo:/var/www/html -p 9200:9000 --privileged=true itdevgroup/php-fpm7.4
网友评论