OVERVIEW
Apache Server is an open-source cross platform web server released under 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.
Features:
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
GOALS
One-click launch
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:
Pending...
GET STARTED
To verify the installation, follow the below instructions
Open browser
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
In a terminal window, use the ssh command to connect to the instance. You specify the user name for your instance, and the public DNS name or IPv6 address for your instance, the path and file name of the private key (.pem).
ssh admin@publicIP -i [Path of key pair file]
If it shows access denied message run the following command , then run the above command again to connect via ssh.
chmod 400 [Path of key pair file]
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
sudo certbot
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
Comments