| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| servers:linux:nginx:mybb [2025/09/11 19:16] – [Server Block] Sean Rhone | servers:linux:nginx:mybb [2025/10/30 22:30] (current) – old revision restored (2025/10/16 23:52) Sean Rhone |
|---|
| |
| * https://docs.mybb.com/1.8/install/requirements/ | * https://docs.mybb.com/1.8/install/requirements/ |
| | * https://docs.mybb.com/1.8/install/anonymous-statistics/ |
| |
| sudo zypper install php-composer2 | sudo zypper install php-composer2 |
| GRANT ALL PRIVILEGES ON mybb.* to 'mybb'@'localhost'; | GRANT ALL PRIVILEGES ON mybb.* to 'mybb'@'localhost'; |
| |
| FLUSH PRIVILEGES; | FLUSH PRIVILEGES;EXIT; |
| | |
| EXIT | |
| |
| ====== nginx + PHP-FPM Configuration ====== | ====== nginx + PHP-FPM Configuration ====== |
| |
| ===== Server Block ===== | ===== Server Block ===== |
| |
| * https://docs.mybb.com/1.8/administration/configuring-search-engine-friendly-URLs/ | |
| |
| sudo -e '/etc/nginx/vhosts.d/forum.conf' && sudo systemctl reload 'nginx' | sudo -e '/etc/nginx/vhosts.d/forum.conf' && sudo systemctl reload 'nginx' |
| # access_log /var/log/nginx/forum-access.log; | # access_log /var/log/nginx/forum-access.log; |
| # error_log /var/log/nginx/forum-error.log; | # error_log /var/log/nginx/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; | |
| } | |
| |
| } | } |
| |
| * TODO | * TODO |
| | |
| | ===== Offline Message ===== |
| | |
| | * Configuration -> Settings -> Board Online / Offline |
| | |
| | <code> |
| | These forums are being built behind-the-scenes, check back later! |
| | <br /> |
| | In the meantime, check out my wiki: <a href="https://wiki.realmofespionage.xyz/">RoE | Wiki</a> |
| | </code> |
| |
| ===== config.php ===== | ===== config.php ===== |
| |
| sudo su 'wwwrun' -s '/bin/bash' | * https://docs.mybb.com/1.8/administration/utf-8-setup/ |
| |
| nano '/srv/www/forum/inc/config.php' | sudo -e '/srv/www/forum/inc/config.php' && sudo chown -v 'wwwrun':'www' '/srv/www/forum/inc/config.php' |
| |
| <code> | <code> |
| TODO</code> | $config['database']['encoding'] = 'utf8mb4';</code> |
| |
| ====== Services ====== | ====== Services ====== |
| Group=www | Group=www |
| Type=oneshot | Type=oneshot |
| | |
| | Environment="COMPOSER_CACHE_DIR=/dev/null" |
| |
| ExecStart='/usr/bin/git' -C '/srv/www/forum' pull origin 'dev-1.9' | ExecStart='/usr/bin/git' -C '/srv/www/forum' pull origin 'dev-1.9' |
| | |
| | ExecStart='/usr/bin/composer' --working-dir='/srv/www/forum' --no-cache install --no-dev |
| |
| ExecStartPost='/usr/bin/sync' | ExecStartPost='/usr/bin/sync' |
| Type=oneshot | Type=oneshot |
| |
| | ExecStart='/usr/bin/git' -C '/srv/www/forum' reset --hard |
| ExecStart='/usr/bin/git' -C '/srv/www/forum' gc --aggressive --prune='all' | ExecStart='/usr/bin/git' -C '/srv/www/forum' gc --aggressive --prune='all' |
| ExecStart='/usr/bin/git' -C '/srv/www/forum' fsck --full --strict | ExecStart='/usr/bin/git' -C '/srv/www/forum' fsck --full --strict |
| scp ~/'Downloads/mybb-files-'*'.tar.gz' espionage724@192.168.1.152:~ | scp ~/'Downloads/mybb-files-'*'.tar.gz' espionage724@192.168.1.152:~ |
| |
| scp ~/'Downloads/mybb-database-'*'.sql' espionage724@192.168.1.152:~ | scp ~/'Downloads/mybb'*'.sql' espionage724@192.168.1.152:~ |
| |
| ===== Stop nginx ===== | ===== Stop nginx ===== |
| |
| sudo tar -xzf ~/'mybb-files-'*'.tar.gz' -C '/srv/www' 'forum' && sudo chown -R 'wwwrun':'www' '/srv/www/forum' && sudo chmod -R '0755' '/srv/www/forum' | sudo tar -xzf ~/'mybb-files-'*'.tar.gz' -C '/srv/www' 'forum' && sudo chown -R 'wwwrun':'www' '/srv/www/forum' && sudo chmod -R '0755' '/srv/www/forum' |
| | |
| | ===== Git Fix ===== |
| | |
| | * :!: Set email for ''user.email'' |
| | |
| | sudo su 'wwwrun' -s '/bin/bash' |
| | |
| | rm -Rf '/srv/www/forum/.git' |
| | |
| | git -C '/srv/www/forum' init --initial-branch='dev-1.9' |
| | |
| | git -C '/srv/www/forum' add '.' |
| | |
| | git -C '/srv/www/forum' config 'user.email' 'espionage724@x' |
| | |
| | git -C '/srv/www/forum' commit --message='x' |
| | |
| | git -C '/srv/www/forum' remote add 'origin' 'https://github.com/mybb/mybb.git' |
| | |
| | git -C '/srv/www/forum' pull --depth '1' --recurse-submodules 'origin' 'dev-1.9' --rebase |
| | |
| | git -C '/srv/www/forum' reset --hard 'origin/dev-1.9' |
| | |
| | git -C '/srv/www/forum' gc --aggressive --prune='all' |
| | |
| | git -C '/srv/www/forum' fsck --full --strict |
| | |
| | exit |
| |
| ===== Restore Database ===== | ===== Restore Database ===== |
| sudo mariadb --execute='CREATE DATABASE mybb;' | sudo mariadb --execute='CREATE DATABASE mybb;' |
| |
| sudo mariadb 'mybb' < ~/'mybb-database-'*'.sql' | sudo mariadb 'mybb' < ~/'mybb'*'.sql' |
| |
| ===== Start nginx ===== | ===== Start nginx ===== |
| **** | **** |
| |
| rm -fv ~/'mybb-files-'*'.tar.gz' ~/'mybb-database-'*'.sql' | rm -fv ~/'mybb-files-'*'.tar.gz' ~/'mybb'*'.sql' |
| |