AirBlog

  • 首页
  • 技术杂谈
  • 资源分享
  • 学习笔记
  • MikuTools
  • 公告
    • 开张篇
AirTed的博客~
一个小小的博客,记录着大大的梦想
  1. 首页
  2. 技术杂谈
  3. SSPanel
  4. 正文

[转]飞机场日记(2)

2021年9月7日 1448点热度 2人点赞 0条评论

懂的都懂,就不详细说明了。

0x00 SSPanel-Uim 前端详细搭建过程

原文:https://www.jianshu.com/p/106cbf601f87

一、准备工作

系统:Centos7、最少需要1G内存;
环境:PHP7.1以上、MySQL5.5以上,建议直接用lnmp1.6;
域名:必备,本地测试可以忽略;
软件:xhell;
时区:如果你国外的VPS请先设置好系统的时区为上海;

timedatectl set-timezone Asia/Shanghai     #更改时区

二、基础工具安装

yum -y install vim git wget screen zip unzip

以上工具安装好后,使用screen创建一个窗口安装lnmp1.6,如果在root目录这步跳过

ls
cd root
screen -S LNMP

开始安装lnmpP1.6LNMP1.6的安装教程请去lnmp官方更详细的

wget http://soft.vpser.net/lnmp/lnmp1.6.tar.gz -cO lnmp1.6.tar.gz && tar zxf lnmp1.6.tar.gz && cd lnmp1.6 && ./install.sh lnmp

lnmp1.6 mysql php配置
(配置选项:2,123456,Y,9,1)

开始安装lnmp

lnmp安装成功后如下图

lnmp安装成功后

(这里容易出现bug,如果出现,请移步最后面)


三、添加网站

cd /root/lnmp1.6
lnmp vhost add

(配置选项:<域名>,回车,<网站根目录>,n,y,n)

网站创建成功


四、修改配置

修改PHP配置

vim /usr/local/php/etc/php.ini

在php.ini中查找proc_找到disable_functions把里面的system, proc_open, proc_get_status删除。

修改PHP配置

修改Nginx配置

vim /usr/local/nginx/conf/fastcgi.conf

把最后一行fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";删除或者注释掉。
(有时候要是在装lnmp时多次装不成功时,这行fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";可能会出现多次,都注释掉就可。)

修改Nginx配置

Nginx网站配置,域名的Nginx配置,把ss.test.com替换为你的域名,配置文件的路径是:/usr/local/nginx/conf/vhost/

vim /usr/local/nginx/conf/vhost/ss.test.com.conf

配置伪静态在access_log off上方,在网站目录后加入/public

location / {
    try_files uri /index.phpis_args$args;
}

Nginx网站配置

配置修改完毕后重启lnmp

lnmp restart

(这里也容易出现bug。)


五、克隆源码

(最好能上外网,不然很慢。)
以下命令一行一个等待执行完后再执行下一个

cd /home/wwwroot/ss.test.com
git clone -b master https://github.com/Anankke/SSPanel-Uim.git tmp && mv tmp/.git . && rm -rf tmp && git reset --hard
wget https://getcomposer.org/installer -O composer.phar
php composer.phar
php composer.phar install
cd ../
chmod -R 755 /home/wwwroot/ss.test.com
chown -R www:www /home/wwwroot/ss.test.com

六、建立数据库

在任意一台机器上,打开浏览器,输入服务器的IP,然后就能打开PHPMyadmin新建数据库,用root账户的登陆创建一个名为sspanel的数据库

建立数据库

点击账户,创建一个sspanel的数据库用户名。注意红框内的要让这个数据库用户可以远程访问,主机名就选择任意主机

创建账户


七、导入数据库

我用mysql命令导入,也可以使用phpmyadmin来导入数据库文件

cd /home/wwwroot/ss.test.com
mysql -usspanel -p                  #mysql -u数据库用户名 -p
use sspanel                         #sue 数据库名
source sql/glzjin_all.sql           #source 要导入的数据库文件路径
exit                                #exit 退出mysql

八、配置数据库

cd /home/wwwroot/ss.test.com
cp config/.config.example.php config/.config.php
vim config/.config.php

配置一下5项数据库信息即可,后续再详细研究配置

$System_Config['db_driver'] = 'mysql';                             //数据库程序
$System_Config['db_host'] = 'localhost';                           //数据库地址
$System_Config['db_database'] = 'sspanel';                         //数据库名
$System_Config['db_username'] = 'sspanel';                         //数据库用户名
$System_Config['db_password'] = '123456';                          //用户名对应的密码

(这个数据库、数据库用户名和密码要对应好)


九、创建账号

以下命令一行一条等待上一条执行完毕再执行下一条,注意看清楚命令执行后的提示

php xcat createAdmin # 容易报错
php xcat syncusers
php xcat initQQWry
php xcat resetTraffic
php xcat initdownload

十、计划任务

执行crontab -e入以下计划任务(按i或a进入编辑状态):

请把ss.test.com替换为自己的域名

30 22 * * * php /home/wwwroot/ss.test.com/xcat sendDiaryMail
0 0 * * * php -n /home/wwwroot/ss.test.com/xcat dailyjob
*/1 * * * * php /home/wwwroot/ss.test.com/xcat checkjob
*/1 * * * * php /home/wwwroot/ss.test.com/xcat syncnode

如需自动备份,可加入:

0 */20 * * * php -n /home/wwwroot/ss.test.com/xcat backup

如需财务报表,加入:

*/1 * * * * php /home/wwwroot/ss.test.com/xcat detectGFW

如需检测被墙,加入:

*/1 * * * * php /home/wwwroot/ss.test.com/xcat detectGFW

计划任务添加完毕后,执行以下命令来查看自动化任务的运行情况。

tail -f /var/log/cron

十一、测试

  1. 将你的域名跟服务器IP绑定在一起。
  2. 在浏览器直接属于域名,大功告成。

0x01 可能出现的Bug

启动lnmp时,出现 ERROR! MySQL server PID file could not be found

这是个数据库错误问题,可能由一下原因导致,一个一个试就行:

可能是/usr/local/mysql/data/rekfan.pid文件没有写的权限
解决方法 :给予权限,执行

chown -R mysql:mysql /var/data
chmod -R 755 /usr/local/mysql/data

然后重新启动mysqld!

可能进程里已经存在mysql进程 (常见)

解决方法:用命令ps -ef|grep mysqld查看是否有mysqld进程,如果有使用kill -9 进程号杀死,然后重新启动mysqld!

可能是第二次在机器上安装mysql,有残余数据影响了服务的启动。
解决方法:去mysql的数据目录/data看看,如果存在mysql-bin.index,就赶快把它删除掉吧,它就是罪魁祸首了。本人就是使用第三条方法解决的 !http://blog.rekfan.com/?p=186

mysql在启动时没有指定配置文件时会使用/etc/my.cnf配置文件,请打开这个文件查看在[mysqld]节下有没有指定数据目录(datadir)。
解决方法:请在[mysqld]下设置这一行:datadir = /usr/local/mysql/data

skip-federated字段问题
解决方法:检查一下/etc/my.cnf文件中有没有没被注释掉的skip-federated字段,如果有就立即注释掉吧。

错误日志目录不存在
解决方法:使用chown chmod命令赋予mysql所有者及权限

selinux惹的祸,如果是centos系统,默认会开启selinux
解决方法:关闭它,打开/etc/selinux/config,把SELINUX=enforcing改为SELINUX=disabled后存盘退出重启机器试试。


The requested package charlottedunois/yasmin could not be found in any version, there may be a typo in the package name.

具体错误如下:

Loading composer repositories with package information

Updating dependencies (including require-dev)

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package charlottedunois/yasmin could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

解决方法:composer.json 中 charlottedunois/yasmin改为laravel-discord/yasmin即可正确安装。(composer.json文件在根项目下。)


composer错误提示Cloning failed using an ssh key for authentication

具体原因是因为github的ssh密匙认证错误,提示要重新生成token,然后保存在/root/.config/composer/auth.json文件中。具体错误如下:

Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+服务器名称+2018-07-08+0803
to retrieve a token. It will be stored in "/root/.config/composer/auth.json" for future use by Composer.

解决方法:首先到https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+服务器名称+2018-07-08+0803这个地址重新生成一下token,点击regenerate,复制生成的token

composer错误提示

然后放到auth.json文件里(没有就创建,文件须有写入的权限。文件在/root/.config/composer/auth.json)

{
"github-oauth": {
        "github.com": "这里填token"}
}

保存就可以了。


Carbon 1 is deprecated, see how to migrate to Carbon 2.

具体错误:

Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
    You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

解决方法:在 composer.json 文件 require 部分,添加以下两行

"kylekatarnls/laravel-carbon-2": "^1.0.0",
"nesbot/carbon": "2.16.3 as 1.34.0"

修改完之后,再次执行composer update就可以了。


chmod: changing permissions of '/home/wwwroot/*****/.user.ini': Operation not permitted

明明是root,却不能修改文件权限。
原因:文件被锁定。
解决方法:

chattr -i /home/wwwroot/*****/.user.ini
标签: 暂无
最后更新:2022年5月3日

airted

这个世界从来不缺天才,只缺乏利用天分坚持理想和信念不断创新的人,这些人用恒心和努力缔造一个又一个传奇

点赞
< 上一篇
下一篇 >

airted

这个世界从来不缺天才,只缺乏利用天分坚持理想和信念不断创新的人,这些人用恒心和努力缔造一个又一个传奇

最新 热点 随机
最新 热点 随机
通过MinIO(Docker版) + Nginx反代 自建OSS,为自己便利提供独享网盘 [Docker]mihomo for Docker [转]利用Fake location进行步道乐跑,咕咚等校园跑刷步教程 回忆版 学习SQL Server Docker正常运行时,出现卡死问题
在树莓派中搭建 danted socks5 代理服务器 XMind让思维导图全平台化 | 拥有更高颜值 Docker使用方法 Linux搜索文件或内容 CMD 和 Git 中如何代理设置
标签聚合
文件传输 Docker Linux youtube-dl Go Python Fake Location SQL Server

又拍云logo

COPYRIGHT © 2018-2024 AIRBLOG.

Theme Kratos Made By Seaton Jiang

粤ICP备18106226号