User Tools

Site Tools


servers:windows:nginx:mybb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
servers:windows:nginx:mybb [2025/11/20 19:27] – [Initial Setup] Sean Rhoneservers:windows:nginx:mybb [2026/01/20 15:20] (current) – [Git Fix] Sean Rhone
Line 2: Line 2:
  
   * MyBB ((https://mybb.com/))   * MyBB ((https://mybb.com/))
-  * [[information:realm_of_espionage|Realm of Espionage]]+  * [[information;realm_of_espionage|Realm of Espionage]]
   * https://forums.realmofespionage.xyz   * https://forums.realmofespionage.xyz
  
 ===== Prerequisites ===== ===== Prerequisites =====
  
-  * [[windows;10|Windows 10 (21H2)]]+  * [[windows;10_ltsc_server|Windows 10 (21H2)]]
   * [[servers;windows;nginx_php_php-cgi|nginx + PHP + PHP-CGI]]   * [[servers;windows;nginx_php_php-cgi|nginx + PHP + PHP-CGI]]
   * [[servers;windows;nginx;lets_encrypt|Certbot (Let's Encrypt)]]   * [[servers;windows;nginx;lets_encrypt|Certbot (Let's Encrypt)]]
Line 26: Line 26:
 ====== Database ====== ====== Database ======
  
-  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" -p+  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root"
  
   CREATE DATABASE mybb;   CREATE DATABASE mybb;
Line 47: Line 47:
 extension = "mysqli" extension = "mysqli"
  
 +log_errors = "Off"
 error_reporting = "~E_ALL" error_reporting = "~E_ALL"
 display_errors = "Off" display_errors = "Off"
 +display_startup_errors = "Off"
 +html_errors = "Off"
  
 [Date] [Date]
Line 65: Line 68:
 <code> <code>
 location "~" "\.(php)(/.*)?$" { location "~" "\.(php)(/.*)?$" {
- 
  fastcgi_split_path_info "^(.+\.(?:php))(/.*)$";  fastcgi_split_path_info "^(.+\.(?:php))(/.*)$";
  fastcgi_intercept_errors "on";  fastcgi_intercept_errors "on";
Line 75: Line 77:
  
  fastcgi_pass "127.0.0.1:9006";  fastcgi_pass "127.0.0.1:9006";
- 
 } }
  
Line 86: Line 87:
 <code> <code>
 server { server {
- 
  listen "443" "ssl";  listen "443" "ssl";
  http2 "on";  http2 "on";
Line 98: Line 98:
 # access_log "logs/forum-access.log"; # access_log "logs/forum-access.log";
 # error_log "logs/forum-error.log"; # error_log "logs/forum-error.log";
- + 
 + location "/"
 +  rewrite "^/forum-([0-9]+)\.html$" "/forumdisplay.php?fid=$1"; 
 +  rewrite "^/forum-([0-9]+)-page-([0-9]+)\.html$" "/forumdisplay.php?fid=$1&page=$2"; 
 +  rewrite "^/thread-([0-9]+)\.html$" "/showthread.php?tid=$1"; 
 +  rewrite "^/thread-([0-9]+)-page-([0-9]+)\.html$" "/showthread.php?tid=$1&page=$2"; 
 +  rewrite "^/thread-([0-9]+)-lastpost\.html$" "/showthread.php?tid=$1&action=lastpost"; 
 +  rewrite "^/thread-([0-9]+)-nextnewest\.html$" "/showthread.php?tid=$1&action=nextnewest"; 
 +  rewrite "^/thread-([0-9]+)-nextoldest\.html$" "/showthread.php?tid=$1&action=nextoldest"; 
 +  rewrite "^/thread-([0-9]+)-newpost\.html$" "/showthread.php?tid=$1&action=newpost"; 
 +  rewrite "^/thread-([0-9]+)-post-([0-9]+)\.html$" "/showthread.php?tid=$1&pid=$2"; 
 + 
 +  rewrite "^/post-([0-9]+)\.html$" "/showthread.php?pid=$1"; 
 + 
 +  rewrite "^/announcement-([0-9]+)\.html$" "/announcements.php?aid=$1"; 
 + 
 +  rewrite "^/user-([0-9]+)\.html$" "/member.php?action=profile&uid=$1"; 
 + 
 +  rewrite "^/calendar-([0-9]+)\.html$" "/calendar.php?calendar=$1"; 
 +  rewrite "^/calendar-([0-9]+)-year-([0-9]+)\.html$" "/calendar.php?action=yearview&calendar=$1&year=$2"; 
 +  rewrite "^/calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)\.html$" "/calendar.php?calendar=$1&year=$2&month=$3"; 
 +  rewrite "^/calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+)\.html$" "/calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4"; 
 +  rewrite "^/calendar-([0-9]+)-week-(n?[0-9]+)\.html$" "/calendar.php?action=weekview&calendar=$1&week=$2"; 
 + 
 +  rewrite "^/event-([0-9]+)\.html$" "/calendar.php?action=event&eid=$1"; 
 + }
 } }
  
Line 119: Line 144:
 <code> <code>
 @echo off @echo off
 +
 +CD "%Temp%"
  
 SET "PHP_FCGI_MAX_REQUESTS=0" SET "PHP_FCGI_MAX_REQUESTS=0"
 SET "PHP_FCGI_CHILDREN=1" SET "PHP_FCGI_CHILDREN=1"
  
-START "Forum PHP-CGI" "php-cgi.exe" -b "127.0.0.1:9006" -c "%SystemDrive%\www\php\forum.ini" -q+START "Forum PHP-CGI" /MIN "php-cgi.exe" -b "127.0.0.1:9006" -c "%SystemDrive%\www\php\forum.ini" -q 
 + 
 +SET "PHP_FCGI_MAX_REQUESTS=" 
 +SET "PHP_FCGI_CHILDREN="
  
 :: End</code> :: End</code>
Line 137: Line 167:
  
 TITLE Forum Updater TITLE Forum Updater
 +CD "%Temp%"
  
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" reset --hard "origin/feature" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" reset --hard "origin/feature"
Line 146: Line 177:
  
 ===== Back-up ===== ===== Back-up =====
- 
-  * :!: TODO 
  
   "notepad.exe" "%SystemDrive%\www\scripts\forum\Back-up.bat"   "notepad.exe" "%SystemDrive%\www\scripts\forum\Back-up.bat"
Line 154: Line 183:
 @echo off @echo off
  
-:: User\Downloads +TITLE Forum Back-up 
-"tar.exe" -czf "%UserProfile%\Downloads\dokuwiki-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www\wiki" "data/pages" "data/meta" "data/media" "data/media_meta" "data/attic" "data/media_attic" "conf"+CD "%Temp%" 
 + 
 +"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"
  
-:: NAS +::"tar.exe" -czf "%UserProfile%\Downloads\mybb-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "forum" 
-::"tar.exe" -czf "D:\Servers\Scheduled Backups\dokuwiki-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www\wiki" "data/pages" "data/meta" "data/media" "data/media_meta" "data/attic" "data/media_attic" "conf"+::"%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe-u "root--opt -r "%UserProfile%\Downloads\%RANDOM%-mybb.sql" "mybb"
  
 :: End</code> :: End</code>
Line 172: Line 204:
  
 TITLE Forum Maintenance TITLE Forum Maintenance
 +CD "%Temp%"
  
-CALL "%SystemDrive%\www\scripts\forum\Git Fix.bat"+"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" gc --aggressive --prune="all" 
 +"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forumfsck --full --strict
  
 :: End</code> :: End</code>
Line 181: Line 215:
 ===== Git Fix ===== ===== Git Fix =====
  
-  * :!: Set email for ''user.email''+  * :!: Set ''user.email''
  
   "notepad.exe" "%SystemDrive%\www\scripts\forum\Git Fix.bat"   "notepad.exe" "%SystemDrive%\www\scripts\forum\Git Fix.bat"
Line 187: Line 221:
 <code> <code>
 @echo off @echo off
 +
 +TITLE Forum Git Fix
 +CD "%Temp%"
 +
 +::##################
 +::# MyBB
 +::##################
  
 RMDIR /S /Q "%SystemDrive%\www\forum\.git" 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" init --initial-branch="feature"
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" add "." "%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" 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" 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" 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" 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" 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" gc --aggressive --prune="all"
 "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" fsck --full --strict "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" fsck --full --strict
Line 206: Line 250:
   "%SystemDrive%\www\scripts\forum\Git Fix.bat"   "%SystemDrive%\www\scripts\forum\Git Fix.bat"
  
-====== Shortcuts ======+====== Task Scheduler ======
  
-===== Autostart =====+===== PHP-CGI =====
  
-==== PHP-CGI ==== +  * Auto-start
- +
-  "explorer.exe" "%AppData%\Microsoft\Windows\Start Menu\Programs\StartUp" +
- +
-  "%SystemDrive%\www\scripts\forum\PHP-CGI.bat" +
- +
-  Forum PHP-CGI +
- +
-====== Task Scheduler ====== +
- +
-****+
  
-  taskschd.msc+  SCHTASKS /Create /SC "ONLOGON" /TN "Forum PHP-CGI" /TR "%SystemDrive%\www\scripts\forum\PHP-CGI.bat" /F
  
 ===== Update ===== ===== Update =====
  
-  * ''5:00:00 AM'' daily+  * Daily ''05:00:00 AM''
  
-  Forum Update +  SCHTASKS /Create /SC "DAILY" /TN "Forum Update" /TR "%SystemDrive%\www\scripts\forum\Update.bat" /ST "05:00" /F
- +
-  "%SystemDrive%\www\scripts\forum\Update.bat"+
  
 ===== Back-up ===== ===== Back-up =====
  
-  * Weekly -> Recur every ''1'' weeks on ''Monday'' +  * Monthly (6th) ''05:10:00 AM''
-  * ''12:15:00 AM'' +
-  * :!: TODO+
  
-  Wiki File Back-up +  SCHTASKS /Create /SC "MONTHLY" /D "6" /M "*" /TN "Forum Back-up" /TR "%SystemDrive%\www\scripts\forum\Back-up.bat" /ST "05:10" /F
- +
-  "%SystemDrive%\www\scripts\media\Back-up.bat"+
  
 ===== Maintenance ===== ===== Maintenance =====
  
-  * Monthly -> All months -> Days: ''5'' +  * Monthly (6th) ''05:30:00 AM''
-  * ''5:30:00 AM''+
  
-  Forum Maintenance +  SCHTASKS /Create /SC "MONTHLY" /D "6" /M "*" /TN "Forum Maintenance" /TR "%SystemDrive%\www\scripts\forum\Maintenance.bat" /ST "05:30" /F
- +
-  "%SystemDrive%\www\scripts\forum\Maintenance.bat"+
  
 ====== Initial Setup ====== ====== Initial Setup ======
Line 275: Line 300:
  
 ===== config.php ===== ===== config.php =====
- 
-**** 
  
   "notepad.exe" "%SystemDrive%\www\forum\inc\config.php"   "notepad.exe" "%SystemDrive%\www\forum\inc\config.php"
  
-====== Files ======+  $config['database']['hostname''localhost';
  
-===== Backup =====+====== Backup ====== 
 + 
 +===== Folder =====
  
 **** ****
Line 288: Line 313:
   "tar.exe" -czf "%UserProfile%\Downloads\mybb-files-manual-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "forum"   "tar.exe" -czf "%UserProfile%\Downloads\mybb-files-manual-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "forum"
  
-====== Database ======+===== Database =====
  
-===== Backup =====+****
  
-****+  CD "%UserProfile%\Downloads" && "%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "mybb.sql" "mybb"
  
-  CD "%UserProfile%\Downloads" && "%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" -p --opt -r "mybb.sql" "mybb"+====== Restore ======
  
-===== Restore =====+===== Database =====
  
   * [[#database|Initial set-up]]   * [[#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" --execute="CREATE DATABASE mybb"
  
-  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" -p "mybb" < "%UserProfile%\Downloads\mybb.sql"+  "%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" "mybb" < "%UserProfile%\Downloads\mybb.sql"
  
/usr/local/www/wiki/data/attic/servers/windows/nginx/mybb.1763684827.txt.gz · Last modified: by Sean Rhone