宝塔面板安装:
yum install -y wget && wget -O install.sh https://download.bt.cn/install/install_6.0.sh && sh install.sh ed8484bec
修改host文件:C:\Windows\System32\drivers\etc\hosts,配置一个域名
192.168.1.100 www.xxx.local
需要安装的软件及配置
nginx-1.22.1
mysql5.7
php7.3-7.4
redis
supervisor
阿里云及宝塔安全中放行端口,或关闭防火墙
添加7个端口:80,21,8888,888,443,3306,6379,20002,20003,20012
所在服务器关闭防火墙
systemctl firewalld stop
service firewalld stop
配置
网站-添加站点-根目录:
/mnt/hgfs/windows_linux/bird/trunk/crmeb/
点对应网站后面的设置-网站目录-运行目录设为public,记得点保存
伪静态选crmeb或thinkphp
网站对应的配置文件中添加或修改(如果端口改了的话也要对应修改),停止再启动nginx直接重启有可能不生效
location ~ .*\.(js|css|json)?$
{
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Credentials' "true";
if ($request_method = "OPTIONS") {
add_header 'Access-Control-Max-Age' 86400;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE';
add_header 'Access-Control-Allow-Headers' 'reqid, nid, host, x-real-ip, x-forwarded-ip, event-type, event-id, accept, content-type';
add_header 'Content-Length' 0;
add_header 'Content-Type' 'text/plain, charset=utf-8';
return 204;
}
expires 12h;
error_log /dev/null;
access_log /dev/null;
}
location /notice {
proxy_pass http://127.0.0.1:20002/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /msg {
proxy_pass http://127.0.0.1:20003/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
}
如果要https方式访问,要设置ssl证书
数据库
根据.env中的配置,新建数据库,设置用户名及密码
修改.env中数据库的ip地址
宝塔中对root密码修改
导入数据表数据库
软件商店中修改mysql配置文件
sql-mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
.env配置-测试环境,注意不要把注释写在后面,如:HOSTNAME = 47.243.226.159#这台服务器是新的
如果无法远程连接:
mysql -uroot -p
use mysql;
grant all privileges on *.* to 'root'@"%" identified by "你的密码";
flush privileges;
放行端口3306
redis无法远程连接:
1. bind 127.0.0.1改为 bind 0.0.0.0
127.0.0.1: 代表本地地址,访问redis服务只能通过本机的客户端连接,而无法通过远程连接
0.0.0.0: 接受所有来自于可用网络接口的连接
2. protected-mode yes 改为 protected-mode no
yes: 保护模式,只允许本地链接
no: 保护模式关闭
改密码(后面的密码根据环境修改)
requirepass wenmKgO!9
php
安装扩展
fileinfo
redis
删除禁用函数
proc_open
pcntl_signal
pcntl_signal_dispatch
pcntl_fork
pcntl_wait
pcntl_alarm
php think workerman start --d
php think timer start --d
根目录中执行以上,
supervisor中添加守护进程
php think queue:listen --queue
以下目录及文件要写入权限,根据项目实际情况而定
chmod -R 777以下目录
runtime
runtime/log/UnpaidOrderCancelJob
public/log
chmod 777 workerman.pid
chmod 777 vendor/workerman/workerman.log
chmod 777 unpaidCancel_test.sh
chmod 777 weaverbird_test.sh
- 相关文章
- windows下使用MongoDB Compass Com
- Oracle VM VirtualBox中设置共享文
- linux安装openvpn并保存密码
- deepin v20深度系统安装docker及do
- 域名在阿里云服务器换成腾讯云后备
- windows下安装VirtualBox增强工具
- 国内访问github慢或打不开的解决方
- linux下安装phpstorm2018及激活码
- vmware中虚拟机上不了网及共享文件
- linux版phpstorm2020.3.3及激活码
- 热门文章
- win7中将文件拷贝到虚拟机linux下
- phpexcel设置行高及列宽,背景颜色,
- rabbitmq无法启动
- intellij idea不显示git push按钮
- php7中使用mongodb的aggregate进行
- laravel页面静态化的方法
- centos7.4 64位下swoole安装及配置
- navicate连接mycat报1184错误
- curl设置超时不起作用(CURLOPT_TIM
- devops-jenkins容器为pending状态
- 好评文章
- phpexcel设置行高及列宽,背景颜色,
- php7中使用mongodb的aggregate进行
- intellij idea打开文件所在文件夹
- windows下使用MongoDB Compass Com
- win7中将文件拷贝到虚拟机linux下
- laravel 中悲观锁 & 乐观锁的使用
- 单点登录sso原理及php实现方式及de
- navicate连接mycat报1184错误
- rabbitmq无法启动
- laravel整合dingo/api方法步骤:jwt
- 我的项目
- 【github】www.github.com/hurong241
- 【码云】gitee.com/hu_rong/projects
- 【docker hub】hub.docker.com/repositories/hurong241
- 【packagist】packagist.org/users/hurong241/packages
- 站点信息
- 建站时间:2011年
- 文章数:623篇
- 浏览数:1303109