← Back to Projects

Part 4: Updating and working on the website

A guide on how to test changes locally, manage version control with Git, and push updates live to an AWS EC2 production environment.

This central guide details the core commands and workflows required to maintain, update, and deploy changes to the personal portfolio website using XAMPP for local testing, Git for version control, and AWS for production hosting.

1. Local Testing with XAMPP

Before deploying any changes to the live server, they should be thoroughly tested in a local development environment. XAMPP provides a local Apache web server and MariaDB database.

Starting the Local Server

Open the XAMPP Control Panel and ensure both the Apache and MySQL modules are running. Then, open your web browser and navigate to the local project address:

http://localhost/PersonalWebsite/

Testing Database Changes

If you need to test database structural changes or run raw SQL queries locally, use the phpMyAdmin interface provided by XAMPP:

http://localhost/phpmyadmin/

2. Version Control with Git

Once local changes have been verified and are working as expected, they must be committed to the project's source code repository. This provides a safe backup and tracks the history of all modifications.

Staging and Committing

Open your local terminal within the PersonalWebsite project directory and use Git to stage and commit your updated files:

git add .
git commit -m "Update: Describe your changes here"

Pushing to GitHub

Upload the committed changes safely to the remote GitHub repository where they can be accessed from anywhere:

git push origin main

3. Deploying to Production (AWS)

With the changes safely stored in GitHub, it is time to deploy them to the live Amazon Web Services (AWS) EC2 server so the public can view them.

Pulling Live Updates

Connect to your AWS EC2 instance via SSH. Navigate to the Apache web root directory and use Git to pull the latest changes directly from the GitHub repository onto the live server.

cd /var/www/html/
git pull origin main

Your live website will instantly reflect the new codebase updates! If you made structural database changes locally during testing, remember to manually replicate those SQL queries on the live AWS MariaDB instance or via a local phpMyAdmin export and live import.