<\/span><\/h2>\nIf you don’t have a package on your system that listens to port 80 on your server, you’ll just get a message saying that the “Site can’t be reached”. To check, first find your IP address by running the following command:<\/p>\n
ifconfig<\/pre>\nThis should give you an output like this:<\/p>\n
<\/p>\n
The numbers in red in the screenshot above represent the IP address for your server. Plugging this into the browser before installing Apache, I get nothing as shown here:<\/p>\n
<\/p>\n
<\/p>\n
This is because there’s nothing attached to port 80 on my system. Port 80 is the default port on which all browsers make their HTTP requests. HTTPS requests, on the other hand, go to port no 442. After we finish installing Apache on our server, the above screenshot will look very different!<\/p>\n
<\/span>Step 1: Installing the httpd Package<\/span><\/h2>\nOn CentOS, the Apache server goes by the “httpd” package name. On Ubuntu, the package is called “apache2”. It doesn’t need the extended “epel-release” repository, and can be installed directly from the base packages with the following command:<\/p>\n
sudo yum install httpd<\/pre>\nThis will run through the installation process and ask for confirmation like this:<\/p>\n
<\/p>\n
You can see here that it’s not large. Just one file, and three dependencies with a total of 31M.<\/p>\n