1.防火墙设置
firewall-cmd –zone=public –add-port=端口号/tcp –permanent
2.安装宝塔面板国际版
yum install -y wget && wget -O install.sh http://www.aapanel.com/script/install_6.0_en.sh && bash install.sh aapanel
- 所需安装的插件
- Nginx 1.17
- MySQL 5.6
- PHP 7.4
- Supervisor
- 面板设置:
- 安装Redis、fileinfo
- aaPanel 面板 > App Store > 找到PHP 7.4点击Setting > Install extentions > redis,fileinfo 进行安装。
- 解除被禁止的函数
- aaPanel 面板 > App Store > 找到PHP 7.4点击Setting > Disabled functions 将
putenvproc_openpcntl_alarmpcntl_signal从列表中删除。
- aaPanel 面板 > App Store > 找到PHP 7.4点击Setting > Disabled functions 将
- 添加站点
- aaPanel 面板 > Website > Add site
- 安装Redis、fileinfo
3.安装V2Board
- aaPanel 面板 > Website > 点击网站根目录——把根目录下的四个文件删除
- 四个文件:.htaccess、404.html、index.html、.user.ini(这一个要多删除一次)
- 下载v2board项目文件
- 点击Website——点击网站根目录——点击Remote download——打开【项目下载地址】——找到1.73版——右键复制链接地址——把它粘贴到URL address——点击Confirm——下载完成后——点击解压——然后全选——剪切——粘贴到根目录
- 进入网站根目录,然后执行命令安装依赖包以及V2board
- sh init.sh
4.配置站点目录、伪静态和SSL证书
- 添加完成后编辑添加的站点 > Site directory > Running directory 选择 /public 保存。
- 添加完成后编辑添加的站点 > URL rewrite 填入伪静态信息。
- location /downloads { } location / { try_files $uri $uri/ /index.php$is_args$query_string; } location ~ .*\.(js|css)?$ { expires 1h; error_log off; access_log /dev/null; }
- 申请安全证书
- aaPanel 面板 > Website > 点击Conf > 点击SSL
5.配置定时任务
- aaPanel 面板 > Cron
- 在 Type of Task 选择 Shell Script
- 在 Name of Task 填写 v2board(可自定义)
- 在 Period 选择 N Minutes 1 Minute
- 在 Script content 填写 php /www/wwwroot/路径/artisan schedule:run
- 根据上述信息添加每1分钟执行一次的定时任务。
6、启动队列服务
- aaPanel 面板 > App Store > Tools
- 找到Supervisor进行安装,安装完成后点击
设置 > Add Daemon按照如下填写- 在 Name 填写 V2board(可自定义)
- 在 Run User 选择 www
- 在 Run Dir 选择 站点目录 在 Start Command 填写 php artisan horizon 在 Processes 填写 1
- 填写后点击Confirm添加即可运行。