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/01/13 16:06] – 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:cron]] | + | * [[server configuration:cron]] |
| + | * [[server configuration: | ||
| + | * [[server configuration: | ||
| + | * [[server configuration: | ||
| + | * [[server configuration: | ||
| + | |||
| + | Also (for me): | ||
| + | * [[server configuration: | ||
| ====== Server Migration ====== | ====== Server Migration ====== | ||
| Line 52: | Line 63: | ||
| ==== Get configuration ==== | ==== Get configuration ==== | ||
| - | Gollowing | + | Following |
| * DigitalOcean Community Documentation: | * DigitalOcean Community Documentation: | ||
| Line 67: | Line 78: | ||
| # More | # More | ||
| - | service --status-all|more | + | service --status-all | more |
| </ | </ | ||
| Line 79: | Line 90: | ||
| * Mount the volume: https:// | * Mount the volume: https:// | ||
| + | **What' | ||
| + | <code bash> | ||
| + | sudo service --status-all | ||
| + | sudo ufw status | ||
| + | </ | ||
| - | === Create New Droplet === | + | <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 ===== | ||
| + | ==== Create New Droplet | ||
| + | |||
| + | === preconfigured droplet | ||
| Saving time (haha) by using a WordPress preconfigured droplet: | Saving time (haha) by using a WordPress preconfigured droplet: | ||
| Line 86: | Line 149: | ||
| * Install & configure: The WordPress One-Click Quickstart guide: https:// | * Install & configure: The WordPress One-Click Quickstart guide: https:// | ||
| - | === Basic Configuration === | + | === Build from scratch === |
| + | |||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | ==== Basic Configuration | ||
| As root | As root | ||
| <code bash> | <code bash> | ||
| + | # create a user for me | ||
| + | adduser david | ||
| + | |||
| # Add my user to sudo | # Add my user to sudo | ||
| groupadd david sudo | groupadd david sudo | ||
| Line 95: | 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 === | + | <code bash> |
| + | # SSH Access - once user access is sorted | ||
| + | grep PermitRootLogin / | ||
| - | Basic SFTP was already available/configured in the box. I did have fun as my configuration in my client application was set to point to an IP rather than the hostname. | + | sudo vi /etc/ |
| - | Some related notes: | + | # PermitRootLogin no |
| - | SFTP: https:// | + | </code> |
| - | https:// | + | |
| - | https:// | + | |
| - | https:// | + | |
| - | Note, I'd added the user account to the group " | ||
| + | ==== 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:// | ||
| + | |||
| + | * HowTo Geek: [[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> | <code bash> | ||
| - | # Craete sftp group and add user | + | ################################################################################ |
| - | groupadd sftp | + | # Email/ |
| - | usermod -a -G sftp david | + | ################################################################################ |
| + | cd ~/ | ||
| - | # Restart SSH - 2 methods | + | sudo cp -R / |
| - | systemctl restart ssh | + | sudo cp -R / |
| - | service ssh reload | + | |
| - | # Remove user from group | + | sudo cp -R / |
| - | gpasswd | + | sudo cp -R / |
| - | # View groups | + | sudo chown -R david:david ~/. |
| - | groups | + | |
| - | </code> | + | |
| - | === Configure Apache & WorPress | + | sudo apt-get install postfix |
| + | |||
| + | " | ||
| + | |||
| + | sudo ufw allow Postfix | ||
| + | </ | ||
| + | ==== Configure Apache & WordPress ==== | ||
| In general, follow scripts/ | In general, follow scripts/ | ||
| Line 132: | Line 221: | ||
| See [[server_configuration: | See [[server_configuration: | ||
| - | === WordPress Migration === | + | ==== WordPress Migration |
| General guides | General guides | ||
| Line 138: | Line 227: | ||
| * https:// | * https:// | ||
| - | == All-in-One WP Migration == | + | === All-in-One WP Migration |
| This worked amazingly: | This worked amazingly: | ||
| * https:// | * https:// | ||
| Line 146: | 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 | ||
| Line 171: | Line 263: | ||
| - | == Duplicator == | + | === Duplicator |
| - | I didn't use as it migrated all the WprdPress | + | I didn't use as it migrated all the WordPress |
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| - | === Restore Files === | + | ==== Restore Files ==== |
| <code bash> | <code bash> | ||