Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| server_configuration [2021/02/02 08:19] – [Detail Pages] david | server_configuration [2025/04/02 09:56] (current) – [Basic Configuration] david | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| Some useful notes from the first server are hidden away under [[server: | Some useful notes from the first server are hidden away under [[server: | ||
| - | ====== Hosting Provider | + | ===== Hosting Provider ===== |
| The host I chose to use is use [[https:// | The host I chose to use is use [[https:// | ||
| Line 21: | Line 21: | ||
| * [[server configuration: | * [[server configuration: | ||
| * [[server configuration: | * [[server configuration: | ||
| + | * [[server configuration: | ||
| + | * [[server configuration: | ||
| Also (for me): | Also (for me): | ||
| Line 87: | Line 89: | ||
| * Backup old using a volume: [[https:// | * Backup old using a volume: [[https:// | ||
| * Mount the volume: https:// | * Mount the volume: https:// | ||
| + | |||
| + | **What' | ||
| + | <code bash> | ||
| + | sudo service --status-all | ||
| + | sudo ufw status | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | ################################################################################ | ||
| + | # MySQL : Backup | ||
| + | ################################################################################ | ||
| + | mkdir -p ~/ | ||
| + | |||
| + | # Backup databases from MySQL | ||
| + | for DB_NAME in `echo "SHOW DATABASES;" | ||
| + | |||
| + | ll ~/ | ||
| + | |||
| + | ################################################################################ | ||
| + | # 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 " | ||
| + | |||
| + | ll ~/ | ||
| + | |||
| + | ################################################################################ | ||
| + | # Backup Files (Digital Ocean Volume) | ||
| + | ################################################################################ | ||
| + | |||
| + | 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 ===== | ===== New Environment ===== | ||
| ==== Create New Droplet ==== | ==== Create New Droplet ==== | ||
| + | |||
| + | === preconfigured droplet === | ||
| Saving time (haha) by using a WordPress preconfigured droplet: | Saving time (haha) by using a WordPress preconfigured droplet: | ||
| Line 95: | Line 149: | ||
| * Install & configure: The WordPress One-Click Quickstart guide: https:// | * Install & configure: The WordPress One-Click Quickstart guide: https:// | ||
| + | === Build from scratch === | ||
| + | |||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| ==== Basic Configuration ==== | ==== Basic Configuration ==== | ||
| As root | As root | ||
| Line 107: | Line 166: | ||
| <code bash> | <code bash> | ||
| # Update | # Update | ||
| - | sudo apt-get update && sudo apt-get upgrade | + | sudo apt-get update && sudo apt-get upgrade |
| </ | </ | ||
| + | |||
| + | <code bash> | ||
| + | # SSH Access - once user access is sorted | ||
| + | grep PermitRootLogin / | ||
| + | |||
| + | sudo vi / | ||
| + | |||
| + | # PermitRootLogin no | ||
| + | </ | ||
| + | |||
| ==== SFTP ==== | ==== SFTP ==== | ||
| Line 122: | Line 191: | ||
| * Ubuntu Documentation: | * 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 ==== | ==== Configure Apache & WordPress ==== | ||