====== Information ======
* MyBB ((https://mybb.com/))
* [[information:realm_of_espionage|Realm of Espionage]]
* https://forums.realmofespionage.xyz
===== Prerequisites =====
* [[windows;10|Windows 10 (21H2)]]
* [[servers;windows;nginx_php_php-cgi|nginx + PHP + PHP-CGI]]
* [[servers;windows;nginx;lets_encrypt|Certbot (Let's Encrypt)]]
* [[programs;windows;git|Git]]
* [[servers;windows;mariadb|MariaDB]]
====== Dependencies ======
* https://docs.mybb.com/1.8/install/requirements/
* https://docs.mybb.com/1.8/install/anonymous-statistics/
====== Download Source ======
* https://github.com/mybb/mybb/commits/feature/
"%ProgramFiles%\Git\bin\git.exe" clone --branch "feature" --depth "1" --recurse-submodules "https://github.com/mybb/mybb.git" "%SystemDrive%\www\forum"
====== Database ======
"%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" -p
CREATE DATABASE mybb;
CREATE USER 'mybb'@'localhost' IDENTIFIED BY 'x';
GRANT ALL PRIVILEGES ON mybb.* to 'mybb'@'localhost';
FLUSH PRIVILEGES;EXIT;
====== Environment ======
===== PHP =====
"notepad.exe" "%SystemDrive%\www\php\forum.ini"
[PHP]
extension_dir = ".\ext"
extension = "mysqli"
error_reporting = "~E_ALL"
display_errors = "Off"
log_errors = "Off"
[Date]
date.timezone = "America/New_York"
; End
"php.exe" -c "%SystemDrive%\www\php\forum.ini" -m
====== nginx + PHP-CGI Configuration ======
===== PHP-CGI =====
"notepad.exe" "%SystemDrive%\www\nginx\default.d\forum.conf"
location "~" "\.(php)(/.*)?$" {
fastcgi_split_path_info "^(.+\.(?:php))(/.*)$";
fastcgi_intercept_errors "on";
fastcgi_index "index.php";
include "C:/www/nginx/conf/fastcgi_params";
fastcgi_param "SCRIPT_FILENAME" "$document_root$fastcgi_script_name";
fastcgi_param "PATH_INFO" "$fastcgi_path_info";
fastcgi_param "HTTPS" "on";
fastcgi_pass "127.0.0.1:9006";
}
# End
===== Server Block =====
"notepad.exe" "%SystemDrive%\www\nginx\vhosts.d\forum.conf"
server {
listen "443" "ssl";
http2 "on";
server_name "forums.realmofespionage.xyz";
root "C:/www/forum";
index "index.php";
include "C:/www/nginx/default.d/forum.conf";
include "C:/www/nginx/default.d/headers.conf";
# access_log "logs/forum-access.log";
# error_log "logs/forum-error.log";
}
# End
"%SystemDrive%\www\scripts\nginx\Reload.bat"
====== Scripts ======
===== Folder =====
MKDIR "%SystemDrive%\www\scripts\forum"
"explorer.exe" "%SystemDrive%\www\scripts\forum"
===== PHP-CGI =====
"notepad.exe" "%SystemDrive%\www\scripts\forum\PHP-CGI.bat"
@echo off
SET "PHP_FCGI_MAX_REQUESTS=0"
SET "PHP_FCGI_CHILDREN=1"
START "Forum PHP-CGI" /MIN "php-cgi.exe" -b "127.0.0.1:9006" -c "%SystemDrive%\www\php\forum.ini" -q
:: End
"%SystemDrive%\www\scripts\forum\PHP-CGI.bat"
===== Update =====
"notepad.exe" "%SystemDrive%\www\scripts\forum\Update.bat"
@echo off
TITLE Forum Updater
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" reset --hard "origin/feature"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" pull origin "feature" --rebase
:: End
"%SystemDrive%\www\scripts\forum\Update.bat"
===== Back-up =====
* ''D:\Servers\Scheduled Backups''
"notepad.exe" "%SystemDrive%\www\scripts\forum\Back-up.bat"
@echo off
TITLE Forum Back-up
:: User\Downloads
::"tar.exe" -czf "%UserProfile%\Downloads\mybb-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "forum"
::"%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "%UserProfile%\Downloads\%RANDOM%-mybb.sql" "mybb"
:: NAS
"tar.exe" -czf "D:\Servers\Scheduled Backups\mybb-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "forum"
"%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "D:\Servers\Scheduled Backups\%RANDOM%-mybb.sql" "mybb"
:: End
"%SystemDrive%\www\scripts\forum\Back-up.bat"
===== Maintenance =====
"notepad.exe" "%SystemDrive%\www\scripts\forum\Maintenance.bat"
@echo off
TITLE Forum Maintenance
CALL "%SystemDrive%\www\scripts\forum\Git Fix.bat"
:: End
"%SystemDrive%\www\scripts\forum\Maintenance.bat"
===== Git Fix =====
* :!: Set email for ''user.email''
"notepad.exe" "%SystemDrive%\www\scripts\forum\Git Fix.bat"
@echo off
TITLE Forum Git Fix
RMDIR /S /Q "%SystemDrive%\www\forum\.git"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" init --initial-branch="feature"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" add "."
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" config "user.email" "espionage724@x"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" commit --message="x"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" remote add "origin" "https://github.com/mybb/mybb.git"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" pull --depth "1" --recurse-submodules "origin" "feature" --rebase
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" reset --hard "origin/feature"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" gc --aggressive --prune="all"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" fsck --full --strict
:: End
"%SystemDrive%\www\scripts\forum\Git Fix.bat"
====== Shortcuts ======
===== Autostart =====
==== PHP-CGI ====
"explorer.exe" "%AppData%\Microsoft\Windows\Start Menu\Programs\StartUp"
"%SystemDrive%\www\scripts\forum\PHP-CGI.bat"
Forum PHP-CGI
====== Task Scheduler ======
****
taskschd.msc
===== Update =====
* ''5:00:00 AM'' daily
Forum Update
"%SystemDrive%\www\scripts\forum\Update.bat"
===== Back-up =====
* Monthly -> All months -> Days: ''6''
* ''5:15:00 AM''
Forum Back-up
"%SystemDrive%\www\scripts\forum\Back-up.bat"
===== Maintenance =====
* Monthly -> All months -> Days: ''6''
* ''5:30:00 AM''
Forum Maintenance
"%SystemDrive%\www\scripts\forum\Maintenance.bat"
====== Initial Setup ======
* Database Engine: ''MySQL Improved''
* Database Server Hostname: ''localhost''
* Table Encoding: ''4-Byte UTF-8 Unicode''
* https://forums.realmofespionage.xyz
====== Configuration ======
===== Board Online / Offline =====
* Board Closed: ''[x]'' Yes
These forums are being built behind-the-scenes, check back later!
In the meantime, check out my wiki: RoE | Wiki
===== Login and Registration =====
* Disable Registrations: ''[x]'' Yes
===== config.php =====
****
"notepad.exe" "%SystemDrive%\www\forum\inc\config.php"
====== Files ======
===== Backup =====
****
"tar.exe" -czf "%UserProfile%\Downloads\mybb-files-manual-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "forum"
====== Database ======
===== Backup =====
****
CD "%UserProfile%\Downloads" && "%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" -p --opt -r "mybb.sql" "mybb"
===== Restore =====
* [[#database|Initial set-up]]
"%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" -p --execute="CREATE DATABASE mybb"
"%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" -p "mybb" < "%UserProfile%\Downloads\mybb.sql"