Taking a local application and securely launching it onto the internet requires a cloud server. For this portfolio, an Amazon Web Services (AWS) EC2 environment was selected for its robust performance and scalability.
1. Acquiring a Domain and DNS
Before launching a cloud server, a custom web domain (e.g., sjdawson.com) needs to be registered. This acts as the human-readable address for the server.
Placeholder: Take a screenshot of the domain registration or DNS management page.
2. Launching the EC2 Instance
Navigate to the AWS Console, specifically the EC2 Dashboard, and launch a new instance running Amazon Linux 2023.
Placeholder: Take a screenshot of the AWS EC2 management console showing the running instances.
Once the EC2 instance is running, an Elastic IP Address must be assigned to it so its IP stays permanent. Finally, head back to your Domain DNS settings and create an A Record that points the domain directly to this Elastic IP address.
3. Installing the LAMP Stack on Amazon Linux
SSH into the EC2 server and run the foundational commands to establish the web server and database engines.
Core Installation
sudo dnf update -ysudo dnf install -y httpd mariadb105-server php php-mysqlnd php-gdsudo systemctl start httpdsudo systemctl enable httpdsudo systemctl start mariadbsudo systemctl enable mariadbDatabase Secure Config
Initialize the MySQL secure script and grant your application a database user:
sudo mysql_secure_installationsudo mysql -u root -pCREATE DATABASE personal_portfolio;CREATE USER 'portfolio_user'@'localhost' IDENTIFIED BY 'your_secure_password';GRANT ALL PRIVILEGES ON personal_portfolio.* TO 'portfolio_user'@'localhost';FLUSH PRIVILEGES;EXIT;Folder Ownership & Permissions
Assign Apache ownership so you can pull code directly into the web root.
sudo usermod -a -G apache ec2-usersudo chown -R ec2-user:apache /var/wwwsudo chmod 2775 /var/wwwEnsure your photo uploads directory can accept incoming images from the Admin Panel.
mkdir -p /var/www/html/uploadssudo chown apache:apache /var/www/html/uploads/sudo chmod 755 /var/www/html/uploads/4. Securing with Let's Encrypt (HTTPS)
Finally, secure your network traffic and generate an SSL Certificate by executing the Certbot script via python virtual environments.
sudo dnf install -y python3 augeas-libssudo python3 -m venv /opt/certbot/sudo /opt/certbot/bin/pip install --upgrade pipsudo /opt/certbot/bin/pip install certbot certbot-apachesudo ln -s /opt/certbot/bin/certbot /usr/bin/certbotsudo certbot --apache