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 [2026/01/16 10:06] – [Back-up] 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"
-log_errors = "Off"+display_startup_errors = "Off" 
 +html_errors = "Off"
  
 [Date] [Date]
Line 66: 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 76: Line 77:
  
  fastcgi_pass "127.0.0.1:9006";  fastcgi_pass "127.0.0.1:9006";
- 
 } }
  
Line 87: Line 87:
 <code> <code>
 server { server {
- 
  listen "443" "ssl";  listen "443" "ssl";
  http2 "on";  http2 "on";
Line 99: 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 120: Line 144:
 <code> <code>
 @echo off @echo off
 +
 +CD "%Temp%"
  
 SET "PHP_FCGI_MAX_REQUESTS=0" SET "PHP_FCGI_MAX_REQUESTS=0"
Line 125: Line 151:
  
 START "Forum PHP-CGI" /MIN "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 138: 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 147: Line 177:
  
 ===== Back-up ===== ===== Back-up =====
- 
-  * ''D:\Servers\Scheduled Backups'' 
  
   "notepad.exe" "%SystemDrive%\www\scripts\forum\Back-up.bat"   "notepad.exe" "%SystemDrive%\www\scripts\forum\Back-up.bat"
Line 156: Line 184:
  
 TITLE Forum Back-up TITLE Forum Back-up
 +CD "%Temp%"
  
-:: 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" "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" "%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "D:\Servers\Scheduled Backups\%RANDOM%-mybb.sql" "mybb"
 +
 +::"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"
  
 :: End</code> :: End</code>
Line 177: 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 186: 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 194: Line 223:
  
 TITLE Forum Git Fix TITLE Forum Git Fix
 +CD "%Temp%"
  
-RMDIR /S /Q "%SystemDrive%\www\forum\.git"+::################## 
 +::# MyBB 
 +::##################
  
 +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 213: 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" +  SCHTASKS /Create /SC "ONLOGON/TN "Forum PHP-CGI/TR "%SystemDrive%\www\scripts\forum\PHP-CGI.bat" /F
- +
-  "%SystemDrive%\www\scripts\forum\PHP-CGI.bat" +
- +
-  Forum PHP-CGI +
- +
-====== Task Scheduler ====== +
- +
-**** +
- +
-  taskschd.msc+
  
 ===== 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" +
- +
-  SCHTASKS /Create /SC "ONCE" /TN "Forum Update" /TR "%SystemDrive%\www\scripts\forum\Update.bat" /ST "05:00" /F+
  
 ===== Back-up ===== ===== Back-up =====
  
-  * Monthly -> All months -> Days: ''6'' +  * Monthly (6th) ''05:10:00 AM''
-  * ''5:15:00 AM''+
  
-  Forum 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\forum\Back-up.bat" +
- +
-  SCHTASKS /Create /SC "MONTHLY" /D "6" /M "*" /TN "Forum Back-up" /TR "%SystemDrive%\www\scripts\forum\Back-up.bat" /ST "05:15" /F+
  
 ===== Maintenance ===== ===== Maintenance =====
  
-  * Monthly -> All months -> Days: ''6'' +  * 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 285: 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 298: 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.1768575962.txt.gz · Last modified: by Sean Rhone