servers:bsd:nginx:joomla
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| servers:bsd:nginx:joomla [2025/05/16 23:00] – sass and cypress don't support freebsd Sean Rhone | servers:bsd:nginx:joomla [2026/02/21 22:55] (current) – Sean Rhone | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Information ====== | ||
| + | |||
| + | * Joomla ((https:// | ||
| + | * [[Information: | ||
| + | * https:// | ||
| + | |||
| + | * :!: Previously failed with Cypress and Sass, but they look like [[https:// | ||
| + | |||
| + | ===== Prerequisites ===== | ||
| + | |||
| + | * [[bsd: | ||
| + | * [[servers: | ||
| + | * [[servers: | ||
| + | * [[servers: | ||
| + | |||
| + | ====== Dependencies ====== | ||
| + | |||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | su - | ||
| + | |||
| + | pkg install git-lite php84-mysqli php84-composer node23 npm-node23 php84-simplexml php84-dom php84-iconv php84-sodium | ||
| + | |||
| + | ====== Download Source ====== | ||
| + | |||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | su - | ||
| + | |||
| + | git clone --branch ' | ||
| + | |||
| + | ====== Environment ====== | ||
| + | |||
| + | * https:// | ||
| + | |||
| + | ===== Composer ===== | ||
| + | |||
| + | su - | ||
| + | |||
| + | cd '/ | ||
| + | |||
| + | ===== Node.js ===== | ||
| + | |||
| + | su - | ||
| + | |||
| + | cd '/ | ||
| + | |||
| + | ====== Databases ====== | ||
| + | |||
| + | mariadb -u ' | ||
| + | |||
| + | CREATE DATABASE joomla_db; | ||
| + | |||
| + | CREATE USER ' | ||
| + | |||
| + | GRANT ALL PRIVILEGES ON joomla_db.* to ' | ||
| + | |||
| + | FLUSH PRIVILEGES; | ||
| + | |||
| + | EXIT | ||
| + | |||
| + | ====== nginx + PHP-FPM Configuration ====== | ||
| + | |||
| + | ===== PHP-FPM Socket ===== | ||
| + | |||
| + | su - | ||
| + | |||
| + | ee '/ | ||
| + | |||
| + | < | ||
| + | [main] | ||
| + | |||
| + | ; User/Group | ||
| + | user = www | ||
| + | group = www | ||
| + | |||
| + | ; Socket | ||
| + | listen = 127.0.0.1: | ||
| + | listen.allowed_clients = 127.0.0.1 | ||
| + | |||
| + | ; Process Management | ||
| + | pm = ondemand | ||
| + | pm.max_children = 4 | ||
| + | pm.process_idle_timeout = 30 | ||
| + | |||
| + | ; General | ||
| + | php_value[date.timezone] = " | ||
| + | |||
| + | ; End</ | ||
| + | |||
| + | ===== FastCGI ===== | ||
| + | |||
| + | su - | ||
| + | |||
| + | ee '/ | ||
| + | |||
| + | < | ||
| + | # PHP-FPM | ||
| + | location ~ \.(php|phar)(/ | ||
| + | fastcgi_split_path_info ^(.+\.(?: | ||
| + | fastcgi_intercept_errors on; | ||
| + | fastcgi_index index.php; | ||
| + | include 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: | ||
| + | } | ||
| + | |||
| + | # End</ | ||
| + | |||
| + | ===== Server Block ===== | ||
| + | |||
| + | su - | ||
| + | |||
| + | ee '/ | ||
| + | |||
| + | < | ||
| + | server { | ||
| + | listen 443 ssl; | ||
| + | # http2 on; | ||
| + | server_name ' | ||
| + | root '/ | ||
| + | index ' | ||
| + | |||
| + | include '/ | ||
| + | include '/ | ||
| + | |||
| + | client_max_body_size ' | ||
| + | |||
| + | # add_header Content-Security-Policy " | ||
| + | |||
| + | # access_log | ||
| + | # error_log | ||
| + | |||
| + | location /api/ { | ||
| + | try_files $uri $uri/ / | ||
| + | } | ||
| + | |||
| + | location / { | ||
| + | try_files $uri $uri/ / | ||
| + | } | ||
| + | |||
| + | location ~* / | ||
| + | return 403; | ||
| + | error_page 403 / | ||
| + | } | ||
| + | |||
| + | location ~* \.(ico|pdf|flv)$ { | ||
| + | expires 1y; | ||
| + | } | ||
| + | |||
| + | location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ { | ||
| + | expires 14d; | ||
| + | } | ||
| + | |||
| + | }</ | ||
| + | |||
| + | ====== Initial Setup ====== | ||
| + | |||
| + | * https:// | ||
| + | * :!: If Joomla gives a 500 error, it's likely the '' | ||
| + | |||
| + | ====== Settings ====== | ||
| + | |||
| + | ===== Purity III Template ===== | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | ==== Install ==== | ||
| + | |||
| + | * [[https:// | ||
| + | * Download **Purity III Template** and **T3 System Plugin** (:!: not 20 MB+ quickstarts; | ||
| + | |||
| + | ==== System Dashboard ==== | ||
| + | |||
| + | * Templates -> Site Template Styles | ||
| + | * Set '' | ||
| + | |||
| + | ==== Theme Settings ==== | ||
| + | |||
| + | * General -> Show T3 Logo: Off | ||
| + | |||
| + | * Theme -> Logo Type: Text | ||
| + | * Theme -> Site Name: '' | ||
| + | |||
| + | * Navigation -> Megamenu Configuration -> Animation: Fading | ||
| + | * Navigation -> Megamenu Configuration -> Duration: '' | ||
| + | |||
| + | * Add-ons -> Off-canvas Sidebar -> Enable: Off | ||
| + | |||
| + | * Assignment -> Toggle Selection | ||
| + | |||
| + | ==== Footer ==== | ||
| + | |||
| + | === Copyright === | ||
| + | |||
| + | * Last tested: 2024/02/01 on Joomla 5.1.0-dev, T3 Framework 3.2.0, and Purity III 2.1.0 | ||
| + | |||
| + | == Logo == | ||
| + | |||
| + | **** | ||
| + | |||
| + | wget -O '/ | ||
| + | |||
| + | == Text == | ||
| + | |||
| + | * Place text within the ''< | ||
| + | * Remove '' | ||
| + | |||
| + | sudo -e '/ | ||
| + | |||
| + | < | ||
| + | < | ||
| + | <img src=" | ||
| + | </ | ||
| + | |||
| + | ==== 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 ([[https:// | ||
| + | * 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 '/ | ||
| + | |||
| + | < | ||
| + | html, | ||
| + | |||
| + | body { | ||
| + | height: 100%; | ||
| + | } | ||
| + | |||
| + | a { | ||
| + | color: #3D8BFF; | ||
| + | } | ||
| + | |||
| + | a:hover { | ||
| + | color: #196BE4; | ||
| + | } | ||
| + | |||
| + | .t3-mainnav { | ||
| + | background-color: | ||
| + | } | ||
| + | |||
| + | .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: | ||
| + | color: #FFFFFF; | ||
| + | } | ||
| + | |||
| + | .t3-copyright { | ||
| + | padding-top: | ||
| + | padding-bottom: | ||
| + | }</ | ||
| + | |||
| + | ===== Articles ===== | ||
| + | |||
| + | ==== Home ==== | ||
| + | |||
| + | * Toggle Editor for raw-HTML paste | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | <!-- End --></ | ||
| + | |||
| + | === Temp === | ||
| + | |||
| + | **** | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | <!-- End --></ | ||
| + | |||
| + | ===== Offline Message ===== | ||
| + | |||
| + | < | ||
| + | This site is being built behind-the-scenes, | ||
| + | <br /> | ||
| + | In the meantime, check out my wiki: <a href=" | ||
| + | |||
| + | ===== Menus ===== | ||
| + | |||
| + | * Main menu headers are: System Links -> URL -> ''#'' | ||
| + | * Icon sizes are 24x24 | ||
| + | * Menu entries should be named normally before saving for a proper '' | ||
| + | |||
| + | ===== Global Configuration ===== | ||
| + | |||
| + | ==== Site Meta Description ==== | ||
| + | |||
| + | **** | ||
| + | |||
| + | < | ||
| + | Realm of Espionage is my creative space, and the umbrella name I provide my services under. RoE is self-hosted, | ||
| + | |||
| + | ==== 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 Hits: Hide | ||
| + | |||
| + | ==== Menu ==== | ||
| + | |||
| + | * Menus -> Main Menu -> Home -> Link Type -> Display in Menu: No | ||
| + | * Menus -> Main Menu -> Home -> Page Display -> Show Page Heading: Hide | ||
| + | |||
| + | ====== Services ====== | ||
| + | |||
| + | ===== Updater ===== | ||
| + | |||
| + | ==== Service ==== | ||
| + | |||
| + | * 2023/09/12: TODO: SELinux prevents various actions with '' | ||
| + | * '' | ||
| + | |||
| + | sudo -e '/ | ||
| + | |||
| + | < | ||
| + | [Service] | ||
| + | User=nginx | ||
| + | Group=nginx | ||
| + | Type=oneshot | ||
| + | WorkingDirectory=/ | ||
| + | Environment=" | ||
| + | ExecStart='/ | ||
| + | ExecStart='/ | ||
| + | # | ||
| + | # | ||
| + | ExecStartPost='/ | ||
| + | |||
| + | ==== Timer ==== | ||
| + | |||
| + | * Every day at '' | ||
| + | |||
| + | sudo -e '/ | ||
| + | |||
| + | < | ||
| + | [Unit] | ||
| + | Description=Joomla Git Updater | ||
| + | After=network-online.target | ||
| + | Wants=network-online.target | ||
| + | |||
| + | [Timer] | ||
| + | OnCalendar=*-*-* 02:00:00 | ||
| + | Persistent=true | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=timers.target</ | ||
| + | |||
| + | ===== Maintenance ===== | ||
| + | |||
| + | ==== Service ==== | ||
| + | |||
| + | sudo -e '/ | ||
| + | |||
| + | < | ||
| + | [Service] | ||
| + | User=nginx | ||
| + | Group=nginx | ||
| + | Type=oneshot | ||
| + | ExecStart='/ | ||
| + | ExecStart='/ | ||
| + | ExecStartPost='/ | ||
| + | |||
| + | ==== Timer ==== | ||
| + | |||
| + | * '' | ||
| + | |||
| + | sudo -e '/ | ||
| + | |||
| + | < | ||
| + | [Unit] | ||
| + | Description=Joomla Maintenance | ||
| + | After=network-online.target | ||
| + | Wants=network-online.target | ||
| + | |||
| + | [Timer] | ||
| + | OnCalendar=*-*-01 02:20:00 | ||
| + | Persistent=true | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=timers.target</ | ||
| + | |||
| + | ===== Backup ===== | ||
| + | |||
| + | ==== Files ==== | ||
| + | |||
| + | === Service === | ||
| + | |||
| + | * The extra '' | ||
| + | |||
| + | mkdir -p ~/' | ||
| + | |||
| + | < | ||
| + | [Service] | ||
| + | Type=oneshot | ||
| + | WorkingDirectory=/ | ||
| + | ExecStart='/ | ||
| + | # | ||
| + | ExecStartPost='/ | ||
| + | |||
| + | === Timer === | ||
| + | |||
| + | * '' | ||
| + | |||
| + | sudo -e '/ | ||
| + | |||
| + | < | ||
| + | [Unit] | ||
| + | Description=Joomla Files Backup | ||
| + | |||
| + | [Timer] | ||
| + | OnCalendar=*-*-01 02:35:00 | ||
| + | Persistent=true | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=timers.target</ | ||
| + | |||
| + | ==== Database ==== | ||
| + | |||
| + | === Database Auth === | ||
| + | |||
| + | sudo mkdir -p '/ | ||
| + | |||
| + | < | ||
| + | [mariadb-dump] | ||
| + | user=joomla | ||
| + | password=x</ | ||
| + | |||
| + | === Service === | ||
| + | |||
| + | mkdir -p ~/' | ||
| + | |||
| + | < | ||
| + | [Service] | ||
| + | Type=oneshot | ||
| + | WorkingDirectory=/ | ||
| + | ExecStartPre='/ | ||
| + | ExecStart='/ | ||
| + | ExecStart='/ | ||
| + | ExecStartPost='/ | ||
| + | |||
| + | === Timer === | ||
| + | |||
| + | * Every day at '' | ||
| + | |||
| + | sudo -e '/ | ||
| + | |||
| + | < | ||
| + | [Unit] | ||
| + | Description=Joomla Database Backup | ||
| + | After=mariadb.service | ||
| + | |||
| + | [Timer] | ||
| + | OnCalendar=*-*-* 02:45:00 | ||
| + | Persistent=true | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=timers.target</ | ||
| + | |||
| + | ====== Backup ====== | ||
| + | |||
| + | * Create backup archive on server and transfer to client computer | ||
| + | |||
| + | ===== Server ===== | ||
| + | |||
| + | ==== Stop Services ==== | ||
| + | |||
| + | **** | ||
| + | |||
| + | sudo systemctl stop nginx php-fpm | ||
| + | |||
| + | ==== Backup Folder ==== | ||
| + | |||
| + | **** | ||
| + | |||
| + | cd '/ | ||
| + | |||
| + | ==== Backup Database ==== | ||
| + | |||
| + | * TODO: Looks redundant to use the '' | ||
| + | |||
| + | sudo mariadb-dump --defaults-extra-file='/ | ||
| + | |||
| + | ==== Start Services ==== | ||
| + | |||
| + | **** | ||
| + | |||
| + | sudo systemctl start nginx php-fpm | ||
| + | |||
| + | ===== Client ===== | ||
| + | |||
| + | ==== Transfer Files To Client ==== | ||
| + | |||
| + | **** | ||
| + | |||
| + | scp espionage724@192.168.1.152: | ||
| + | |||
| + | ====== Restore ====== | ||
| + | |||
| + | ===== Client ===== | ||
| + | |||
| + | ==== Uncompress Database ==== | ||
| + | |||
| + | * This is only needed if restoring an **automated** database backup ((manual doesn' | ||
| + | |||
| + | gunzip ~/' | ||
| + | |||
| + | ==== Transfer Files To Server ==== | ||
| + | |||
| + | **** | ||
| + | |||
| + | scp ~/' | ||
| + | |||
| + | ==== Remove Files ==== | ||
| + | |||
| + | **** | ||
| + | |||
| + | rm -f ~/' | ||
| + | |||
| + | ===== Server ===== | ||
| + | |||
| + | ==== Stop Services ==== | ||
| + | |||
| + | **** | ||
| + | |||
| + | sudo systemctl stop nginx php-fpm | ||
| + | |||
| + | ==== Restore Joomla Folder ==== | ||
| + | |||
| + | **** | ||
| + | |||
| + | cd '/ | ||
| + | |||
| + | ==== Database ==== | ||
| + | |||
| + | * '' | ||
| + | |||
| + | mariadb --user=' | ||
| + | |||
| + | mariadb --user=' | ||
| + | |||
| + | mariadb --user=' | ||
| + | | ||
| + | ==== Reapply Permissions ==== | ||
| + | |||
| + | mariadb -u ' | ||
| + | |||
| + | GRANT ALL PRIVILEGES ON joomla_db.* to ' | ||
| + | |||
| + | FLUSH PRIVILEGES; | ||
| + | |||
| + | EXIT | ||
| + | |||
| + | ==== Start Services ==== | ||
| + | |||
| + | **** | ||
| + | |||
| + | sudo systemctl start nginx php-fpm | ||
| + | |||
| + | ==== Remove Backups ==== | ||
| + | |||
| + | * Verify that Joomla works before running | ||
| + | |||
| + | rm ~/' | ||
/usr/local/www/wiki/data/attic/servers/bsd/nginx/joomla.1747450828.txt.gz · Last modified: by Sean Rhone
