servers:windows:nginx:mybb
This is an old revision of the document!
Table of Contents
Information
Prerequisites
- TODO:
listen = “127.0.0.1:9006” WIP
Dependencies
Download Source
"%ProgramFiles%\Git\bin\git.exe" clone --branch "feature" --depth "1" --recurse-submodules "https://github.com/mybb/mybb.git" "%SystemDrive%\www\forum"
Database
"%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" -p
CREATE DATABASE mybb;
CREATE USER 'mybb'@'localhost' IDENTIFIED BY 'x';
GRANT ALL PRIVILEGES ON mybb.* to 'mybb'@'localhost';
FLUSH PRIVILEGES;EXIT;
Environment
PHP
"notepad.exe" "%SystemDrive%\www\php\forum.ini"
[PHP] extension_dir = ".\ext" extension = "curl" extension = "gd" extension = "intl" extension = "ldap" extension = "mbstring" extension = "mysqli" extension = "openssl" extension = "sodium" error_reporting = "~E_ALL" display_errors = "Off" [Date] date.timezone = "America/New_York" ; End
"php.exe" -c "%SystemDrive%\www\php\forum.ini" -m
nginx + PHP-CGI Configuration
PHP-CGI
"notepad.exe" "%SystemDrive%\www\nginx\default.d\forum.conf"
location "~" "\.(php)(/.*)?$" {
fastcgi_split_path_info "^(.+\.(?:php))(/.*)$";
fastcgi_intercept_errors "on";
fastcgi_index "index.php";
include "C:/www/nginx/conf/fastcgi_params";
fastcgi_param "SCRIPT_FILENAME" "$document_root$fastcgi_script_name";
fastcgi_param "PATH_INFO" "$fastcgi_path_info";
fastcgi_param "HTTPS" "on";
fastcgi_pass "127.0.0.1:9006";
}
# End
Server Block
"notepad.exe" "%SystemDrive%\www\nginx\vhosts.d\forum.conf"
server {
listen "443" "ssl";
http2 "on";
server_name "realmofespionage.xyz";
root "C:/www/main";
index "index.php";
include "C:/www/nginx/default.d/main.conf";
include "C:/www/nginx/default.d/headers.conf";
client_max_body_size "5M";
# access_log "logs/main-access.log";
# error_log "logs/main-error.log";
location "/api/" {
try_files "$uri" "$uri/" "/api/index.php?$args";
}
location "/" {
try_files "$uri" "$uri/" "/index.php?$args";
}
location "~*" "/(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$" {
return "403";
error_page "403" "/403_error.html";
}
location "~*" "\.(ico|pdf|flv)$" {
expires "1y";
}
location "~*" "\.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$" {
expires "14d";
}
}
# End
"%SystemDrive%\www\scripts\nginx\Reload.bat"
Scripts
Folder
MKDIR "%SystemDrive%\www\scripts\forum"
"explorer.exe" "%SystemDrive%\www\scripts\forum"
PHP-CGI
"notepad.exe" "%SystemDrive%\www\scripts\forum\PHP-CGI.bat"
@echo off SET "PHP_FCGI_MAX_REQUESTS=0" SET "PHP_FCGI_CHILDREN=1" START "Forum PHP-CGI" "php-cgi.exe" -b "127.0.0.1:9001" -c "%SystemDrive%\www\php\forum.ini" -q :: End
"%SystemDrive%\www\scripts\forum\PHP-CGI.bat"
Update
"notepad.exe" "%SystemDrive%\www\scripts\forum\Update.bat"
@echo off TITLE Forum Updater "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" reset --hard "origin/6.1-dev" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" pull origin "6.1-dev" --rebase :: End
"%SystemDrive%\www\scripts\forum\Update.bat"
Back-up
TODO
"notepad.exe" "%SystemDrive%\www\scripts\forum\Back-up.bat"
@echo off :: User\Downloads "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" :: NAS ::"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" :: End
"%SystemDrive%\www\scripts\forum\Back-up.bat"
Maintenance
"notepad.exe" "%SystemDrive%\www\scripts\forum\Maintenance.bat"
@echo off TITLE Forum Maintenance CALL "%SystemDrive%\www\scripts\forum\Git Fix.bat" :: End
"%SystemDrive%\www\scripts\forum\Maintenance.bat"
Git Fix
Set email for
user.email
"notepad.exe" "%SystemDrive%\www\scripts\forum\Git Fix.bat"
@echo off RMDIR /S /Q "%SystemDrive%\www\forum\.git" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" init --initial-branch="6.1-dev" "%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" commit --message="x" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" remote add "origin" "https://github.com/joomla/joomla-cms.git" "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" pull --depth "1" --recurse-submodules "origin" "6.1-dev" --rebase "%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\forum" reset --hard "origin/6.1-dev" "%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 :: End
"%SystemDrive%\www\scripts\forum\Git Fix.bat"
Shortcuts
Autostart
PHP-CGI
"explorer.exe" "%AppData%\Microsoft\Windows\Start Menu\Programs\StartUp"
"%SystemDrive%\www\scripts\forum\PHP-CGI.bat"
Forum PHP-CGI
Task Scheduler
taskschd.msc
Update
3:00:00 AMdaily
Main Update
"%SystemDrive%\www\scripts\forum\Update.bat"
Back-up
- Weekly → Recur every
1weeks onMonday 12:15:00 AMTODO
Wiki File Back-up
"%SystemDrive%\www\scripts\media\Back-up.bat"
Maintenance
- Monthly → All months → Days:
4 3:30:00 AM
Main Maintenance
"%SystemDrive%\www\scripts\forum\Maintenance.bat"
Initial Setup
Settings
robots.txt
COPY /Y "%SystemDrive%\www\main\robots.txt.dist" "%SystemDrive%\www\main\robots.txt"
Setup
- System → Setup → Global Configuration → Site → Site Offline: Enabled
- System → Setup → Global Configuration → Site → Offline Message: Use Custom Message
This site is 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>
configuration.php
"notepad.exe" "%SystemDrive%\www\main\configuration.php"
Files
Backup
"tar.exe" -czf "%UserProfile%\Downloads\mybb-files-manual-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "forum"
Database
Backup
CD "%UserProfile%\Downloads" && "%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" -p --opt -r "mybb.sql" "mybb"
Restore
"%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" -p --execute="CREATE DATABASE mybb"
"%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" -p "mybb" < "%UserProfile%\Downloads\mybb.sql"
/var/www/wiki/data/attic/servers/windows/nginx/mybb.1763653015.txt.gz · Last modified: by Sean Rhone
