SSPanel机场搭建

安装PHP8.3运行环境

  1. 首先需要设置系统的数据更新源

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    # 设置最新PHP官方源
    sudo apt update && sudo apt upgrade -y
    sudo apt install ca-certificates apt-transport-https software-properties-common lsb-release -y && sudo add-apt-repository ppa:ondrej/php -y
    sudo apt update && sudo apt upgrade -y

    # 安装PHP模组
    apt install -y php8.3-{bcmath,bz2,cli,common,curl,fpm,gd,igbinary,mbstring,mysql,opcache,readline,redis,xml,yaml,zip}

    # 启动PHP并设置开机启动
    systemctl start php8.3-fpm && systemctl enable php8.3-fpm
  2. SSPanel安装

1
2
3
4
5
6
7
8
9
10
11
# 设置网站配置文件
cp config/.config.example.php config/.config.php && cp config/appprofile.example.php config/appprofile.php

git clone -b 2023.6 https://github.com/Anankke/SSPanel-Uim.git . && wget https://getcomposer.org/installer -O composer.phar && php composer.phar

# 设置网站目录权限
chmod -R 755 * && chown -R www:www *

# 设置定时任务:每隔5分钟执行一次
*/5 * * * * /usr/local/php/bin/php /data/wwwroot/你的域名/xcat Cron

注:也可以使用1Panel部署SSPanel,但在填写数据库信息的时候需要特别注意与教程中的区别。

安装SSPanel面板

https://github.com/Anankke/SSPanel-Uim

https://naiyous.com/2757.html

https://oneinstack.com/auto/

1
2
3
4
5
# 安装Nginx,PHP以及MariaDB数据库
wget -c http://mirrors.oneinstack.com/oneinstack-full.tar.gz && tar xzf oneinstack-full.tar.gz && ./oneinstack/install.sh --nginx_option 1 --php_option 12 --phpcache_option 1 --php_extensions ioncube,fileinfo,redis --phpmyadmin --db_option 5 --dbinstallmethod 1 --dbrootpwd oneinstack --redis --reboot

# 只安装PHP
wget -c http://mirrors.oneinstack.com/oneinstack-full.tar.gz && tar xzf oneinstack-full.tar.gz && ./oneinstack/install.sh --php_option 12 --phpcache_option 1 --php_extensions ioncube,fileinfo,redis --redis --reboot
1
2
3
4
5
6
7
需要安装的插件
Nginx
PHP 8.2 with OPcache
扩展安装:ioncube、fileinfo、redis
MariaDB 10.11
Redis 7.0
phpMyAdmin

SSL证书

1
2
cd oneinstack 
./vhost.sh
1
2
3
4
5
# 进入此目录/usr/local/php/etc,双击打开php.ini
# 删除 disable_functions 中的 proc_open, proc_get_status

# 重启PHP服务
service php-fpm restart

进入网站根目录并安装源码

网站根目录:/data/wwwroot/你的域名

1
cd /data/wwwroot/你的域名

输入安装命令
这里的 2023.5 代表的是 SSPanel UIM 的版本,你可以在 Release 页面中查看当前的最新稳定版本或者是输入 dev 使用开发版。请注意,dev 分支可能在使用过程中出现不可预知的问题。

1
2
3
4
git clone -b 2023.6 https://github.com/Anankke/SSPanel-Uim.git .
wget https://getcomposer.org/installer -O composer.phar
php composer.phar
php composer.phar install --no-dev

设置站点运行目录和伪静态

进入此目录:/usr/local/nginx/conf/vhost,双击打开:你的域名.conf文件
在root /data/wwwroot/你的域名 后面添加/public
添加伪静态

1
2
3
location / {
try_files $uri /index.php$is_args$args;
}

重启nginx

1
systemctl restart nginx

设置站点根目录整体权限

1
2
chmod -R 755 /data/wwwroot/你的域名
chown -R www:www /data/wwwroot/你的域名

8、创建数据库和对应的用户(注意:这步强烈建议使用非root用户并且限制该用户仅可访问对应的网站数据库。)

登录网址:http://服务器IP/phpMyAdmin
9、编辑网站配置文件

复制并重名这两个文件

1
2
cp config/.config.example.php config/.config.php
cp config/appprofile.example.php config/appprofile.php

进入此目录:/data/wwwroot/你的域名/config,双击打开.config.php,然后输入前面创建的数据库名和密码
10、执行如下站点初始化设置

1
2
3
4
php xcat Migration new
php xcat Tool importAllSettings
php xcat Tool createAdmin
sudo -u www /usr/local/php/bin/php xcat ClientDownload

11、设置定时任务

输入crontab -e指令,然后添加以下定时任务
*/5 * * * * /usr/local/php/bin/php /data/wwwroot/你的域名/xcat Cron

12、删除或者改名位于 /data/wwwroot/dafault 下的 phpMyAdmin 文件夹

rm -rf /data/wwwroot/default/phpMyAdmin

13、升级

1
2
3
# bash update.sh release [release version] [database version]
cd /data/wwwroot/sspanel.lmzxtek.free.hr
bash update.sh release