Skip to content

Instantly share code, notes, and snippets.

@webgtx
Created January 7, 2023 13:41
Show Gist options
  • Select an option

  • Save webgtx/44c044c9cf58e241047ee564ac139b88 to your computer and use it in GitHub Desktop.

Select an option

Save webgtx/44c044c9cf58e241047ee564ac139b88 to your computer and use it in GitHub Desktop.
Migration plan

Migration plan

Why you should migrate your website from FTP to VPS

VPS (Virtual Private Server) hosting is generally considered to be more powerful and flexible than regular FTP (File Transfer Protocol) hosting. This is because a VPS allows you to have your own virtualized operating system, which gives you more control over the hosting environment. With a VPS, you can install custom software and configure your hosting environment to meet your specific needs.

In contrast, regular FTP hosting typically provides less control and flexibility. You are typically limited to using the software and configurations provided by the hosting provider, and may not have the ability to install custom software or make other configuration changes.

Additionally, VPS hosting typically offers more resources, such as memory and CPU, which can be beneficial if you have a resource-intensive website or application.

Overall, VPS hosting is generally more suitable for businesses or individuals with more advanced hosting needs, while regular FTP hosting may be sufficient for more basic or smaller websites.

Stable cloud and fair price for compute

There are several options for inexpensive cloud computing, including:

  • Google Cloud Platform: Google offers a range of compute options at different price points, including the f1-micro instance which is free to use within certain limits.
  • Amazon Web Services (AWS): AWS offers a number of free tier services, including the t2.micro instance, which is free to use for one year.
  • Microsoft Azure: Azure offers a free trial that includes a number of free services and a credit that can be used to try out paid services.
  • IBM Cloud: IBM offers a free tier with a number of services that are free to use, including a Lite plan for their Cloud Functions service.

It's worth noting that while these options may be the least expensive up front, you'll want to carefully consider the long-term costs of using any cloud computing service, as prices can vary significantly depending on your usage.

Always working production, why you should try monitoring systems

Monitoring systems are used to monitor the performance and availability of servers, networks, and applications. These systems can alert you when something goes wrong, such as a server crashing, or when certain performance thresholds are breached. This allows you to proactively fix issues before they turn into larger problems, such as extended downtime or data loss.

There are many benefits to using a monitoring system:

  1. Improved uptime: By monitoring your systems, you can quickly identify and fix issues before they cause widespread problems. This can help reduce downtime and improve the availability of your systems.

  2. Increased efficiency: Monitoring systems can help you identify bottlenecks and other performance issues that may be slowing down your systems. This can help you optimize your systems for better performance.

  3. Early warning: Monitoring systems can alert you to potential issues before they become critical. This allows you to take proactive measures to prevent problems from occurring.

  4. Better decision-making: Monitoring systems can provide you with data and insights that can help you make informed decisions about your systems. This can help you improve the overall performance and efficiency of your systems.

Overall, monitoring systems are an essential tool for any organization that relies on servers, networks, or applications to operate. They can help you ensure that your systems are running smoothly and reliably, and can help you avoid costly downtime and other problems.

Here is a general plan for migrating a WordPress website from one hosting service to Linode as an example:

  1. Backup your WordPress website:
    • Make a full backup of your WordPress website, including the database and all files. You can use a plugin like UpdraftPlus to do this.
  2. Create a Linode account:
  3. Create a new Linode server:
  4. Install WordPress on the new server:
  5. Import your WordPress backup:
    • Use the WordPress plugin you used to make the backup (e.g. UpdraftPlus) to import the backup to the new server.
  6. Test the website:
    • Once the import is complete, test the website to make sure everything is working correctly.
  7. Update DNS records:
    • If your domain is registered with a different company than your old hosting service, you'll need to update the DNS records to point to the new Linode server. This will allow visitors to access the website using your domain name.
  8. Redirect traffic to the new server:
    • If you're using a hosting service that provides a control panel, you can set up a redirect to send visitors from the old website to the new one. This will help ensure that visitors don't get an error when they try to access the old website.
  9. Delete the old server:
    • Once you're sure everything is working correctly on the new server, you can delete the old server to avoid any additional charges.

HTTP traffic to HTTPS, really important issue

How to solve it

  1. Obtain an SSL certificate for your domain. You can either purchase one from a certificate authority (CA) or generate a self-signed certificate.

  2. Install the SSL certificate on your server. This process will vary depending on your operating system and the method you used to obtain the certificate.

  3. Edit your nginx configuration file to include the following code block:

server {
    listen 80;
    server_name example.com www.example.com;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl;
    server_name example.com www.example.com;
    ssl_certificate /path/to/your/certificate.crt;
    ssl_certificate_key /path/to/your/private/key.key;
    # other configuration directives go here
}
  1. Replace "example.com" and "www.example.com" with your own domain name.

  2. Replace "/path/to/your/certificate.crt" and "/path/to/your/private/key.key" with the actual paths to your SSL certificate and private key, respectively.

  3. Save your changes to the nginx configuration file and exit.

  4. Test your configuration file for syntax errors by running the following command:

sudo nginx -t
  1. If the test passes, reload nginx to apply the changes:
sudo systemctl reload nginx

Better safe than sorry, security tasks

Here are some regular security tasks that I will perform for your WordPress website:

  1. Keep your WordPress software and plugins up to date. This helps fix any vulnerabilities that may have been discovered and prevent hackers from exploiting them.

  2. Use a strong and unique password for your WordPress admin account. Avoid using common passwords or using the same password for multiple accounts.

  3. Use a security plugin to help protect your website. There are many security plugins available that can help secure your website by blocking malicious traffic, adding two-factor authentication, and more.

  4. Regularly scan your website for malware and other security threats. There are several tools available that can help you do this, such as Wordfence or Sucuri.

  5. Backup your website regularly. This will allow you to restore your website in case it is hacked or something goes wrong.

  6. Use a web application firewall (WAF) to help protect your website from common attacks such as SQL injection and cross-site scripting (XSS).

  7. Limit login attempts to your WordPress admin area. This can help prevent brute force attacks, where hackers try to guess your password by trying different combinations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment