項目部署:
不論自己搭建環(huán)境還是用集成lnmp ,需要按以下步驟執(zhí)行單:
第一:
Php 7.4
開啟擴展:
redis
Mysql
Pdo-mysql
swoole
第二:
Windows 安裝,并設置密碼比如123456
Redis-server
跑起來。。订框。
第三步:
將后端代碼下載到本地放到 任意目錄楣责,比如D:/projects/server目錄
第四部
安裝composer 很簡單,請百度
第五部執(zhí)行:
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
composer require easyswoole/redis
composer require easyswoole/queue
第六步
導入server.sql 數(shù)據(jù)庫文件笋轨,
進入后端代碼根目錄,執(zhí)行 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