WoWSimpleRegistration服务的git地址:
GitHub - TrinityCore/WoWSimpleRegistration: Simple Registration page for TrinityCore/AzerothCore/AshamaneCore/CMangos
下载WoWSimpleRegistration
首先git下载:
git clone https://github.com/TrinityCore/WoWSimpleRegistration
安装nginx和php
sudo apt install nginx php php-fpm
Webmin里默认竟然没有nginx模块,很疑惑啊,难道webmin也参与制裁了?
只好手工配置吧,多少年没碰php了。
安装好了php8
写了好几次nginx的配置文件放在conf.d目录,都没有对,怒了,直接上phpmyadmin
phpmyadmin竟然也不支持nginx,怎么感觉技术都退步了?
换lnmp,发现是一大套啊。
配置nginx+php
最终配好了nginx+php,参考这篇文档:Nginx配置php留档-CSDN博客
将放入www目录,浏览主页,发现提示:Please enable GMP in your php.ini
修改
/etc/php/8.3/fpm$ sudo vi php.ini
将这句注释去掉:
extension=gmp
重启fpm服务:
sudo systemctl restart php8.3-fpm.service
再重启nginx,照旧。
再找到这个文件:
/etc/php/8.3/cli$ sudo vi php.ini
重启nginx,还是一样。
bing搜索问题,按照提示安装gmp
sudo apt install php8.3-gmp
提示:Please enable gd or gd2 in your php.ini
安装:
sudo apt install php8.3-gd
安装的过程中就提醒了重启nginx。
修改了/etc/php/8.3/cli/php.ini,将extend=gd注释去掉
现在报错:
Fatal error: Uncaught InvalidArgumentException: Unsupported PDO driver: mysql. in /var/WoWSimpleRegistration/application/vendor/catfan/medoo/src/Medoo.php:424 Stack trace: #0 /var/WoWSimpleRegistration/application/include/database.php(17): Medoo\Medoo->__construct() #1 /var/WoWSimpleRegistration/application/loader.php(84): database::db_connect() #2 /var/WoWSimpleRegistration/index.php(32): require_once('...') #3 {main} thrown in /var/WoWSimpleRegistration/application/vendor/catfan/medoo/src/Medoo.php on line 424
将这句话注释去掉:
extension=pdo_mysql
不行。
看到有很久以前的issue:Unsupported driver Exception · Issue #105 · atrauzzi/laravel-doctrine · GitHub
但不是太明白。
安装php-mysql试试:
sudo apt install php8.3-mysql
报错变了,证明解决了pdo的问题:
Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' in /var/WoWSimpleRegistration/application/vendor/catfan/medoo/src/Medoo.php:478 Stack trace: #0 /var/WoWSimpleRegistration/application/include/database.php(17): Medoo\Medoo->__construct() #1 /var/WoWSimpleRegistration/application/loader.php(84): database::db_connect() #2 /var/WoWSimpleRegistration/index.php(32): require_once('...') #3 {main} thrown in /var/WoWSimpleRegistration/application/vendor/catfan/medoo/src/Medoo.php on line 478
这个报错是因为数据库的验证失败,后来了解到用户名和密码是trinity,在 /var/WoWSimpleRegistration/application/config/config.php的文件里,修改mysql的登录用户名和密码:
$config['realmlists'] = array(
"1" => array(
'realmid' => 1, // Realm ID
'realmname' => "Realm 1", // Realm Name
'db_host' => "127.0.0.1", // MySQL Host IP
'db_port' => "3306", // MySQL Host Port
# 'db_user' => "root", // MySQL username
'db_user' => "trinity", // MySQL username
# 'db_pass' => 'root', // MySQL password
'db_pass' => 'trinity', // MySQL password
'db_name' => "characters" // Characters database name
)
);
再刷新网页,成功拉!
注册wow帐号
现在大家也来试试吧,可以注册帐号:
Simple Register
运行wow
帐号注册后,wow客户端目录里创建一个文件,参考:TrinityCore服务器的客户端设定-CSDN博客
注意:
1、里面的地址设为wow.airoot.org ,然后大家就能登录wow拉!
2、登录的时候使用用户名,不是邮箱地址。
ps,此为实验服务器,不保障服务器速度和稳定性,不保证数据安全性。
附录:
使用socket方式连接Nginx优化php-fpm性能
https://www.cnblogs.com/brady-wang/p/12361519.html