sudo git clone -b 'feature' 'https://github.com/mybb/mybb.git' '/var/www/forums' && sudo chcon -R -t 'httpd_sys_rw_content_t' '/var/www/forums' && sudo chown -R 'nginx':'nginx' '/var/www/forums' && sync
mysql -u 'root' -p
CREATE DATABASE mybb;
GRANT ALL PRIVILEGES ON mybb.* to 'mybb'@'localhost' IDENTIFIED BY 'x';
FLUSH PRIVILEGES;
sudo -e '/etc/php-fpm.d/forums.conf' && sudo systemctl reload 'php-fpm'
[forums] user = nginx group = nginx listen = /run/php-fpm/forums.sock listen.owner = nginx listen.group = nginx listen.allowed_clients = 127.0.0.1 pm = dynamic pm.max_children = 5 pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 php_admin_value[error_log] = /var/log/php-fpm/www-error.log php_admin_flag[log_errors] = on php_value[session.save_handler] = files php_value[session.save_path] = /var/lib/nginx/session
sudo -e '/etc/nginx/default.d/forums.conf'
location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; try_files $fastcgi_script_name =404; set $path_info $fastcgi_path_info; fastcgi_param PATH_INFO $path_info; include fastcgi.conf; fastcgi_intercept_errors on; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS on; fastcgi_pass unix:/run/php-fpm/forums.sock; }
sudo -e '/etc/nginx/conf.d/forums.conf' && sudo systemctl reload 'nginx'
server { listen '443' 'ssl' 'http2'; server_name 'forums.realmofespionage.xyz'; root '/var/www/forums'; index 'index.php'; include '/etc/nginx/default.d/forums.conf'; include '/etc/nginx/default.d/restrictions.conf'; #access_log /var/log/nginx/forums-access.log; #error_log /var/log/nginx/forums-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 ^/archive/index.php/forum-([0-9]+)\.html$ /archive/index.php?forum-$1.html; rewrite ^/archive/index.php/thread-([0-9]+)\.html$ /archive/index.php?thread-$1.html; rewrite ^/archive/index.php/forum-([0-9]+)-([0-9]+)\.html$ /archive/index.php?forum-$1-$2.html; rewrite ^/archive/index.php/thread-([0-9]+)-([0-9]+)\.html$ /archive/index.php?thread-$1-$2.html; } }
sudo -e '/etc/systemd/system/forums-up.service'
[Service] User=nginx Group=nginx Type=oneshot ExecStart='/usr/bin/git' -C '/var/www/forums' pull origin 'feature' ExecStart='/usr/bin/sync'
sudo -e '/etc/systemd/system/forums-up.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'forums-up.timer' --now && sudo systemctl start 'forums-up' && sudo systemctl status 'forums-up' -l
[Unit] Description=MyBB Git Updater After=network-online.target Wants=network-online.target [Timer] OnCalendar=*-*-* 01:55:00 Persistent=true [Install] WantedBy=timers.target
sudo -e '/var/lib/mysqlauth/mybb' && sudo chmod '600' '/var/lib/mysqlauth/mybb'
[mysqldump] user=mybb password=x
mkdir -p ~/'backups' && sudo mkdir -p '/var/lib/mysqltmp' && sudo -e '/etc/systemd/system/forums-b.service' && sudo sed -i 's/CHANGEME/'$USER'/g' '/etc/systemd/system/forums-b.service'
[Service] Type=oneshot WorkingDirectory=/var/lib/mysqltmp ExecStart='/usr/bin/mysqldump' --defaults-extra-file='/var/lib/mysqlauth/mybb' --single-transaction 'mybb' -r '/var/lib/mysqltmp/mybb.sql' ExecStart='/usr/bin/gzip' -f '/var/lib/mysqltmp/mybb.sql' ExecStart='/usr/bin/bash' -c '"/usr/bin/mv" "/var/lib/mysqltmp/mybb.sql.gz" "/home/CHANGEME/backups/mybb-"$$(date +%%Y-%%m-%%d)".sql.gz"' ExecStart='/usr/bin/sync'
sudo -e '/etc/systemd/system/forums-b.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'forums-b.timer' --now && sudo systemctl start 'forums-b' && sudo systemctl status 'forums-b' -l
[Unit] Description=MyBB Database Backup After=mariadb.service [Timer] OnCalendar=*-*-* 02:00:00 Persistent=true [Install] WantedBy=timers.target
sudo systemctl stop nginx php-fpm
cd '/var/www' && tar -cvzf ~/'forums-manual.tar.gz' 'forums' && cd ~ && sync
mysqldump --defaults-extra-file='/var/lib/mysqlauth/mybb' --single-transaction 'mybb' -r '~/'mybb-manual.sql' && sync
sudo systemctl start nginx php-fpm
scp espionage724@192.168.1.153:~/'forums-manual.tar.gz' ~/'mybb-manual.sql' ~/'Downloads' && sync'
scp ~/'Downloads/forums-manual.tar.gz' ~/'Downloads/mybb-manual.sql' espionage724@192.168.1.153:~
rm ~/'Downloads/forums-manual.tar.gz' ~/'Downloads/mybb-manual.sql' && sync
sudo systemctl stop nginx php-fpm
sudo rm -Rf '/var/www/forums'
cd '/var/www' && sudo tar -xvzf ~/'forums-manual.tar.gz' 'forums' && sudo chcon -R -t 'httpd_sys_rw_content_t' '/var/www/forums' && sudo chown -R 'nginx':'nginx' '/var/www/forums' && cd ~ && sync
mysql -u 'root' -p
DROP DATABASE mybb;
FLUSH TABLES;
mysql -u 'root' -p
CREATE DATABASE mybb;
mysql -u 'root' -p 'mybb' < ~/'mybb-manual.sql' && sync
mysql -u 'root' -p
GRANT ALL PRIVILEGES ON mybb.* to 'mybb'@'localhost' IDENTIFIED BY 'x';
FLUSH PRIVILEGES;
sudo systemctl start nginx php-fpm
rm -R ~/'forums-manual.tar.gz' ~/'mybb-manual.sql' && sync