Apache Server is an open-source cross-platform web server released under the terms of Apache License2.0. It is one of the oldest and most reliable web server software maintained by the Apache Software Foundation, with the first version released in 1995.
Open-source and free, even for commercial use.
Reliable, stable software.
Frequently updated security patches.
Flexible due to its module-based structure.
Easy to configure, beginner-friendly.
Cross-platform (works on both Unix and Windows servers).
Optimal deliverability for static files and compatibility with any programming language (PHP, Python, etc)
Huge community and easily available support in case of any problem
Easy configurable AMI with pre-installed Apache Server with SSL
INSTALLATION VIA AWS MARKETPLACE
Kindly click on the below link to install the server via AWS Marketplace:
To verify the installation, follow the below instructions
In the address bar of the browser, type http://<your-ip-address>
You will see the Apache2 default page (see screenshot below)
Step 1. Connect to SSH:
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
In the navigation pane, choose Instances.
Select the instance and choose Connect.
Choose SSH Client
Copy the SSH command and paste it into the terminal.
ssh ubuntu@publicIP -i [Path of key pair file]
If it shows an access denied message run the following command, then run the above command again to connect via ssh.
chmod 400 [Path of key pair file]
Once launched in the Amazon EC2 Service, please connect to the instance via an SSH client using the ec2-user with the key pair associated at launch. Once connected as the ec2-user user, you will be able to sudo to the root user
Step 2. Activate SSL Encryption
Follow the steps to activate SSL Encryption on the system
1. Go to path /etc/httpd/conf/httpd.conf
2. Locate the "Listen 80" directive
3. Edit the below lines and replace "example" with your Domain name
<VirtualHost *:80> DocumentRoot "/var/www/html" ServerName "example.com" ServerAlias "www.example.com" </VirtualHost>
4. Now run the command to restart the HTTPD service
sudo systemctl restart httpd
5. Now run Certbot with below command
6. At the prompt Enter email address (used for urgent renewal and security notices),
and press Enter.
7. Agree to the Let's Encrypt Terms of Service at the prompt. Enter "A"
-------------------------------------------------------------------------- Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must agree in order to register with the ACME server at https://acme-v02.api.letsencrypt.org/directory --------------------------------------------------------------------------(A)gree/(C)ancel: A
8. Certbot displays the Common Name and Subject Alternative Name (SAN) that you provided in the VirtualHost block.
Which names would you like to activate HTTPS for? 1: example.com 2: www.example.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel):
9.Certbot displays the following output as it creates certificates and configures Apache. It then prompts you about redirecting HTTP queries to HTTPS.
Obtaining a new certificate Performing the following challenges: http-01 challenge for example.com http-01 challenge for www.example.com Waiting for verification... 1: No redirect - Make no further changes to the webserver configuration. 2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for new sites, or if you're confident your site works on HTTPS. You can undo this change by editing your web server's configuration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate number [1-2] then [enter] (press 'c' to cancel):
10. Certbot completes the configuration of Apache and reports success and other information
Congratulations! You have successfully enabled https://example.com and https://www.example.com
To monitor and assess application functions:-
a. Navigate to your Amazon EC2 console and verify that you're in the correct region.
b. Choose Instances and select your launched instance.
c. Select the server to display your metadata page and choose the Status checks tab at the bottom of the page to review if your status checks passed or failed.
For information about how to use the application, please visit:
For detailed information about managing and requesting increased service please visit: https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html