Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| server_configuration [2021/01/13 14:51] – created david | server_configuration [2025/04/02 09:56] (current) – [Basic Configuration] david | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | For the hosting of this wiki, my blog [[http:// | + | ====== Server Configuration |
| - | ====== Hosting Provider | + | For the hosting of this wiki, my blog [[http:// |
| + | |||
| + | Some useful notes from the first server are hidden away under [[server: | ||
| + | |||
| + | ===== Hosting Provider ===== | ||
| The host I chose to use is use [[https:// | The host I chose to use is use [[https:// | ||
| Line 11: | Line 15: | ||
| See: | See: | ||
| - | * [[server_configuration:apache]] | + | * [[server configuration:apache]] |
| - | * [[server_configuration: | + | * [[server configuration: |
| - | * [[server_configuration:email]] | + | * [[server configuration:email]] |
| + | * [[server configuration: | ||
| + | * [[server configuration: | ||
| + | * [[server configuration: | ||
| + | * [[server configuration: | ||
| + | * [[server configuration: | ||
| - | ====== Bulk To sort ====== | + | Also (for me): |
| + | * [[server configuration: | ||
| - | < | + | ====== Server Migration ====== |
| - | Aim: Create a new Ubuntu | + | The original server was an older Ubuntu |
| - | - https:// | + | |
| + | Aim: Create a new Ubuntu Instance & migrate existing droplet data (WordPress) to it: https:// | ||
| - | Alternative... might have saved me hours! | ||
| - | - https:// | ||
| + | Options were: | ||
| + | - Create a new droplet (VM) and migrate site(s) and services: | ||
| + | - DigitalOcean Community Documentation: | ||
| + | - Start from scratch, build fresh without so much history/ | ||
| + | - So time consuming! | ||
| + | - Upgrade server in place | ||
| + | - Why didn't I try this! It would have saved me a lot of time! | ||
| + | - Alternative... might have saved me hours! | ||
| + | - Didn't try | ||
| + | - Some advice suggested that the droplet might not have upgraded cleanly | ||
| + | - DigitalOcean Community Documentation: | ||
| - | IP Challenge | + | ===== Prepare for migration ===== |
| - | - https:// | + | |
| - | - https:// | + | |
| - | Setting up the new WordPress - Ubuntu 20.04 | ||
| - | - https:// | ||
| - | Introduction: | + | ==== IP Address & DNS Records ==== |
| - | - Digital Ocean - Referral link: https:// | + | |
| - | - Broad offerings | + | |
| - | - Droplets - Like AWS EC2 | + | |
| - | - Volumes | + | |
| - | - What I have (Old Ubuntu): I wanted to do it all myself | + | |
| - | - What I want to do: New Ubuntu 20.04 LTS (WordPress 5.5.1 already installed, save time) | + | |
| - | Prepare for migration | + | I wanted to migrate the PI so I didn't have to make DNS changes, and so that I could quickly and easily switch between servers. But it wasn't to be: |
| - | - DNS: 3600 seconds = 1 hour Days before migration | + | * https:// |
| - | - 60 seconds = 1 min Day of migration | + | * https:// |
| - | - 86400 seconds = 24 hours Good operational normal | + | |
| - | Get configuration | + | So instead I had to make DNS changes, pointing the names to the new IPs. First prep step is to manage the Time To Live for DNS records. My TTL recommended times: |
| - | - https:// | + | < |
| - | #System version | + | 60 seconds = 1 min : Day and Time of migration |
| + | 3600 seconds = 1 hour : Day(s) before migration | ||
| + | 86400 seconds = 24 hours : Good operational normal | ||
| + | </ | ||
| + | |||
| + | ==== Get configuration | ||
| + | |||
| + | Following advice from: | ||
| + | * DigitalOcean Community Documentation: | ||
| + | |||
| + | <code bash> | ||
| + | # System version | ||
| uname -r | uname -r | ||
| uname -m | uname -m | ||
| - | which service | + | # Services |
| - | #Services | + | |
| service --status-all | service --status-all | ||
| #Firewall | #Firewall | ||
| Line 59: | Line 77: | ||
| ufw status verbose | ufw status verbose | ||
| - | How To Secure Apache with Let's Encrypt on Ubuntu 20.04 | + | # More |
| - | - https:// | + | service |
| + | </ | ||
| - | Backup | + | ==== Backup |
| - | - Blessed are the paranoid for they test their backups | + | |
| - | Backup old Blog | + | |
| - | - Blessed are the paranoid for they test their backups | + | |
| - | Volume to transfer data (yes I can SFTP etc... between droplets/ | + | > Blessed are the paranoid for they test their backups |
| - | - Show create | + | |
| - | - Mount -- https:// | + | |
| - | - Format | + | |
| - | - Copy to backup | + | |
| - | - Unmount | + | |
| - | Create New Droplet | + | Yes I can SFTP etc... between droplets/environments, |
| - | - Point to instructions: | + | |
| - | - Install & configure | + | |
| - | Configure Droplet | + | * Backup old using a volume: [[https://www.digitalocean.com/ |
| - | - The WordPress One-Click Quickstart guide: https://do.co/34TfYn8# | + | * Mount the volume: https:// |
| - | - Rows Across The Lake | + | |
| - | SFTP | + | **What' |
| - | - SFTP: https:// | + | <code bash> |
| - | - https:// | + | sudo service |
| - | - https:// | + | sudo ufw status |
| - | - https:// | + | </code> |
| - | - WordPress backup/ | + | <code bash> |
| - | - https:// | + | ################################################################################ |
| - | - duplicator: | + | # MySQL : Backup |
| - | - https:// | + | ################################################################################ |
| - | - https:// | + | mkdir -p ~/backups/mysql_dbs |
| - | - All-in-One WP Migration | + | |
| - | - https:// | + | |
| - | - https://help.servmask.com/ | + | |
| - | - http:// | + | |
| - | - WordPress is requiring FTP credentials before installing plugin | + | # Backup databases from MySQL |
| - | - https:// | + | for DB_NAME in `echo "SHOW DATABASES;" |
| - | + | ||
| - | - https://help.servmask.com/ | + | |
| - | https://www.digitalocean.com/ | + | ll ~/backups/mysql_dbs |
| + | ################################################################################ | ||
| + | # PostgreSQL : Backup | ||
| + | # https:// | ||
| + | ################################################################################ | ||
| + | # sudo -i -u postgres psql -c " | ||
| + | # pg_dump dbname > dumpfile | ||
| + | mkdir -p ~/ | ||
| + | for DB_NAME in `sudo -i -u postgres psql -c " | ||
| - | - Mount | + | ll ~/ |
| - | - Restore files for WordPress | + | |
| - | - migrate configuration | + | ################################################################################ |
| - | - Move apache | + | # Backup Files (Digital Ocean Volume) |
| - | ll | + | ################################################################################ |
| + | |||
| + | cd / | ||
| + | |||
| + | # Suggested/ | ||
| + | sudo cp -r /home . | ||
| + | sudo cp -r /root . | ||
| + | sudo cp -r / | ||
| + | sudo cp -r /var/www . | ||
| + | sudo cp -r / | ||
| + | |||
| + | # Unmount (so it can be mounted to new host) | ||
| + | sudo umount --verbose / | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ===== New Environment ===== | ||
| + | ==== Create New Droplet ==== | ||
| + | |||
| + | === preconfigured droplet === | ||
| + | |||
| + | Saving time (haha) by using a WordPress | ||
| + | * Droplet Instructions: | ||
| + | * Install & configure: The WordPress One-Click Quickstart guide: https:// | ||
| + | |||
| + | === Build from scratch === | ||
| + | |||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | ==== Basic Configuration ==== | ||
| + | As root | ||
| + | <code bash> | ||
| + | # create a user for me | ||
| + | adduser david | ||
| + | |||
| + | # Add my user to sudo | ||
| + | groupadd david sudo | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | # Update | ||
| + | sudo apt-get update | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | # SSH Access - once user access is sorted | ||
| + | grep PermitRootLogin / | ||
| + | |||
| + | sudo vi / | ||
| + | |||
| + | # PermitRootLogin no | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== SFTP ==== | ||
| + | |||
| + | Basic SFTP was already available/ | ||
| + | ==== Firewall ==== | ||
| + | |||
| + | Worth looking at more detailed notes on my [[server_configuration: | ||
| + | |||
| + | The firewall is already configured by DigitalOcean in my choice of droplet (Ubuntu 20.04 with WordPress). However if other services are to be added (in my case yes) the [[https:// | ||
| + | |||
| + | | ||
| + | * Ubuntu Documentation: | ||
| + | |||
| + | ==== Postfix (email) ==== | ||
| + | Mostly check notes under [[server_configuration: | ||
| + | |||
| + | Migrate Old mail data (after completing step 3 from the guide [[https:// | ||
| + | <code bash> | ||
| + | ################################################################################ | ||
| + | # Email/ | ||
| + | ################################################################################ | ||
| + | cd ~/ | ||
| + | |||
| + | sudo cp -R / | ||
| + | sudo cp -R / | ||
| + | |||
| + | sudo cp -R / | ||
| + | sudo cp -R / | ||
| + | |||
| + | sudo chown -R david:david ~/. | ||
| + | |||
| + | sudo apt-get install postfix | ||
| + | |||
| + | " | ||
| + | |||
| + | sudo ufw allow Postfix | ||
| + | </ | ||
| + | ==== Configure Apache & WordPress ==== | ||
| + | |||
| + | In general, follow scripts/ | ||
| + | |||
| + | See [[server_configuration: | ||
| + | |||
| + | ==== WordPress Migration ==== | ||
| + | |||
| + | General guides | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | === All-in-One WP Migration === | ||
| + | This worked amazingly: | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | I had to make a change: | ||
| + | * https:// | ||
| + | |||
| + | The two values need to be larger than the file size '' | ||
| + | |||
| + | In the interface, the value which is shown as the " | ||
| + | |||
| + | Edit the '' | ||
| + | |||
| + | <file txt .htaccess> | ||
| + | php_value upload_max_filesize 256M | ||
| + | php_value post_max_size 200M | ||
| + | php_value memory_limit 256M | ||
| + | php_value max_execution_time 300 | ||
| + | php_value max_input_time 300 | ||
| + | </ | ||
| + | |||
| + | After upload, it' possible to delete/ | ||
| + | |||
| + | WordPress is requiring FTP credentials before installing plugin | ||
| + | * https:// | ||
| + | |||
| + | Modify file: '' | ||
| + | < | ||
| + | define(' | ||
| + | </ | ||
| + | <code bash> | ||
| + | chown -R ../ www-data: | ||
| + | </ | ||
| + | |||
| + | |||
| + | === Duplicator === | ||
| + | I didn't use as it migrated all the WordPress files and had some fun and games with registration: | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | ==== Restore Files ==== | ||
| + | |||
| + | <code bash> | ||
| + | # Mount (if not already) | ||
| + | mount -o discard, | ||
| + | |||
| + | # Create Target | ||
| + | mkdir -p / | ||
| + | cd / | ||
| + | |||
| + | # Copy to Target | ||
| + | cp -R / | ||
| + | cp -R / | ||
| + | |||
| + | # Fix permissions: | ||
| + | chown -R ../ www-data: | ||
| + | </ | ||
| + | |||
| + | |||
| + | ====== Bulk To sort ====== | ||
| + | |||
| + | < | ||
| Other Stuff (cover fast, future blog post) | Other Stuff (cover fast, future blog post) | ||
| - Wiki(s) | - Wiki(s) | ||
| - Mailbox | - Mailbox | ||
| - | - SFTP? | + | - Firewall |
| - | - Firewall | + | - Hostname -- https:// |
| - | -- | + | |
| - | | + | |
| - | - Hostname -- https:// | + | |
| </ | </ | ||
| - | ====== | + | ====== |
| + | Tips for OBS Studio, note aiming for things to look good in '' | ||
| + | Check/ | ||
| <code bash> | <code bash> | ||
| for n in {1..8}; do for i in {1..10}; do echo -n ${i: -1}; done; done; echo "" | for n in {1..8}; do for i in {1..10}; do echo -n ${i: -1}; done; done; echo "" | ||
| Line 136: | Line 313: | ||
| - Log: C: | - Log: C: | ||
| - | Taskbar settings: | + | Windows |
| - Lock taskbar: Off | - Lock taskbar: Off | ||
| - Show taskbar on all displays: Off | - Show taskbar on all displays: Off | ||
| - Move to other screen | - Move to other screen | ||
| </ | </ | ||