Debian12+nmp+wow simple registration安裝記錄備忘
1、安裝Debian12
2、安裝mariadb-server:如果已安裝過azeroth core,已完成
3、安裝nginx:
<code>sudo apt-get update
sudo apt-get install nginx
sudo nginx-V? #檢查是否安裝帶ssl版本</code>
訪問http://ip測試連通性
4、安裝php(23年7月,Debian12使用apt-get自動安裝獲得php版本為8.2):
<code>sudo apt-get install php-{common,fpm,mysql,xml,xmlrpc,curl,gmp,gd,imagick,cli,dev,imap,mbstring,opcache,soap,zip,intl,pdo,pdo-mysql}</code>
5、配置php.ini,查詢php狀態(tài):
<code>sudo nginx -t #查詢nginx配置文件位置,實際是site-enabled/default,獲得root /var/www/html
sudo nano /etc/php/8.2/fpm/php.ini?
# 去掉extension里 curl,mysqli,curl,gmp,gd,cli,mbstring,opcache,soap,intl,pdo-mysql的注釋
sudo systemctl restart php8.2-fpm
sudo nano /var/www/html/info.php
# 添加phpinfo代碼</code>
遇到php文件被下載問題:
<code>sudo nano /etc/nginx/sites-enabled/default</code>
取消代碼注釋:
<code>location ~ \.php$ {
? ? ? ? ? ? ? ? include snippets/fastcgi-php.conf;
? ? ? ? ?
? ? ? ? ? ? ? ? # With php-fpm (or other unix sockets):
? ? ? ? ? ? ? ? fastcgi_pass unix:/run/php/php8.2-fpm.sock;
? ? ? ? ? ? ? ? # With php-cgi (or other tcp sockets):
? ? ? ? ? ? ? ? # fastcgi_pass 127.0.0.1:9000;
? ? ? ? }</code>
nginx測試、載入配置文件,重啟服務(wù):
<code>sudo nginx -t
sudo nginx -s reload
sudo systemctl restart nginx</code>
重新訪問info.php,查看extensions是否正確載入
6、安裝wow simple registration,項目:<a href="http://WoWSimpleRegistration" rel="noopener" target="_blank">WoWSimpleRegistration</a>,
由于我的azeroth core是單獨使用一個dedicated server(acore最低需要4g內(nèi)存跑起來,若全部地圖載入需要16g內(nèi)存),所以項目直接下載文件解壓縮放到/var/www/html。
7、配置wowsimplereg:
<code>cd /var/www/html/application/config/
sudo mv config.php.sample config.php
sudo nano config.php?
# 按需修改
# baseurl為web訪問網(wǎng)址
# server_core改為1
# db_auth和realmlist按實際情況填寫,以下是web服務(wù)與azeroth core裝在同服務(wù)器下,默認(rèn)情況的配置
/*=====================================================================*/
$config['db_auth_host'] = 'localhost';
$config['db_auth_port'] = '3306';
$config['db_auth_user'] = 'acore';
$config['db_auth_pass'] = 'acore';
$config['db_auth_dbname'] = 'acore_auth';
/*=====================================================================*/
$config['realmlists'] = array(
? ? "1" => array(
? ? ? ? 'realmid' => 1, // Realm ID
? ? ? ? 'realmname' => "您的realm name", // Realm Name
? ? ? ? 'db_host' => "localhost", // MySQL Host IP
? ? ? ? 'db_port' => "3306", // MySQL Host Port
? ? ? ? 'db_user' => "acore", // MySQL username
? ? ? ? 'db_pass' => 'acore', // MySQL password
? ? ? ? 'db_name' => "acore_characters" // Characters database name
? ? )</code>
訪問index.php測試配置是否正確
8、配置https:
<code>sudo nano /etc/nginx/sites-enabled/default
# 加入配置
? ? ? ? listen 443 ssl default_server;
? ? ? ? listen [::]:443 ssl default_server;
? ? ? ? server_name 您的域名;
? ? ? ? ssl_certificate? ? ? ? ?/etc/nginx/cert/cf.pem; #key地址可以隨意
? ? ? ? ssl_certificate_key? ? ?/etc/nginx/cert/cf.key;
? ? ? ? ssl_session_timeout? ? ?5m;
? ? ? ? ssl_ciphers? ? ? ? ? ? ?ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
? ? ? ? ssl_protocols? ? ? ? ? ?TLSv1 TLSv1.1 TLSv1.2;
? ? ? ? ssl_prefer_server_ciphers? ? ? ?on;</code>
重新載入nginx配置后測試連通性
9、外網(wǎng)訪問,配置服務(wù)器443端口轉(zhuǎn)發(fā)到網(wǎng)關(guān)任意端口(電信禁用80和443)
10、如需優(yōu)雅的處理外部訪問必須指定端口問題,請使用cf的ddns和origin rules功能,這里就不多說了