分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > IT知识

linux 服务器 ?php vue项目部署流程总结

发布时间:2023-09-06 02:12责任编辑:苏小强关键词:暂无标签

服务器配置

  • 购买阿里云服务器 (选择ubuntu 16系统 / 内存2G以上)
  • 安全策略, 入规则: 添加端口 20,21,22, 80, 443, 3306, 8080,
  • 安装宝塔 wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh && sudo bash install.sh
  • 登录宝塔 安装软件 并 修改宝塔端口号.

用宝塔管理网站配置

  • 添加域名
  • 上传程序
  • 虚拟机目录指向程序public目录
  • 设置伪静态
    设置伪静态
location / { ????if (!-e $request_filename) { ?????????rewrite ^/(.*)$ /index.php/$1; ????}}

允许mysql远程连接

修改/etc/my.cnf配置

在[mysqld] 添加以下项character_set_server=utf8skip-name-resolveskip-external-locking#注释掉bind-address = 127.0.0.1#如果忘记密码,可加skip-grant-tables, 重置密码后再注释掉

登录mysql配置允许远程连接的账号权限
登录mysql, 授权navicat,所有操作,所有表,所有主机权限

sudo mysql -uroot -ppasswordgrant all privileges on *.* to ‘navicat‘@‘%‘ identified by ‘123456‘;flush privileges; exit;

重启 mysql sudo service mysql restart
判断远程是否可连接 telnet xxx.xxx.xxx.xxx 3306
如果不能连接, 防火墙开放端口

iptables -A INPUT -p tcp --dport 3306 -j ACCEPTiptables -L -nservice iptables save

配置https

生成 Let‘s Encrypt 免费https证书

定时任务

设置定时任务

linux 服务器 ?php vue项目部署流程总结

原文地址:https://www.cnblogs.com/xielisen/p/9536290.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved