Install and configure Apache on an Instance
A step-by-step guide to installing and configuring Apache on an instance
Last Update 19 days ago
Apache is the most popular web server for the Linux platform and installing Apache on Ubuntu is easier than you think it is.
The following are required before you set up Apache on an instance:
1. An instance is available with the required configuration and operating system.
2. A Security Group with the correct Egress and Ingress rules has been created and associated with the instance. Refer to the Create a Security Group article.
3. If the Web Server needs to be accessed from the Internet, make sure you have created and assigned a Floating IP to the instance. Refer to the Create a Floating IP article.
Configuration and Operating System
Web servers require higher configuration to server web pages faster. However, this will be determined by several factors like:
- expected load on the server
- concurrent hits
- acceptable response time
- if it is a Intranet or Internet facing server, etc.
The recommendation is to start with low and upsize as needed.
Apache works best in Linux. Choose a Linux distribution based on the requirements.
Before beginning with the installation, make sure you have a Security Group with these two rules and that it is associated with the instance.
1. Egress (Outbound) rule to any IP/Port. This is created by default and is required for public repo access to install Apache.
2. Ingress (Inbound) rule to HTTP/HTTPS (80/443) ports from any IP or specific IPs as required. This is required for the web server to serve requests.
Your Security Group should look like this. The blue highlight are the default Egress rules and the red highlight are the newly created Ingress rules.
To install Apache, connect to the instance using Putty.
Before installing any software, we need to make sure that the package repo is updated. Run the following command:
This command updates the package repo and ensure that the latest packages and their latest versions and releases are available.
Next, run the actual install command:
If the command completes successfully, it means that Apache has been installed and you can start using it. When Apache is installed, it is configured with default settings and starts serving web requests immediately.
Open a browser window in your computer and hit the Floating IP that was assigned to the instance.
Run two commands. That's all you had to do to set up Apache in your new instance.