{"id":20371575,"url":"https://github.com/atulkamble/aws-ec2-static-website","last_synced_at":"2026-02-19T18:02:12.769Z","repository":{"id":252894188,"uuid":"806383679","full_name":"atulkamble/aws-ec2-static-website","owner":"atulkamble","description":"This repository provides a step-by-step guide for deploying a static website on AWS EC2. It includes instructions for launching an EC2 instance, installing and configuring the Apache web server, and deploying a basic HTML website. The project also features an optional script for automating the deployment process.","archived":false,"fork":false,"pushed_at":"2024-08-13T06:41:39.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-15T15:42:01.844Z","etag":null,"topics":["apache","aws","ec2","iac","infrastructure-as-code","static-website","web-hosting","website"],"latest_commit_sha":null,"homepage":"http://linkedin.com/in/atuljkamble","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atulkamble.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"atulkamble"}},"created_at":"2024-05-27T05:13:15.000Z","updated_at":"2024-08-13T06:41:42.000Z","dependencies_parsed_at":"2024-08-13T06:43:23.904Z","dependency_job_id":null,"html_url":"https://github.com/atulkamble/aws-ec2-static-website","commit_stats":null,"previous_names":["atulkamble/awswebsiteproject"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/atulkamble/aws-ec2-static-website","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atulkamble%2Faws-ec2-static-website","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atulkamble%2Faws-ec2-static-website/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atulkamble%2Faws-ec2-static-website/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atulkamble%2Faws-ec2-static-website/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atulkamble","download_url":"https://codeload.github.com/atulkamble/aws-ec2-static-website/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atulkamble%2Faws-ec2-static-website/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29626612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache","aws","ec2","iac","infrastructure-as-code","static-website","web-hosting","website"],"created_at":"2024-11-15T01:08:35.070Z","updated_at":"2026-02-19T18:02:12.752Z","avatar_url":"https://github.com/atulkamble.png","language":"HTML","funding_links":["https://github.com/sponsors/atulkamble"],"categories":[],"sub_categories":[],"readme":"# Hosting a Static Website on AWS EC2\n# Clone This Repository\n```bash\ngit clone https://github.com/atulkamble/aws-ec2-static-website.git\ncd aws-ec2-static-website\n```\n\n# AWSWebsiteProject\n**Hosting a Website on AWS EC2**\n\nThis project provides a comprehensive guide for configuring and hosting a static website on AWS EC2, including relevant code snippets for setup and deployment.\n\n---\n\n### **Project: Hosting a Static Website on AWS EC2**\n\n**Objective:**  \nEstablish and deploy a static website on an AWS EC2 instance.\n\n---\n\n### **Prerequisites**\n\n1. **AWS Account:** Ensure you have an active AWS account.\n2. **AWS CLI:** Install and configure the AWS Command Line Interface (CLI). [Download AWS CLI](https://aws.amazon.com/cli/)\n3. **EC2 Key Pair:** Generate an EC2 key pair for secure instance access.\n4. **Git:**\n   ```bash\n   git config --global user.name \"username\"\n   git config --global user.email \"email@example.com\"\n   ```\n\n---\n\n### **Step 1: Launch an EC2 Instance**\n\n1. **Access AWS Management Console** and navigate to the EC2 Dashboard.\n\n2. **Initiate Instance Launch:**\n   - Select “Launch Instance”.\n   - Choose an Amazon Machine Image (AMI): Opt for the “Amazon Linux 2 AMI”.\n   - Select an Instance Type: Choose “t2.micro” (eligible for the free tier).\n   - Configure Instance: Accept the default configuration settings.\n   - Add Storage: Accept the default storage configuration.\n   - Add Tags: (Optional) Add a tag such as `Name: EC2WebServer`.\n   - Configure Security Group: Create a new security group with rules allowing HTTP (port 80) and SSH (port 22) traffic.\n   - Review and Launch: Verify settings and click “Launch”. Select your key pair and proceed with launching the instance.\n\n---\n\n### **Step 2: Connect to Your EC2 Instance**\n\n1. **Open your terminal** (Linux/Mac) or use PuTTY (Windows).\n\n2. **Establish SSH Connection:**\n   ```bash\n   ssh -i /path/to/your-key-pair.pem ec2-user@your-ec2-public-dns\n   ```\n\n---\n\n### **Step 3: Install and Configure Apache Web Server**\n\n1. **Update the instance and install Apache HTTP Server:**\n   ```bash\n   sudo yum update -y\n   sudo yum install -y httpd\n   ```\n\n2. **Start Apache service and enable it to start on boot:**\n   ```bash\n   sudo systemctl start httpd\n   sudo systemctl enable httpd\n   sudo usermod -a -G apache ec2-user\n   ```\n\n---\n\n### **Step 4: Deploy Your Static Website**\n\n1. **Create a basic HTML file:**\n   ```bash\n   sudo tee /var/www/html/index.html \u003c\u003cEOF\n   \u003chtml\u003e\n   \u003chead\u003e\n       \u003ctitle\u003eMy First AWS Website\u003c/title\u003e\n   \u003c/head\u003e\n   \u003cbody\u003e\n       \u003ch1\u003eHello, World!\u003c/h1\u003e\n       \u003cp\u003eWelcome to my website hosted on AWS EC2!\u003c/p\u003e\n   \u003c/body\u003e\n   \u003c/html\u003e\n   EOF\n   ```\n\n2. **Set file permissions (if required):**\n   ```bash\n   sudo chmod 644 /var/www/html/index.html\n   ```\n\n3. **Verify deployment by accessing the instance’s public DNS in your browser:**\n   ```\n   http://your-ec2-public-dns\n   ```\n\n   You should see the “Hello, World!” webpage.\n\n---\n\n### **Step 5: (Optional) Automate Deployment with a Script**\n\n1. **Create a deployment script (`deploy_website.sh`):**\n   ```bash\n   #!/bin/bash\n   sudo yum update -y\n   sudo yum install -y httpd\n   sudo systemctl start httpd\n   sudo systemctl enable httpd\n   sudo usermod -a -G apache ec2-user\n\n   sudo tee /var/www/html/index.html \u003c\u003cEOF\n   \u003chtml\u003e\n   \u003chead\u003e\n       \u003ctitle\u003eMy First AWS Website\u003c/title\u003e\n   \u003c/head\u003e\n   \u003cbody\u003e\n       \u003ch1\u003eHello, World!\u003c/h1\u003e\n       \u003cp\u003eWelcome to my website hosted on AWS EC2!\u003c/p\u003e\n   \u003c/body\u003e\n   \u003c/html\u003e\n   EOF\n\n   sudo chmod 644 /var/www/html/index.html\n   ```\n\n2. **Transfer and execute the script on your EC2 instance:**\n   ```bash\n   scp -i /path/to/your-key-pair.pem deploy_website.sh ec2-user@your-ec2-public-dns:/home/ec2-user/\n   ssh -i /path/to/your-key-pair.pem ec2-user@your-ec2-public-dns 'bash /home/ec2-user/deploy_website.sh'\n   ```\n\n---\n\n### **Conclusion**\n\nYou have successfully set up and hosted a static website on an AWS EC2 instance. This guide walks you through launching an EC2 instance, installing a web server, and deploying a basic HTML page. For more advanced setups, consider integrating additional AWS services or using infrastructure-as-code tools such as Terraform or Ansible.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatulkamble%2Faws-ec2-static-website","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatulkamble%2Faws-ec2-static-website","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatulkamble%2Faws-ec2-static-website/lists"}