Last updated on May 2, 2025
Hey, this is Step 5 of our 9-step website portfolio building with AWS!
Got lost? Click here to go to the main article, and here for the fourth step!
When working on a project, there is no avoidance of bugs, which sometimes is frustrating, especially when getting stuck over a recurrent issue. This article discusses common mistakes and bugs, the strategies that can be effectively used to troubleshoot them, and tips on how to solve them more efficiently and confidently.
1. Common Mistake: Keeping the Default 8GB Storage Size for Your Amazon EC2 Instance
When launching an Amazon EC2 instance for a portfolio website, many users forget to increase the default storage size from 8GB. Small memory space generally causes a variety of problems, including slower performance, instability of the system, and sometimes even loss of important data. When space runs out on the server, critical operations—in this case database management and backup functions—slow down or can even fail completely.
What Should You Do?
Before launching your instance, manually adjust the storage size based on your project needs. For most portfolio websites, starting with at least 50GB provides enough space for files, databases, and future growth. It’s a small change that can save you from major headaches later on!
2. Common Problem: Not Being Able to Upload Images and Install Plugins
In some cases, users may encounter issues when trying to upload images to their website, resulting in error messages such as:
“Unable to create directory wp-content/uploads/2025/03. Is its parent directory writable by the server?”
You might also run into another issue when installing plugins or templates, where WordPress shows:
“Failed to connect to FTP Server.”
What Causes the Problem?
These two errors generally indicate that WordPress is lacking necessary permissions to create directories or to write to files. Look in your server; usually, you’ll find that file ownership is assigned to the default OS user rather than “www-data” (the right user for public web files).
What Should You Do?
Use SSH or FTP to set the correct directory permissions:
-
Connect to your server via SSH.
-
Run the following command to ensure correct ownership (replace
domain-name
with the appropriate folder name for your server):
3. Common Problem: Hitting the Soft Limit of 5 Elastic IPs per AWS Region
When you’re setting up multiple projects or servers on AWS, you might suddenly get an error saying you can’t allocate a new Elastic IP address.
What Causes the Problem?
AWS has a default soft limit of 5 Elastic IP addresses per region. This limit is in place to prevent accidental overuse of public IP addresses, which are a limited resource.
What Should You Do?
You have a couple of options:
-
Use a different AWS Region:
-
If your project allows, you can switch to another region where you haven’t reached the Elastic IP limit yet.
-
-
Release unused Elastic IPs:
-
Check your existing instances and release (delete) any Elastic IPs that are no longer associated with active servers. This will free up space for new ones.
-
-
Request a limit increase:
-
If you really need more Elastic IPs in the same region, you can submit a Service Quota Increase request through the AWS Console. AWS usually reviews and approves these requests pretty quickly for valid use cases.
-
4. Common Problem: Forgetting to Enable Auto-Renew for Domain Names
You’ve launched your portfolio website, everything is running smoothly—until one day, your domain suddenly goes offline. You realize too late that your domain registration expired.
What Causes the Problem?
Many people register their domain for a year and forget to enable auto-renewal. If you don’t manually renew it or set up auto-renew, the domain expires. Once expired, your website becomes inaccessible, and worse, someone else could buy your domain name if you’re not quick.
What Should You Do?
-
Enable auto-renewal:
-
Go to your domain registrar (like AWS Route 53, GoDaddy, Namecheap, etc.) and make sure auto-renew is turned on.
-
-
Keep your payment method updated:
-
Even with auto-renewal enabled, an expired or invalid payment method can cause renewal to fail. Double-check that your billing info is current.
-
-
Set calendar reminders:
-
As a backup, set a reminder a few weeks before your domain expires, just in case something unexpected happens with billing.
-
Taking a few minutes to set this up can save you a major headache (and possibly your brand identity) later on!
5. Common Problem: Error Establishing a Database Connection
When trying to access your WordPress site or another database-driven application, you may encounter an error message like:
“Error establishing a database connection.”
What Causes the Problem?
This issue often occurs due to incorrect database credentials. The database might exist, but the username, password, or host in your configuration might not match the correct values. In some cases, the user may not have been created correctly or lacks proper privileges.
What Should You Do?
- Check Your
wp-config.php
(or equivalent for your platform):- Open the configuration file and verify that the database name, username, password, and host values are correct. They should match exactly what you set in MySQL.
- Create or Alter User in MySQL:
- If the user hasn’t been created or doesn’t have sufficient permissions, you can follow these steps:
- Create a user (if not already created):
- Grant privileges to the user:
GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
FLUSH PRIVILEGES;
- Alter user credentials (if needed): If you need to change the password or ensure the user has proper access, use the following command:
ALTER USER 'username'@'localhost' IDENTIFIED BY 'new_password';
- Check Database Server Status:
- Ensure that your MySQL server is running. You can restart it using the command:
sudo systemctl restart mysql
- Ensure that your MySQL server is running. You can restart it using the command:
- Test the Connection:
- After fixing the credentials and permissions, test your connection by visiting your website.
Next Step: Getting Started with the WordPress Dashboard
We are now finished setting up our portfolio website, and now the most exciting part is about to begin: designing our site! In my next blog post, I will take you on a tour through the WordPress Dashboard to help you become familiar with it. See you in the next article!
Frequently Asked Questions
- Why can’t I access my website’s WordPress admin panel?
- An invalid password or username, a corrupt plugin, or insufficient permissions from the server may prevent admin access.
- Why is my WordPress site loading slowly?
- It can be mainly large-size images, too many plugins, unoptimized databases, and/or issues with the web hosting.
- Why don’t the changes I’ve made appear on my website?
- If a cached version of the page is being shown, any changes you make will not be visible: either because of browser caching, caching plugins that are part of WordPress, or server-side caching.