User Tools

Site Tools


servers:windows:nginx:joomla

Information

Prerequisites

Dependencies

Download Source

"%ProgramFiles%\Git\bin\git.exe" clone --branch "6.1-dev" --depth "1" --recurse-submodules "https://github.com/joomla/joomla-cms.git" "%SystemDrive%\www\main"

Database

"%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root"
CREATE DATABASE joomla_db;
CREATE USER 'joomla'@'localhost' IDENTIFIED BY 'x';
GRANT ALL PRIVILEGES ON joomla_db.* to 'joomla'@'localhost';
FLUSH PRIVILEGES;EXIT;

Environment

PHP

"notepad.exe" "%SystemDrive%\www\php\main.ini"
[PHP]
extension_dir = ".\ext"
extension = "curl"
extension = "gd"
extension = "intl"
extension = "ldap"
extension = "mbstring"
extension = "mysqli"
extension = "openssl"
extension = "sodium"

log_errors = "Off"
error_reporting = "~E_ALL"
display_errors = "Off"
display_startup_errors = "Off"
html_errors = "Off"

[Date]
date.timezone = "America/New_York"

; End
"php.exe" -c "%SystemDrive%\www\php\main.ini" -m

Composer

MKDIR "%SystemDrive%\www\ext" & DEL /Q "%SystemDrive%\www\ext\composer.phar" & "curl.exe" --output "%SystemDrive%\www\ext\composer.phar" --location "https://github.com/composer/composer/releases/latest/download/composer.phar"
"php.exe" -c "%SystemDrive%\www\php\main.ini" "%SystemDrive%\www\ext\composer.phar" --version
CD "%SystemDrive%\www\main" && "php.exe" -c "%SystemDrive%\www\php\main.ini" "%SystemDrive%\www\ext\composer.phar" install --no-dev

Node.js

CD "%SystemDrive%\www\main" && "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" --prefix "%SystemDrive%\www\main" "ci" --verbose

nginx + PHP-CGI Configuration

PHP-CGI

"notepad.exe" "%SystemDrive%\www\nginx\default.d\main.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:9001";
}

# End

Server Block

"notepad.exe" "%SystemDrive%\www\nginx\vhosts.d\main.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";

# 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

MKDIR "%SystemDrive%\www\scripts\main"
"explorer.exe" "%SystemDrive%\www\scripts\main"

PHP-CGI

"notepad.exe" "%SystemDrive%\www\scripts\main\PHP-CGI.bat"
@echo off

CD "%Temp%"

SET "PHP_FCGI_MAX_REQUESTS=0"
SET "PHP_FCGI_CHILDREN=1"

START "Main PHP-CGI" /MIN "php-cgi.exe" -b "127.0.0.1:9001" -c "%SystemDrive%\www\php\main.ini" -q

SET "PHP_FCGI_MAX_REQUESTS="
SET "PHP_FCGI_CHILDREN="

:: End
"%SystemDrive%\www\scripts\main\PHP-CGI.bat"

Update

"notepad.exe" "%SystemDrive%\www\scripts\main\Update.bat"
@echo off

TITLE Main Updater
CD "%Temp%"

"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" reset --hard "origin/6.1-dev"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" pull origin "6.1-dev" --rebase

DEL /Q "%Temp%\composer.phar"
"curl.exe" --output "%Temp%\composer.phar" --location "https://github.com/composer/composer/releases/latest/download/composer.phar" --progress-bar
DEL /Q "%SystemDrive%\www\ext\composer.phar"
MOVE /Y "%Temp%\composer.phar" "%SystemDrive%\www\ext\composer.phar"
"php.exe" -c "%SystemDrive%\www\php\main.ini" "%SystemDrive%\www\ext\composer.phar" install --no-dev --working-dir="%SystemDrive%\www\main"

"%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" --prefix "%SystemDrive%\www\main" "ci"

DEL /Q "%SystemDrive%\www\main\administrator\cache\autoload_psr4.php"

:: End
"%SystemDrive%\www\scripts\main\Update.bat"

Back-up

"notepad.exe" "%SystemDrive%\www\scripts\main\Back-up.bat"
@echo off

TITLE Main Back-up
CD "%Temp%"

"tar.exe" -czf "D:\Servers\Scheduled Backups\joomla-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "main"
"%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "D:\Servers\Scheduled Backups\%RANDOM%-joomla.sql" "joomla_db"

::"tar.exe" -czf "%UserProfile%\Downloads\joomla-files-auto-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "main"
::"%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "%UserProfile%\Downloads\%RANDOM%-joomla.sql" "joomla_db"

:: End
"%SystemDrive%\www\scripts\main\Back-up.bat"

Maintenance

"notepad.exe" "%SystemDrive%\www\scripts\main\Maintenance.bat"
@echo off

TITLE Main Maintenance
CD "%Temp%"

"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" gc --aggressive --prune="all"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" fsck --full --strict

DEL /Q "%SystemDrive%\www\ext\composer.phar"
"curl.exe" --output "%SystemDrive%\www\ext\composer.phar" --location "https://github.com/composer/composer/releases/latest/download/composer.phar"

:: End
"%SystemDrive%\www\scripts\main\Maintenance.bat"

Git Fix

  • :!: Set user.email
"notepad.exe" "%SystemDrive%\www\scripts\main\Git Fix.bat"
@echo off

TITLE Main Git Fix
CD "%Temp%"

::##################
::# Joomla
::##################

RMDIR /S /Q "%SystemDrive%\www\main\.git"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" init --initial-branch="6.1-dev"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" add "."

::######################################
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" config "user.email" "espionage724@x"
::######################################

"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" commit --message="x"

"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" remote add "origin" "https://github.com/joomla/joomla-cms.git"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" pull --depth "1" --recurse-submodules "origin" "6.1-dev" --rebase

"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" reset --hard "origin/6.1-dev"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" gc --aggressive --prune="all"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" fsck --full --strict

:: End
"%SystemDrive%\www\scripts\main\Git Fix.bat"

Task Scheduler

PHP-CGI

  • Auto-start
SCHTASKS /Create /SC "ONLOGON" /TN "Main PHP-CGI" /TR "%SystemDrive%\www\scripts\main\PHP-CGI.bat" /F

Update

  • Daily 03:00:00 AM
SCHTASKS /Create /SC "DAILY" /TN "Main Update" /TR "%SystemDrive%\www\scripts\main\Update.bat" /ST "03:00" /F

Back-up

  • Monthly (4th) 03:10:00 AM
SCHTASKS /Create /SC "MONTHLY" /D "4" /M "*" /TN "Main Back-up" /TR "%SystemDrive%\www\scripts\main\Back-up.bat" /ST "03:10" /F

Maintenance

  • Monthly (4th) 03:30:00 AM
SCHTASKS /Create /SC "MONTHLY" /D "4" /M "*" /TN "Main Maintenance" /TR "%SystemDrive%\www\scripts\main\Maintenance.bat" /ST "03:30" /F

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>

Templates

  • System → Templates → Site Template Styles → Cassiopeia Extended - Default: [x]
  • Content → Site Modules → Main Menu → Position: menu
  • Content → Site Modules → New → Custom → Position: footer

Cassiopeia Extended

  • [x] Brand
  • Title (alternative to logo): Realm of Espionage
  • Layout: Fluid
  • Sticky Header: Yes
  • Back-to-top Link: Yes
  • Fonts Scheme: None
  • Menu Selection: [x] Toggle All Selections

Colour

  • Header Background: 3D8BFF
  • Footer Background: 484848
  • Links Hover:
rgb(224, 224, 224)
White
  • Header Text
  • Body Background
  • Links
  • Button Primary Text
  • Button Primary Hover Text
  • Footer Text
rgb(254, 254, 254)
  • Last tested: 2024/02/01 on Joomla 5.1.0-dev, T3 Framework 3.2.0, and Purity III 2.1.0

wget -O '/tmp/cc-by-sa-40.png' 'https://licensebuttons.net/l/by-sa/4.0/80x15.png' && sudo mv '/tmp/cc-by-sa-40.png' '/var/www/main/images/cc-by-sa-40.png' && sudo chown 'nginx':'nginx' '/var/www/main/images/cc-by-sa-40.png' && sudo restorecon -F -I -R '/var/www/main/images/cc-by-sa-40.png' && sync
Text
  • Place text within the <section class=“t3-copyright”> section underneath the Bootstrap by Twitter and Font Awesome mentions
  • Remove Bootstrap by Twitter and Font Awesome mentions
sudo -e '/var/www/main/templates/purity_iii/tpls/blocks/footer.php' && sudo chown 'nginx':'nginx' '/var/www/main/templates/purity_iii/tpls/blocks/footer.php'
          <small>
            <img src="https://realmofespionage.xyz/images/cc-by-sa-40.png" width="80" height="15" /> All content and data available on Realm of Espionage is available under the <a href="https://creativecommons.org/licenses/by-sa/4.0" target="_blank">Creative Commons Attribution-ShareAlike 4.0 International</a> license.
          </small>

Custom CSS

  • :!: This shrinks the footer height, and places it back at the bottom of the screen instead of floating half-way up the page when little content exists (source 1, source 2)
  • Also replaces ThemeMagic for Brand Primary Color, Footer Background, and Footer Text Color
  • Last tested: 2024/02/01 on Joomla 5.1.0-dev, T3 Framework 3.2.0, and Purity III 2.1.0
sudo -e '/var/www/main/templates/purity_iii/css/custom.css' && sudo chown 'nginx':'nginx' '/var/www/main/templates/purity_iii/css/custom.css'
html,

body {
  height: 100%;
}

a {
  color: #3D8BFF;
}

a:hover {
  color: #196BE4;
}

.t3-mainnav {
  background-color: #3D8BFF;
}

.logo a {
  background: none;
}

.logo a:hover {
  background: #196BE4;
}

.t3-wrapper {
  position: relative;
  min-height: 100%;
}

.t3-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #484848;
  color: #FFFFFF;
}

.t3-copyright {
  padding-top: 20px;
  padding-bottom: 0px;
}

Articles

Home

  • The line-breaks are intentional and are there to make how it displays look nicer
  • Add links to RoE | Wiki and CC BY-SA 4.0 license
 
 

Welcome! Realm of Espionage is a personal project composed of various services. All services on RoE are free and open-source, self-hosted, and configured with strict security in-mind. My most prominent project currently is RoE | Wiki, a DokuWiki instance that holds my notes on all sorts of operating system, client, and server deployments, free for anyone to view and redistribute under the CC BY-SA 4.0 license.

 

This domain serves as a landing page and provides links to my most-used profiles and projects. To view them, use the navigation bar (desktop) or the ≡ hamburger icon (mobile) at the top of the screen.

 
  • Main menu headers are: System Links → URL# to allow tapping as-expected on mobile
  • Icon sizes are 24×24
  • Menu entries should be named normally before saving for a proper alias, and then add a space on the title afterwards to make it look better with the icon

Global Configuration

Site Meta Description

Realm of Espionage is a personal project composed of various self-hosted services. All services are hosted in-house under secure conditions, and notes are provided for all services under the CC-BY-SA 4.0 license.

Content Rights

Creative Commons Attribution-ShareAlike 4.0 International

Articles

  • System → Global Configuration → Articles
  • Show Title: Hide
  • Show Category: Hide
  • Show Author: Hide
  • Show Publish Date: Hide
  • Show Navigation: Hide
  • Show Print: Hide
  • Show Email: Hide
  • Show Hits: Hide
  • Menus → Main Menu → Home → Link Type → Display in Menu: No
  • Menus → Main Menu → Home → Page Display → Show Page Heading: Hide

configuration.php

"notepad.exe" "%SystemDrive%\www\main\configuration.php"
	public $dbtype = 'mysqli';
	public $host = 'localhost';
	public $user = 'joomla';
	public $password = 'x';
	public $db = 'joomla_db';

Branch Update

"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" switch -t -c "5.4-dev"
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" branch
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" reset --hard 
"%ProgramFiles%\Git\bin\git.exe" -C "%SystemDrive%\www\main" pull origin "5.4-dev" --rebase

Backup

Folder

"tar.exe" -czf "%UserProfile%\Downloads\joomla-files-manual-%RANDOM%.tar.gz" -C "%SystemDrive%\www" "main"

Database

CD "%UserProfile%\Downloads" && "%ProgramFiles%\MariaDB 12.2\bin\mariadb-dump.exe" -u "root" --opt -r "joomla.sql" "joomla_db"

Restore

Database

"%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" --execute="CREATE DATABASE joomla_db"
"%ProgramFiles%\MariaDB 12.2\bin\mariadb.exe" -u "root" "joomla_db" < "%UserProfile%\Downloads\joomla.sql"
C:/www/wiki/data/pages/servers/windows/nginx/joomla.txt · 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