{"id":24997935,"url":"https://github.com/yogitabadhe/aws_ec2_website_project","last_synced_at":"2026-04-19T13:32:22.979Z","repository":{"id":275574171,"uuid":"926491722","full_name":"YogitaBadhe/AWS_EC2_Website_Project","owner":"YogitaBadhe","description":"In this project, you'll launch an EC2 instance with Amazon Linux 2, install Apache HTTP server, and deploy a simple static website (HTML files). The website will be accessible through the public IP address.","archived":false,"fork":false,"pushed_at":"2025-02-03T11:52:47.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T12:24:08.105Z","etag":null,"topics":["aws","css","ec2-instance","github","html","javascript"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YogitaBadhe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-02-03T10:56:58.000Z","updated_at":"2025-02-03T12:23:20.000Z","dependencies_parsed_at":"2025-02-03T12:24:14.090Z","dependency_job_id":"230f7797-0852-4339-8a6a-463125f23e2a","html_url":"https://github.com/YogitaBadhe/AWS_EC2_Website_Project","commit_stats":null,"previous_names":["yogitabadhe/aws_ec2_website_project"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YogitaBadhe%2FAWS_EC2_Website_Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YogitaBadhe%2FAWS_EC2_Website_Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YogitaBadhe%2FAWS_EC2_Website_Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YogitaBadhe%2FAWS_EC2_Website_Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YogitaBadhe","download_url":"https://codeload.github.com/YogitaBadhe/AWS_EC2_Website_Project/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246210051,"owners_count":20741106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aws","css","ec2-instance","github","html","javascript"],"created_at":"2025-02-04T17:26:42.645Z","updated_at":"2026-04-19T13:32:22.937Z","avatar_url":"https://github.com/YogitaBadhe.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Host a Website on EC2 Linux Instance Using Apache\n\nThis guide walks you through the process of hosting a static website on an **Amazon EC2 instance** running **Amazon Linux 2**. The website will be served using the **Apache HTTP server**.\n\n## **Description**\n\nIn this project, you'll launch an **EC2 instance** with **Amazon Linux 2**, install **Apache HTTP server**, deploy a simple static website (HTML files), and manage the website using **Git**.\n\n## **Prerequisites**\n\nBefore you begin, ensure that you have the following:\n\n1. **AWS Account**: You need an active AWS account to create EC2 instances and use other AWS services.\n2. **IAM User Permissions**: Your IAM user should have sufficient permissions to create EC2 instances, configure security groups, and manage related resources.\n3. **SSH Key Pair**: You need an SSH key pair for secure access to your EC2 instance.\n4. **A Web Browser**: You'll need a browser to test your website by accessing the EC2 public IP.\n5. **Basic Linux and SSH Knowledge**: Comfort with terminal commands to interact with your EC2 instance.\n6. **Git Installed**: Ensure **Git** is installed on your local machine and EC2 instance.\n\n## **Steps**\n\n### 1. **Launch an EC2 Instance**\n\n1. **Login to AWS Console**: Navigate to the [AWS Management Console](https://aws.amazon.com/console/) and log in.\n2. **Navigate to EC2**: In the console, search for and select **EC2**.\n3. **Launch Instance**: \n    - Click **Launch Instance**.\n    - **Choose an AMI**: Select **Amazon Linux 2 AMI** (Amazon Linux 2 is the default for EC2).\n    - **Choose Instance Type**: Select a free tier-eligible instance type like **t2.micro**.\n    - **Configure Instance**: Use the default configuration or customize based on your needs.\n    - **Configure Security Group**:\n        - Add a rule to allow **HTTP (Port 80)** for web traffic.\n        - Add a rule for **SSH (Port 22)** for secure access (limit to your IP for security).\n    - **Review and Launch**: Review your settings and click **Launch**.\n\n### 2. **Connect to Your EC2 Instance via SSH**\n\nAfter your EC2 instance is running, you can connect to it using SSH:\n\n1. **Find the Public IP**: Go to the **Instances** page in EC2 and locate your instance. Copy the **Public IP** address.\n2. **SSH into the Instance**:\n   - Open your terminal.\n   - Run the following command to connect to your EC2 instance (replace `\u003cyour-key.pem\u003e` with your private key and `\u003cec2-public-ip\u003e` with your EC2 public IP):\n     ```bash\n     ssh -i /path/to/your-key.pem ec2-user@\u003cec2-public-ip\u003e\n     ```\n   - Accept the SSH fingerprint if prompted to establish a secure connection.\n\n### 3. **Install Apache Web Server and Git**\n\nOnce you're connected to your EC2 instance, you'll need to install the **Apache HTTP server** and **Git**.\n\n1. **Update the System**:\n   ```bash\n   sudo yum update -y\n   ```\n\n2. **Install Apache**:\n   ```bash\n   sudo yum install httpd -y\n   ```\n\n3. **Install Git**:\n   ```bash\n   sudo yum install git -y\n   ```\n\n### 4. **Start Apache Web Server**\n\nAfter installation, start the Apache service and enable it to automatically start on boot.\n\n1. **Start Apache**:\n   ```bash\n   sudo systemctl start httpd\n   ```\n\n2. **Enable Apache to Start on Boot**:\n   ```bash\n   sudo systemctl enable httpd\n   ```\n\n### 5. **Clone Website Repository from GitHub**\n\nTo deploy the website, you need to clone the repository containing your website files.\n\n1. **Navigate to the Apache root directory**:\n   ```bash\n   cd /var/www/html/\n   ```\n\n2. **Clone the GitHub Repository**:\n   ```bash\n   sudo git clone \u003cyour-git-repository-url\u003e .\n   git clone https://github.com/YogitaBadhe/AWS_EC2_Website_Project.git\n   cd AWS_EC2_Website_Project\n   ```\n\n3. **Set the Correct Permissions**:\n   ```bash\n   sudo chown -R apache:apache /var/www/html/\n   ```\n\n### 6. **Configure Git to Push Changes**\n\n1. **Set Up Git Configuration**:\n   ```bash\n   git config --global user.name \"YogitaBadhe\"\n   git config --global user.email \"ybadhe0990@gmail.com\"\n   ```\n\n2. **Make Changes to the Website**:\n   ```bash\n   index.html\n   ```\n\n3. **Commit and Push Changes**:\n   ```bash\n   git add .\n   git commit -m \"Initial website commit\"\n   git push origin main\n   ```\n\n### 7. **Configure the Security Group**\n\nTo allow access to your website, make sure your EC2 instance’s security group is configured correctly.\n\n1. **Edit Security Group**:\n   - Go to **EC2 Console \u003e Security Groups**.\n   - Select the security group associated with your EC2 instance.\n   - Ensure there’s an inbound rule allowing **HTTP (Port 80)** from **0.0.0.0/0** (for public access) or your IP range.\n\n### 8. **Access the Website**\n\nNow that the files are deployed and the server is configured, open a browser and go to the **Public IP** of your EC2 instance:\n```\nhttp://\u003cec2-public-ip\u003e\n```\nYou should see your website in the browser!\n\n### 9. **Optional: Set Up a Domain Name**\n\nIf you have a domain name and want to map it to your EC2 instance:\n\n1. **Allocate an Elastic IP**: \n   - In the EC2 console, allocate an **Elastic IP** and associate it with your EC2 instance.\n   \n2. **Update DNS Settings**: \n   - Log into your domain registrar’s control panel.\n   - Set the **A Record** for your domain to point to your Elastic IP.\n   - Propagation may take some time (typically up to 24 hours).\n\n### 10. **Stop/Restart Apache Web Server (Optional)**\n\n1. **To stop Apache**:\n   ```bash\n   sudo systemctl stop httpd\n   ```\n\n2. **To restart Apache** (for changes like configuration updates):\n   ```bash\n   sudo systemctl restart httpd\n   ```\n\n---\n\n## **Additional Resources**\n\n- [Amazon EC2 Documentation](https://docs.aws.amazon.com/ec2/index.html)\n- [Apache HTTP Server Documentation](https://httpd.apache.org/docs/)\n- [Amazon Linux 2 AMI Documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-ami-versions.html)\n- [GitHub Documentation](https://docs.github.com/en/get-started)\n\n---\n\nThis **README.md** provides step-by-step instructions to host a static website on an EC2 instance running **Amazon Linux 2**, using **Apache HTTP server**, and managing the website with **Git**.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyogitabadhe%2Faws_ec2_website_project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyogitabadhe%2Faws_ec2_website_project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyogitabadhe%2Faws_ec2_website_project/lists"}