跳转到主要内容

如何搭建自己的皮肤站并使用高大上的外置登录

想搭建自己的皮肤站并使用高大上的 authlib-injector 外置登录吗?

 

所需材料:

一台有公网的服务器,需要支持 nginx 或者 apache ,支持 PHP7.2 以上

 

1.服务器购买

如果你已经有服务器了,请跳过此步骤
你的服务器需要有公网,并且能支持 nginx 或者 apache ,支持 PHP7.2 以上

如果你的年龄小于24岁,可以到 阿里云 腾讯云 华为云 购买到一台每个月10元左右的学生服务器,配置通常在1C2G

阿里云:https://promotion.aliyun.com/ntms/act/campus2018.html
腾讯云:https://cloud.tencent.com/act/campus
华为云:https://developer.huaweicloud.com/campus?productType=KC1_1&timeType=1&regionType=1&domainItemData=

请注意,如果你的服务器在中国大陆且要使用域名,那么是需要进行备案的。

我这里使用一台 阿里云的轻量应用服务器,安装 Centos7 系统进行演示,因为上面的学生机一般都提供 Centos7

购买完成后记好你的 IP 地址和密码

2.使用SSH连接到服务器

然后下载这里你需要一款 SSH 工具,用于连接到服务器
我这里用的是 finalshell,这款工具可以很方便的管理服务器上的文件
下载地址:https://www.hostbuf.com/t/988.html

打开以后如下图

image-1594020686667.png

主机那里填入你从服务商那里拿到的 IP,如果服务商没有说明的话,端口就是22
认证方式,如果给你的是密码的话就填密码,是秘钥就填私钥
用户名:国内的一般都直接给你 root ,本教程都默认使用 root 账户进行
密码:安装服务商给的填

image-1594020320404.png

链接到服务器后,先输入下面的命令

yum install screen

#安装 screen,因为 ali 的系统没有预装

screen -S lnmp

#创建一个叫 lnmp 的窗口,防止 ssh 意外断开等

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

#运行 lnmp 一键脚本,这会直接帮你装完大部分环境

You have 11 options for your DataBase install.
1: Install MySQL 5.1.73                                                                                              |
2: Install MySQL 5.5.62 (Default)                                                                                    |
3: Install MySQL 5.6.48                                                                                              |
4: Install MySQL 5.7.30                                                                                              |
5: Install MySQL 8.0.20                                                                                              |
6: Install MariaDB 5.5.68                                                                                            |
7: Install MariaDB 10.1.45                                                                                           |
8: Install MariaDB 10.2.32                                                                                           |
9: Install MariaDB 10.3.23                                                                                           |
10: Install MariaDB 10.4.13                                                                                          |
0: DO NOT Install MySQL/MariaDB                                                                                      |
Enter your choice (1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or 0): 5                                                            |
You will install MySQL 8.0.20                                                                                        |
===========================                                                                                          |
Please setup root password of MySQL.
Please enter: mysql
MySQL root password: mysql
===========================
Do you want to enable or disable the InnoDB Storage Engine?
Default enable,Enter your choice [Y/n]: y
No input,The InnoDB Storage Engine will enable.
===========================
You have 9 options for your PHP install.
1: Install PHP 5.2.17
2: Install PHP 5.3.29
3: Install PHP 5.4.45
4: Install PHP 5.5.38
5: Install PHP 5.6.40 (Default)
6: Install PHP 7.0.33
7: Install PHP 7.1.33
8: Install PHP 7.2.31
9: Install PHP 7.3.19
10: Install PHP 7.4.7
Enter your choice (1, 2, 3, 4, 5, 6, 7, 8, 9, 10): 9
You will install PHP 7.3.19
===========================
You have 3 options for your Memory Allocator install.
1: Don't install Memory Allocator. (Default)
2: Install Jemalloc
3: Install TCMalloc
Enter your choice (1, 2 or 3): 2

#mysql 版本可以自选,安装MySQL 5.6或5.7及MariaDB 10必须1G以上内存,更高版本至少要2G内存。
#php跟着我选,blessskin4.0 不支持 php 7.4,但至少需要php 7.2。安装PHP 7及以上版本必须1G以上内存。
#
其他选项跟着我选就好了

选完以后就可以去玩游戏了,因为一般的机器配置较差,需要编译很长时间很长时间,比如一小时什么的。

============================== Check install ==============================
Checking ...
Nginx: OK
Error: MySQL install failed.
PHP: OK
PHP-FPM: OK
Sorry, Failed to install LNMP!
Please visit https://bbs.vpser.net/forum-25-1.html feedback errors and logs.
You can download /root/lnmp-install.log from your server,and upload lnmp-install.log to LNMP Forum.

#这里我选了 mysql 8 但是因为配置不足或是某些原因,安装失败了

./install.sh

重新运行安装脚本
这一次选 mysql 5.7