User Tools

Site Tools


servers:bsd: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:bsd:nginx:mybb [2026/01/09 11:18] Sean Rhoneservers:bsd:nginx:mybb [2026/01/09 17:22] (current) – [MySQL Connection] Sean Rhone
Line 1: Line 1:
 ====== Information ====== ====== Information ======
  
-  * MyBB+  * 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
Line 7: Line 7:
 ===== Prerequisites ===== ===== Prerequisites =====
  
-  * [[bsd:server:freebsd_15.0|FreeBSD 15.0]]+  * [[bsd:server:freebsd_16.0|FreeBSD 16.0]]
   * [[servers:bsd:freenginx_php_php-fpm|freenginx + PHP + PHP-FPM]]   * [[servers:bsd:freenginx_php_php-fpm|freenginx + PHP + PHP-FPM]]
-  * [[servers:bsd:nginx:lets_encrypt|Let's Encrypt]]+  * [[servers:bsd:nginx:lets_encrypt|Certbot (Let's Encrypt)]]
   * [[servers:bsd:mariadb|MariaDB]]   * [[servers:bsd:mariadb|MariaDB]]
  
Line 56: Line 56:
  
 ; User/Group ; User/Group
-user = www +user = "www" 
-group = www+group = "www"
  
 ; Socket ; Socket
-listen = 127.0.0.1:9006 +listen = "127.0.0.1:9006" 
-listen.allowed_clients = 127.0.0.1+listen.allowed_clients = "127.0.0.1"
  
 ; Process Management ; Process Management
-pm = ondemand +pm = "ondemand" 
-pm.max_children = 4 +pm.max_children = "4" 
-pm.process_idle_timeout = 30+pm.process_idle_timeout = "30"
  
-General +Logging 
-php_value[date.timezone] = "America/New_York" +php_value[log_errors] = "Off"
- +
-; Errors+
 php_value[error_reporting] = "~E_ALL" php_value[error_reporting] = "~E_ALL"
 php_value[display_errors] = "Off" php_value[display_errors] = "Off"
 +php_value[display_startup_errors] = "Off"
 +php_value[html_errors] = "Off"
 +
 +; General
 +php_value[date.timezone] = "America/New_York"
  
 ; End</code> ; End</code>
Line 84: Line 87:
  
 <code> <code>
-location ~ \.(php|phar)(/.*)?$ { +location '~' '\.(php|phar)(/.*)?$
-    fastcgi_split_path_info ^(.+\.(?:php|phar))(/.*)$; + fastcgi_split_path_info '^(.+\.(?:php|phar))(/.*)$'
-    fastcgi_intercept_errors on; + fastcgi_intercept_errors 'on'
-    fastcgi_index index.php; + fastcgi_index 'index.php'
-    include fastcgi_params; + include 'fastcgi_params'
-    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param 'SCRIPT_FILENAME' '$document_root$fastcgi_script_name'
-    fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param 'PATH_INFO' '$fastcgi_path_info'
-    fastcgi_param HTTPS on; + fastcgi_param 'HTTPS' 'on'
-    fastcgi_pass 127.0.0.1:9006;+ 
 + fastcgi_pass '127.0.0.1:9006';
 } }
  
Line 105: Line 109:
 <code> <code>
 server { server {
-    listen 443 ssl; + listen '443' 'ssl'
-    http2 on; + http2 'on'
-    server_name 'forums.realmofespionage.xyz'; + server_name 'forums.realmofespionage.xyz'; 
-    root '/usr/local/www/forum'; + root '/usr/local/www/forum'; 
-    index 'index.php';+ index 'index.php';
  
-    include '/usr/local/etc/freenginx/default.d/forum.conf'; + include '/usr/local/etc/freenginx/default.d/forum.conf'; 
-    include '/usr/local/etc/freenginx/default.d/headers.conf';+ include '/usr/local/etc/freenginx/default.d/headers.conf';
  
-    client_max_body_size '10M';+# access_log '/var/log/nginx/forum-access.log'; 
 +# error_log '/var/log/nginx/forum-error.log';
  
-#    access_log  /var/log/nginx/forum-access.log+ location '/' { 
-#    error_log  /var/log/nginx/forum-error.log;+  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 144: Line 171:
 In the meantime, check out my wiki: <a href="https://wiki.realmofespionage.xyz/">RoE | Wiki</a> In the meantime, check out my wiki: <a href="https://wiki.realmofespionage.xyz/">RoE | Wiki</a>
 </code> </code>
- 
-===== config.php ===== 
- 
-  su - 
- 
-  su -m 'www' -c "ee '/usr/local/www/forum/inc/config.php'" 
- 
-<code>$config['hide_admin_links'] = 1;</code> 
  
 ====== Scripts ====== ====== Scripts ======
Line 162: Line 181:
 #!/bin/sh #!/bin/sh
  
-su -m 'www' -c "git -C '/usr/local/www/forum' reset --hard 'origin/feature'" +cd '/tmp' 
-su -m 'www' -c "git -C '/usr/local/www/forum' pull 'origin' 'feature' --rebase"+ 
 +'/usr/bin/su-m 'www' -c "'/usr/local/bin/git-C '/usr/local/www/forum' reset --hard 'origin/feature'" 
 +'/usr/bin/su-m 'www' -c "'/usr/local/bin/git-C '/usr/local/www/forum' pull 'origin' 'feature' --rebase" 
 + 
 +'/bin/sync'
  
 # End</code> # End</code>
Line 178: Line 201:
 cd '/tmp' cd '/tmp'
  
-'/usr/bin/tar' -czf '/home/espionage724/backups/piwigo-files-auto-'$(date +%Y-%m-%d)'.tar.gz' -C '/usr/local/www' 'media'+'/usr/bin/tar' -czf '/home/espionage724/backups/mybb-files-auto-'$(date +%Y-%m-%d)'.tar.gz' -C '/usr/local/www' 'forum'
  
-'/usr/local/bin/mariadb-dump' --single-transaction --quick 'piwigo' -r '/home/espionage724/backups/piwigo-database-auto-'$(date +%Y-%m-%d)'.sql'+'/usr/local/bin/mariadb-dump' --single-transaction --quick 'mybb' -r '/home/espionage724/backups/mybb-database-auto-'$(date +%Y-%m-%d)'.sql'
  
 '/bin/sync' '/bin/sync'
Line 195: Line 218:
 #!/bin/sh #!/bin/sh
  
-su -m 'www' -c "'/usr/local/bin/git' -C '/usr/local/www/blog' gc --aggressive --prune='all'" +cd '/tmp'
-su -m 'www' -c "'/usr/local/bin/git' -C '/usr/local/www/blogfsck --full --strict"+
  
-'/usr/local/bin/mariadb-check' -----auto-repair 'wordpress'+'/usr/bin/su' -m 'www' -c "'/usr/local/bin/git' -'/usr/local/www/forum' gc --aggressive --prune='all'" 
 +'/usr/bin/su' -m 'www' -c "'/usr/local/bin/git-C '/usr/local/www/forum' fsck --full --strict"
  
 # End</code> # End</code>
Line 207: Line 230:
  
   * :!: Set email for ''user.email''   * :!: Set email for ''user.email''
-  * :!: [[#initial_setup|Initial set-up]] needs re-completed for database connection ((re-use existing details)) 
  
-  mkdir -p ~/'.local/scripts/www/blog' && ee ~/'.local/scripts/www/blog/git-fix.sh' && chmod +x ~/'.local/scripts/www/blog/git-fix.sh'+  mkdir -p ~/'.local/scripts/www/forum' && ee ~/'.local/scripts/www/forum/git-fix.sh' && chmod +x ~/'.local/scripts/www/forum/git-fix.sh'
  
 <code> <code>
 #!/bin/sh #!/bin/sh
  
-su -m 'www' -c "rm -Rf '/usr/local/www/blog/.git'" +cd '/tmp'
-su -m 'www' -c "git -C '/usr/local/www/blog' init --initial-branch='master'" +
-su -m 'www' -c "git -C '/usr/local/www/blog' add '.'"+
  
-################################################## +'/usr/bin/su' -m 'www' -c "'/bin/rm' -Rf '/usr/local/www/forum/.git'" 
-su -m 'www' -c "git -C '/usr/local/www/blogconfig 'user.email' 'espionage724@x'" +'/usr/bin/su-m 'www' -c "'/usr/local/bin/git-C '/usr/local/www/foruminit --initial-branch='feature'
-##################################################+'/usr/bin/su' -m 'www' -c "'/usr/local/bin/git' -C '/usr/local/www/forum' add '.'"
  
-su -m 'www' -c "git -C '/usr/local/www/blogcommit --message='x'"+######################################## 
 +'/usr/bin/su-m 'www' -c "'/usr/local/bin/git-C '/usr/local/www/forum' config 'user.email' 'espionage724@x'" 
 +########################################
  
-su -m 'www' -c "git -C '/usr/local/www/blog' remote add 'origin' 'https://github.com/WordPress/WordPress.git'+'/usr/bin/su-m 'www' -c "'/usr/local/bin/git' -C '/usr/local/www/forumcommit --message='x'"
-su -m 'www' -c "git -C '/usr/local/www/blogpull --depth '1--recurse-submodules 'origin' 'master' --rebase"+
  
-su -m 'www' -c "git -C '/usr/local/www/blog' reset --hard 'origin/master'" +'/usr/bin/su-m 'www' -c "'/usr/local/bin/git-C '/usr/local/www/forum' remote add 'origin' 'https://github.com/mybb/mybb.git'" 
-su -m 'www' -c "git -C '/usr/local/www/blog' gc --aggressive --prune='all'" +'/usr/bin/su' -m 'www' -c "'/usr/local/bin/git' -C '/usr/local/www/forum' pull --depth '1' --recurse-submodules 'origin' 'feature' --rebase" 
-su -m 'www' -c "git -C '/usr/local/www/blog' fsck --full --strict"+ 
 +'/usr/bin/su' -m 'www' -c "'/usr/local/bin/git' -C '/usr/local/www/forum' reset --hard 'origin/feature'" 
 +'/usr/bin/su-m 'www' -c "'/usr/local/bin/git-C '/usr/local/www/forum' gc --aggressive --prune='all'" 
 +'/usr/bin/su-m 'www' -c "'/usr/local/bin/git-C '/usr/local/www/forum' fsck --full --strict" 
 + 
 +'/bin/sync'
  
 # End</code> # End</code>
Line 295: Line 321:
 ===== Database ===== ===== Database =====
  
-****+  su -
  
-  mariadb-dump -u root -p --single-transaction --quick 'mybb' -r '/home/espionage724/mybb-database-manual-'$(date +%Y-%m-%d)'.sql'+  mariadb-dump --single-transaction --quick 'mybb' -r '/home/espionage724/mybb-database-manual-'$(date +%Y-%m-%d)'.sql'
  
 ===== scp ===== ===== scp =====
Line 315: Line 341:
 ===== Folder ===== ===== Folder =====
  
-  su -+  su
  
-  rm -Rf '/usr/local/www/forum'+  ls '/home/'$USER'/mybb-files-'*'.tar.gz' && rm -Rf '/usr/local/www/forum'
  
-  tar -xzf '/home/espionage724/mybb-files-'*'.tar.gz' -C '/usr/local/www' 'forum' && chown -R 'www':'www' '/usr/local/www/forum' && sync+  tar -xzf '/home/'$USER'/mybb-files-'*'.tar.gz' -C '/usr/local/www' 'forum' && chown -R 'www':'www' '/usr/local/www/forum' && sync
  
 ===== Database ===== ===== Database =====
Line 335: Line 361:
   su -   su -
  
-  su -m 'www' -c "ee '/usr/local/www/forum/inc/config.php'"+  su -m 'www' -c "ee '/usr/local/www/forum/inc/config.php'" && clear
  
 <code>$config['database']['hostname'] = '127.0.0.1';</code> <code>$config['database']['hostname'] = '127.0.0.1';</code>
  
/usr/local/www/wiki/data/attic/servers/bsd/nginx/mybb.1767975502.txt.gz · Last modified: by Sean Rhone

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki