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 [2019/06/28 21:46] – [Database] Sean Rhone | servers:nginx:joomla [2024/08/13 22:19] (current) – removed Sean Rhone | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Information ====== | ||
| - | * Joomla! ((https:// | ||
| - | * T3 Framework ((http:// | ||
| - | * Purity III ((https:// | ||
| - | * [[Information: | ||
| - | * https:// | ||
| - | |||
| - | ===== Prerequisites ===== | ||
| - | |||
| - | * [[distros: | ||
| - | * [[servers: | ||
| - | * [[servers: | ||
| - | * [[servers: | ||
| - | |||
| - | ===== Notes ===== | ||
| - | |||
| - | * Use ''#'' | ||
| - | * New Window With Navigation is needed in order to have external links open in a new tab | ||
| - | * Icons should be 16x16 when shown in Menus and Titles need to have a space before them so the icon and text aren't too close to each other | ||
| - | * Youtube' | ||
| - | * Optimizing CSS from Purity III/T3 Templates seems to cause the hamburger icon for mobile to not show | ||
| - | |||
| - | ====== Download Source ====== | ||
| - | |||
| - | **** | ||
| - | |||
| - | sudo git clone --branch ' | ||
| - | |||
| - | ===== SELinux ===== | ||
| - | |||
| - | sudo semanage fcontext --deleteall "/ | ||
| - | |||
| - | sudo semanage fcontext --add --type ' | ||
| - | |||
| - | sudo restorecon -R -v '/ | ||
| - | |||
| - | ====== Database ====== | ||
| - | |||
| - | mysql --user=' | ||
| - | |||
| - | CREATE DATABASE joomla; | ||
| - | |||
| - | GRANT ALL PRIVILEGES ON joomla.* to ' | ||
| - | |||
| - | FLUSH PRIVILEGES; | ||
| - | |||
| - | ====== nginx + PHP-FPM Configuration ====== | ||
| - | |||
| - | ===== PHP-FPM Socket ===== | ||
| - | |||
| - | sudo -e '/ | ||
| - | |||
| - | < | ||
| - | [main] | ||
| - | user = nginx | ||
| - | group = nginx | ||
| - | |||
| - | listen = / | ||
| - | listen.owner = nginx | ||
| - | listen.group = nginx | ||
| - | listen.allowed_clients = 127.0.0.1 | ||
| - | |||
| - | pm = dynamic | ||
| - | pm.max_children = 8 | ||
| - | pm.start_servers = 3 | ||
| - | pm.min_spare_servers = 2 | ||
| - | pm.max_spare_servers = 4 | ||
| - | |||
| - | php_value[date.timezone] = " | ||
| - | php_value[upload_tmp_dir] = "/ | ||
| - | |||
| - | php_value[max_execution_time] = " | ||
| - | php_value[memory_limit] = " | ||
| - | php_value[post_max_size] = " | ||
| - | php_value[upload_max_filesize] = " | ||
| - | php_value[max_file_uploads] = " | ||
| - | |||
| - | php_value[session.save_handler] = files | ||
| - | php_value[session.save_path] = / | ||
| - | php_value[soap.wsdl_cache_dir] = / | ||
| - | php_value[opcache.file_cache] = / | ||
| - | |||
| - | ===== 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 | ||
| - | fastcgi_param PATH_INFO $fastcgi_path_info; | ||
| - | fastcgi_pass unix:/ | ||
| - | }</ | ||
| - | |||
| - | ===== Server Block ===== | ||
| - | |||
| - | sudo -e '/ | ||
| - | |||
| - | < | ||
| - | server { | ||
| - | listen ' | ||
| - | server_name ' | ||
| - | root '/ | ||
| - | index ' | ||
| - | |||
| - | include '/ | ||
| - | include '/ | ||
| - | |||
| - | client_max_body_size ' | ||
| - | |||
| - | add_header Content-Security-Policy " | ||
| - | |||
| - | # access_log | ||
| - | # error_log | ||
| - | |||
| - | location / { | ||
| - | try_files $uri $uri/ / | ||
| - | } | ||
| - | |||
| - | location ~* / | ||
| - | return 403; | ||
| - | error_page 403 / | ||
| - | } | ||
| - | }</ | ||
| - | |||
| - | ====== Initial Setup ====== | ||
| - | |||
| - | * https:// | ||
| - | |||
| - | ====== Plugins ====== | ||
| - | |||
| - | ===== T3 Framework ===== | ||
| - | |||
| - | * https:// | ||
| - | |||
| - | ===== Purity III Template ===== | ||
| - | |||
| - | * https:// | ||
| - | * Requires [[servers: | ||
| - | |||
| - | * Latest known version: 1.1.8 | ||
| - | |||
| - | ====== Settings ====== | ||
| - | |||
| - | ===== 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. | ||
| - | |||
| - | ==== Site Meta Keywords ==== | ||
| - | |||
| - | **** | ||
| - | |||
| - | privacy, | ||
| - | |||
| - | ==== 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 > Page Display | ||
| - | |||
| - | * Show Page Heading: No | ||
| - | |||
| - | ===== Purity III ===== | ||
| - | |||
| - | ==== Edit Style ==== | ||
| - | |||
| - | * Show T3 Logo = Off ((if shown, it causes a 3rd-party asset to be loaded; why they didn't just include it in the theme files is beyond me)) | ||
| - | * Logo Type = Text | ||
| - | * Megamenu Animation = Fading (300ms) | ||
| - | * Off-canvas Sidebar = Off ((it doesn' | ||
| - | |||
| - | ==== Theme Magic ==== | ||
| - | |||
| - | === Brand Primary Color === | ||
| - | |||
| - | **** | ||
| - | |||
| - | #3D8BFF | ||
| - | |||
| - | === Footer Background === | ||
| - | |||
| - | **** | ||
| - | |||
| - | #484848 | ||
| - | |||
| - | === Footer Text Color === | ||
| - | |||
| - | **** | ||
| - | |||
| - | #FFFFFF | ||
| - | |||
| - | ===== Footer ===== | ||
| - | |||
| - | ==== Copyright ==== | ||
| - | |||
| - | * Requires [[servers: | ||
| - | |||
| - | === Logo === | ||
| - | |||
| - | **** | ||
| - | |||
| - | sudo -H -u ' | ||
| - | |||
| - | === Text === | ||
| - | |||
| - | * Place text within the ''< | ||
| - | * Remove '' | ||
| - | |||
| - | sudo -H -u ' | ||
| - | |||
| - | < | ||
| - | < | ||
| - | <img src=" | ||
| - | </ | ||
| - | |||
| - | === Position Fix === | ||
| - | |||
| - | * This places the footer back at the bottom of the screen instead of floating half-way up the page when little content exists | ||
| - | * This also shrinks the footer height a bit | ||
| - | * Fix adapted from https:// | ||
| - | * Requires [[servers: | ||
| - | |||
| - | sudo -H -u ' | ||
| - | |||
| - | html, | ||
| - | | ||
| - | body { | ||
| - | height: 100%; | ||
| - | } | ||
| - | | ||
| - | .t3-wrapper { | ||
| - | position: relative; | ||
| - | min-height: 100%; | ||
| - | } | ||
| - | | ||
| - | .t3-footer { | ||
| - | position: absolute; | ||
| - | bottom: 0; | ||
| - | left: 0; | ||
| - | right: 0; | ||
| - | } | ||
| - | | ||
| - | .t3-copyright { | ||
| - | padding-top: | ||
| - | padding-bottom: | ||
| - | } | ||
| - | |||
| - | ==== T3 Footer Remove ==== | ||
| - | |||
| - | * Unused currently, but may be useful if Joomla' | ||
| - | |||
| - | .t3-copyright { | ||
| - | display: none; | ||
| - | } | ||
| - | |||
| - | ===== 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. | ||
| - | |||
| - | </ | ||
| - | |||
| - | ====== Services ====== | ||
| - | |||
| - | ===== Updater ===== | ||
| - | |||
| - | ==== Service ==== | ||
| - | |||
| - | sudo -e '/ | ||
| - | |||
| - | < | ||
| - | [Service] | ||
| - | User=nginx | ||
| - | Group=nginx | ||
| - | Type=oneshot | ||
| - | ExecStart='/ | ||
| - | ExecStartPost='/ | ||
| - | |||
| - | ==== Timer ==== | ||
| - | |||
| - | * Every day at '' | ||
| - | |||
| - | sudo -e '/ | ||
| - | |||
| - | < | ||
| - | [Unit] | ||
| - | Description=Joomla! Git Updater | ||
| - | After=network-online.target | ||
| - | Wants=network-online.target | ||
| - | |||
| - | [Timer] | ||
| - | OnCalendar=*-*-* 03: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 03:20:00 | ||
| - | Persistent=true | ||
| - | |||
| - | [Install] | ||
| - | WantedBy=timers.target</ | ||
| - | |||
| - | ===== Backup ===== | ||
| - | |||
| - | ==== Files ==== | ||
| - | |||
| - | === Service === | ||
| - | |||
| - | mkdir -p ~/' | ||
| - | |||
| - | < | ||
| - | [Service] | ||
| - | Type=oneshot | ||
| - | WorkingDirectory=/ | ||
| - | ExecStart='/ | ||
| - | ExecStartPost='/ | ||
| - | |||
| - | === Timer === | ||
| - | |||
| - | * '' | ||
| - | |||
| - | sudo -e '/ | ||
| - | |||
| - | < | ||
| - | [Unit] | ||
| - | Description=Joomla! Files Backup | ||
| - | |||
| - | [Timer] | ||
| - | OnCalendar=*-*-01 03:50:00 | ||
| - | Persistent=true | ||
| - | |||
| - | [Install] | ||
| - | WantedBy=timers.target</ | ||
| - | |||
| - | ==== Database ==== | ||
| - | |||
| - | === Database Auth === | ||
| - | |||
| - | sudo -u ' | ||
| - | |||
| - | < | ||
| - | [mysqldump] | ||
| - | 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=*-*-* 03:15: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 -u ' | ||
| - | |||
| - | ==== Start Services ==== | ||
| - | |||
| - | **** | ||
| - | |||
| - | sudo systemctl start nginx php-fpm | ||
| - | |||
| - | ===== Client ===== | ||
| - | |||
| - | ==== Transfer Files To Client ==== | ||
| - | |||
| - | **** | ||
| - | |||
| - | scp espionage724@192.168.1.153: | ||
| - | |||
| - | ====== 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 '/ | ||
| - | |||
| - | ==== SELinux ==== | ||
| - | |||
| - | sudo semanage fcontext --deleteall "/ | ||
| - | |||
| - | sudo semanage fcontext --add --type ' | ||
| - | |||
| - | sudo restorecon -R -v '/ | ||
| - | |||
| - | ==== Drop Previous Database ==== | ||
| - | |||
| - | mysql --user=' | ||
| - | |||
| - | DROP DATABASE joomla; | ||
| - | |||
| - | FLUSH TABLES; | ||
| - | |||
| - | ==== Re-create Databases ==== | ||
| - | |||
| - | mysql --user=' | ||
| - | |||
| - | CREATE DATABASE joomla; | ||
| - | |||
| - | ==== Restore Database ==== | ||
| - | |||
| - | **** | ||
| - | |||
| - | mysql --user=' | ||
| - | |||
| - | ==== Reapply Permissions ==== | ||
| - | |||
| - | mysql --user=' | ||
| - | |||
| - | GRANT ALL PRIVILEGES ON joomla.* to ' | ||
| - | |||
| - | FLUSH PRIVILEGES; | ||
| - | |||
| - | ==== 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.1561772764.txt.gz · Last modified: by Sean Rhone
