servers:nginx:joomla
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
servers:nginx:joomla [2024/07/18 13:47] – [Files] Sean Rhone | servers:nginx:joomla [2024/08/13 22:19] (current) – removed Sean Rhone | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Information ====== | ||
- | |||
- | * Joomla ((https:// | ||
- | * :!: 5.1-dev ((https:// | ||
- | * [[Information: | ||
- | * https:// | ||
- | |||
- | ===== Prerequisites ===== | ||
- | |||
- | * [[distros: | ||
- | * [[servers: | ||
- | * [[servers: | ||
- | * [[servers: | ||
- | |||
- | ===== Notes ===== | ||
- | |||
- | * Purity III ThemeMagic is not available with Joomla 4.x ([[https:// | ||
- | |||
- | ====== Dependencies ====== | ||
- | |||
- | * https:// | ||
- | * https:// | ||
- | * https:// | ||
- | * https:// | ||
- | * :?: '' | ||
- | |||
- | sudo dnf install composer nodejs php-ldap php-mysqlnd | ||
- | |||
- | ===== Old openSUSE ===== | ||
- | |||
- | **** | ||
- | |||
- | sudo zypper install php8-sodium nodejs-common php-composer2 php8-mysql php8-fileinfo php8-ldap | ||
- | |||
- | ====== Download Source ====== | ||
- | |||
- | **** | ||
- | |||
- | sudo git clone --branch ' | ||
- | |||
- | ====== Environment ====== | ||
- | |||
- | * https:// | ||
- | |||
- | ===== Composer ===== | ||
- | |||
- | sudo su ' | ||
- | |||
- | cd '/ | ||
- | |||
- | ===== Node.js ===== | ||
- | |||
- | sudo su ' | ||
- | |||
- | cd '/ | ||
- | |||
- | ====== Database ====== | ||
- | |||
- | sudo mariadb | ||
- | |||
- | CREATE DATABASE joomla_db; | ||
- | |||
- | GRANT ALL PRIVILEGES ON joomla_db.* to ' | ||
- | |||
- | FLUSH PRIVILEGES; | ||
- | |||
- | EXIT | ||
- | |||
- | ====== nginx + PHP-FPM Configuration ====== | ||
- | |||
- | ===== PHP-FPM Socket ===== | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | [main] | ||
- | |||
- | ; User/Group | ||
- | user = nginx | ||
- | group = nginx | ||
- | |||
- | ; Socket | ||
- | listen = / | ||
- | listen.acl_users = nginx | ||
- | listen.allowed_clients = 127.0.0.1 | ||
- | |||
- | ; Process Management | ||
- | pm = ondemand | ||
- | pm.max_children = 4 | ||
- | pm.process_idle_timeout = 30 | ||
- | |||
- | ; Fedora php.ini Defaults | ||
- | php_value[session.save_handler] = " | ||
- | php_value[session.save_path] = "/ | ||
- | |||
- | ; General | ||
- | php_value[date.timezone] = " | ||
- | php_value[max_execution_time] = " | ||
- | php_value[memory_limit] = " | ||
- | php_value[post_max_size] = " | ||
- | php_value[upload_max_filesize] = " | ||
- | php_value[post_max_size] = " | ||
- | php_value[max_file_uploads] = " | ||
- | php_value[upload_tmp_dir] = "/ | ||
- | |||
- | ; End</ | ||
- | |||
- | ===== FastCGI ===== | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | # 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_pass unix:/ | ||
- | }</ | ||
- | |||
- | ===== Server Block ===== | ||
- | |||
- | * 2023/09/12: CSPs disabled; TODO: Re-figure out CSPs | ||
- | * [[https:// | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | server { | ||
- | listen ' | ||
- | http2 ' | ||
- | 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 '' | ||
- | |||
- | ==== 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 ==== | ||
- | |||
- | * The line-breaks are intentional and are there to make how it displays look nicer | ||
- | * Add links to '' | ||
- | |||
- | < | ||
- | |||
- | |||
- | Welcome! Realm of Espionage is a personal project composed of various services. All services on RoE are free and open-source, | ||
- | |||
- | |||
- | |||
- | 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. | ||
- | |||
- | </ | ||
- | |||
- | ===== 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 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 | ||
- | |||
- | ==== 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 ==== | ||
- | |||
- | **** | ||
- | |||
- | 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 '/ | ||
- | |||
- | ==== Drop Previous Database ==== | ||
- | |||
- | sudo mariadb | ||
- | |||
- | DROP DATABASE joomla_db; | ||
- | |||
- | FLUSH TABLES; | ||
- | |||
- | EXIT | ||
- | |||
- | ==== Re-create Databases ==== | ||
- | |||
- | sudo mariadb | ||
- | |||
- | CREATE DATABASE joomla_db; | ||
- | |||
- | EXIT | ||
- | |||
- | ==== Restore Database ==== | ||
- | |||
- | **** | ||
- | |||
- | sudo mariadb ' | ||
- | |||
- | ==== Reapply Permissions ==== | ||
- | |||
- | sudo mariadb | ||
- | |||
- | 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 ~/' | ||
/srv/www/wiki/data/attic/servers/nginx/joomla.1721324829.txt.gz · Last modified: (external edit)