How Do You Install Apache Web Server on Your Ubuntu Server when You Receive an Error about “no installation candidate”?

Problem scenario
You tried this command: sudo apt-get install httpd
But you got this error message as a result:

“…E: Package ‘httpd’ has no installation candidate”

You tried this command as root:  

apt-get install apache2-bin 2.4.7-1ubuntu4.13

But you get this error message as a result:

Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package 2.4.7-1ubuntu4.13
E: Couldn’t find any package by regex ‘2.4.7-1ubuntu4.13’

How do you install Apache web server on your Ubuntu server?

How Do You Get the Apache Web Service to Start after a Cold Reboot?

Problem scenario
You want the Apache web service to start automatically after a Linux server is rebooted.  You want it to start automatically when you turn on a Linux server (after being off completely).  On Linux CentOS you have this entry in /etc/crontab:

@reboot            root         apachectl start

You notice that on reboots (warm or soft) it works.  But when you turn on your server after it has been off,

How Do You Get Apache Web Service to Start Automatically after a Reboot of a CentOS Linux Server?

Problem scenario  
You have to manually start Apache web server every time you do reboot the server.  You want the Apache web service to start automatically.

Solution
1.  Edit /etc/crontab.  Add the lowest line of these two (the line above is for reference):

# *  *  *  *  * user-name  command to be executed
@reboot         root       apachectl start

2.

How Do You Troubleshoot an Apache Web Service Problem when from a Web Browser You Receive the Error “The Address Is Restricted”?

Problem scenario
You are using Oracle VirtualBox on a Windows host.  You are using a Linux guest that is running Apache web server.  The Apache httpd service is running on the guest Linux server.  But when you are on the Windows host, you try to access the website, you get an error in the web browser.  This is the error you receive:

“This address is restricted
This address uses a network port which is normally used for purposes other than Web browsing.

How To Have The Apache Service Automatically Start When Its Docker Container Is Started

Goal:  To have Apache start when a Docker container starts running do the following (for Docker containers based on RHEL/CentOS/Fedora). 

Prerequisite:  The Docker container was created with the “-p 80:80” flag.  Other port numbers besides 80 will work.  The port numbers do not have to be the same.  They can be any number between 1 and 65535.  If there is no binding of the Docker host’s TCP ports to the container,

How To Potentially Solve an HTTP 403 Error on An Apache Server

Problem scenario:  You are trying to access a file on a website.  But you get the 403 Forbidden error every time.  What are some different things to look for to fix this problem?

Solution:

If you do not have access to the back-end of the web server, try these:

  1. Clear the cache/history from your web browser.
  2. Clear the cookies from your web browser.