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/01 17:56] – [Basic Configuration] 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 15: | Line 15: | ||
| See: | See: | ||
| - | * [[server_configuration:apache]] | + | * [[server configuration:apache]] |
| - | * [[server_configuration: | + | * [[server configuration: |
| - | * [[server_configuration:email]] | + | * [[server configuration:email]] |
| - | * [[server_configuration:cron]] | + | * [[server configuration:cron]] |
| - | * [[server_configuration:wiki]] | + | * [[server configuration:wiki]] |
| + | * [[server configuration: | ||
| + | * [[server configuration: | ||
| + | * [[server configuration: | ||
| + | |||
| + | Also (for me): | ||
| + | * [[server configuration: | ||
| ====== Server Migration ====== | ====== Server Migration ====== | ||
| Line 83: | 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 91: | 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 103: | Line 166: | ||
| <code bash> | <code bash> | ||
| # Update | # Update | ||
| - | sudo apt-get update && sudo apt-get upgrade | + | sudo apt-get update && sudo apt-get upgrade |
| </ | </ | ||
| - | |||
| - | ==== SFTP ==== | ||
| - | |||
| - | Basic SFTP was already available/ | ||
| - | |||
| - | Some related notes: | ||
| - | SFTP: https:// | ||
| - | https:// | ||
| - | https:// | ||
| - | https:// | ||
| - | |||
| - | Note, I'd added the user account to the group " | ||
| <code bash> | <code bash> | ||
| - | # Create sftp group and add user | + | # SSH Access |
| - | groupadd sftp | + | grep PermitRootLogin /etc/ssh/ |
| - | usermod -a -G sftp david | + | |
| - | + | ||
| - | # Restart | + | |
| - | systemctl restart ssh | + | |
| - | service | + | |
| - | # Remove user from group | + | sudo vi / |
| - | gpasswd -d david sftp | + | |
| - | # View groups | + | # PermitRootLogin no |
| - | groups david | + | |
| </ | </ | ||
| + | |||
| + | ==== SFTP ==== | ||
| + | |||
| + | Basic SFTP was already available/ | ||
| ==== Firewall ==== | ==== Firewall ==== | ||
| Line 143: | 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 ==== | ||
| Line 163: | Line 235: | ||
| * https:// | * https:// | ||
| - | The two values need to be larger than the file size '' | + | The two values need to be larger than the file size '' |
| + | |||
| + | In the interface, the value which is shown as the " | ||
| + | |||
| + | Edit the '' | ||
| - | Under: ''/ | + | < |
| - | <file .htaccess> | + | |
| php_value upload_max_filesize 256M | php_value upload_max_filesize 256M | ||
| php_value post_max_size 200M | php_value post_max_size 200M | ||