Search My Techie Guy

Saturday, October 7, 2017

RRDTool Says: ERROR: Opening x.rrd No such file or directory - Creating Cacti Graphs

Summary:

I faced this issue on a new cacti installation recently, at this point i had successfully finished adding the device to be monitored by cacti.
Cacti was also able to successfully query the snmp interface statistics for the test device i added. The challenge came when i added my first graph.  
I was getting the error below:


 "RRDTool Says: ERROR: opening '/var/www/html/rra/t_traffic_in_6.rrd': No such file or directory"

Problem or Goal:


Cause:

I couldn't straight away tell the cause, but what was obvious is that the ".rrd" files were not being created whenever a graph was created!
Another symptom worth mentioning is that my test device status was showing "unknown" instead if "up", yet the snmp/ping query was successful!

Solution:

I tried a few things so am a bit confused myself on what exactly did the trick!!
but here is a list of checks to guide you in case you find yourself in a similar situation.

1. Check the HTTPD error log ("error_log") for any hints relating to this error

This is usually found under "/var/log/httpd/"


 # tail /var/log/httpd/error_log

2. Check the cacti log ("cacti.log") for any hints relating to this error
3. Make sure the directory "rra" is owned by user "cacti" and has "rwx" privileges


# cd /var/lib/cacti/
# ls -ltr
total 16
drwxr-xr-x. 6 apache apache 4096 Sep 22 22:34 cache
lrwxrwxrwx. 1 root   root     24 Sep 22 22:34 include -> /usr/share/cacti/include
lrwxrwxrwx. 1 root   root     20 Sep 22 22:34 lib -> /usr/share/cacti/lib
drwxr-xr-x. 2 apache apache 4096 Sep 22 22:34 scripts
drwxr-xr-x. 2 root   root   4096 Sep 22 22:50 cli
drwxr-xr-x. 2 cacti  root   4096 Sep 26 18:33 rra
  
4. Check the cacti crone tab and try to run the "poller.php" script as user "cacti" and again as user "root", which ever runs smoothly without giving you errors should be the one to use in running the "poller.php" crone job.
For my case, whenever i would attempted to run the "poller.php" script as user "cacti", i would get the following mysql error:


# /usr/bin/php /usr/share/cacti/poller.php

"FATAL: Connection to Cacti database failed. Please ensure the database is running and your credentials in config.php are valid."

But as user "root", my "poller.php" script would run ok.
So i edited my cacti crone tab to look like this:


# cd /etc/cron.d
# vi cacti 
*/5 * * * * root /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

Problem Solved?

Yes, the ".rrd" files were created after running the poller.php script successfully.
For the new graphs, i get the same RRD ERROR on the GUI!, but when the poller.php runs (which happens every 5 mins according to the crone tab), the ".rrd" files are created for the new graphs and the graphs start plotting statistics successfully.

Immediately after creating the graph i see the same error:



After waiting the 5 mins interval, the poller.php runs and the ".rrd" files are created for that graph, i get normal graphs.



The difference is that before i edited the cacti crone tab to be ran by user "root", even waiting for the 5 mins interval was not clearing the error.

I know this is not the perfect way, but if you manage to figure out why the ".rrd" are not created at the instant you click "create" in the cacti GUI, you can leave for me a comment and i will be happy to fine tune my system.

Thursday, October 5, 2017

Cacti Data Query [SNMP - Interface Statistics] No Items Found - Solved

Summary:

I have just finished a new installation of cacti and it was time to add the devices to be monitored.
I successfully added the device, and could get some snmp information through but the challenge came when i tried to create graphs for this device.

When i ran the data query (SNMP - Interface Statistics), i got "No Items Found"

Problem or Goal:

Data Query [SNMP - Interface Statistics]
No Items Found



Cause:

When i ran snmpwalk from the cacti server CLI, i discovered that my community was not able to query for interface statistics.
You can try this command on your server if you have similar challenges.
Remember to substitute the string "public" with your SNMP community string that you configured on your target device.

Also subsititute the IP address "10.10.10.20" with your target device's IP address



# snmpwalk -v2c -c public 10.10.10.20 1.3.6.1.2.1.2.2.1.6
IF-MIB::ifPhysAddress = No Such Object available on this agent at this OID


Solution: 

The solution to this problem is to make sure the SNMP community you configured on your target device has access to all SNMP Objects.


# snmpwalk -v2c -c public 10.10.10.20 1.3.6.1.2.1.2.2.1.6
IF-MIB::ifPhysAddress.1 = STRING: 0:30:88:20:b4:fb
IF-MIB::ifPhysAddress.2 = STRING: 0:30:88:20:b4:fc
IF-MIB::ifPhysAddress.8 = STRING: 0:30:88:4:93:3a
IF-MIB::ifPhysAddress.12 = STRING: 0:30:88:20:b4:ff
IF-MIB::ifPhysAddress.13 = STRING: 0:30:88:20:b4:fd
IF-MIB::ifPhysAddress.18 = STRING: 0:30:88:17:ee:4f
IF-MIB::ifPhysAddress.19 = STRING: 0:30:88:17:ee:50
IF-MIB::ifPhysAddress.20 = STRING: 0:30:88:17:ee:51
IF-MIB::ifPhysAddress.22 = STRING: 0:30:88:17:ee:53
IF-MIB::ifPhysAddress.25 = STRING: 0:30:88:20:b4:fe
IF-MIB::ifPhysAddress.26 = STRING: 0:30:88:17:ee:52
IF-MIB::ifPhysAddress.67108864 = STRING: 
IF-MIB::ifPhysAddress.67108866 = STRING: 
IF-MIB::ifPhysAddress.67108867 = STRING: 
IF-MIB::ifPhysAddress.67108903 = STRING: 
IF-MIB::ifPhysAddress.67108911 = STRING: 
IF-MIB::ifPhysAddress.67895292 = STRING: 
IF-MIB::ifPhysAddress.67895328 = STRING: 
IF-MIB::ifPhysAddress.67895336 = STRING: 
IF-MIB::ifPhysAddress.68026447 = STRING: 
IF-MIB::ifPhysAddress.134226605 = STRING: 0:30:88:17:ee:4f
IF-MIB::ifPhysAddress.134226607 = STRING: 
IF-MIB::ifPhysAddress.134226609 = STRING: 
IF-MIB::ifPhysAddress.134226610 = STRING: 
IF-MIB::ifPhysAddress.134226611 = STRING: 
IF-MIB::ifPhysAddress.134226612 = STRING: 
IF-MIB::ifPhysAddress.134226615 = STRING: 
IF-MIB::ifPhysAddress.134226616 = STRING: 
IF-MIB::ifPhysAddress.134226617 = STRING: 
IF-MIB::ifPhysAddress.134226621 = STRING: 
IF-MIB::ifPhysAddress.134226623 = STRING: 
IF-MIB::ifPhysAddress.134226624 = STRING: 
IF-MIB::ifPhysAddress.134226626 = STRING: 
IF-MIB::ifPhysAddress.134226629 = STRING: 
IF-MIB::ifPhysAddress.134226630 = STRING: 
IF-MIB::ifPhysAddress.134226631 = STRING: 
IF-MIB::ifPhysAddress.134226632 = STRING: 
IF-MIB::ifPhysAddress.134226633 = STRING: 
IF-MIB::ifPhysAddress.134226634 = STRING: 
IF-MIB::ifPhysAddress.134226635 = STRING: 
IF-MIB::ifPhysAddress.134226636 = STRING: 
IF-MIB::ifPhysAddress.134226637 = STRING: 
IF-MIB::ifPhysAddress.134226638 = STRING: 
IF-MIB::ifPhysAddress.134226639 = STRING: 
IF-MIB::ifPhysAddress.134234110 = STRING: 
IF-MIB::ifPhysAddress.134234140 = STRING: 
IF-MIB::ifPhysAddress.134238211 = STRING: 
IF-MIB::ifPhysAddress.134238241 = STRING: 
IF-MIB::ifPhysAddress.134238257 = STRING: 
IF-MIB::ifPhysAddress.134242352 = STRING: 
IF-MIB::ifPhysAddress.134242355 = STRING: 
IF-MIB::ifPhysAddress.134242375 = STRING: 
IF-MIB::ifPhysAddress.134242393 = STRING: 
IF-MIB::ifPhysAddress.134242394 = STRING: 
IF-MIB::ifPhysAddress.134242396 = STRING: 
IF-MIB::ifPhysAddress.134242397 = STRING: 
IF-MIB::ifPhysAddress.134242444 = STRING: 
IF-MIB::ifPhysAddress.134242452 = STRING: 
IF-MIB::ifPhysAddress.134242453 = STRING: 
IF-MIB::ifPhysAddress.134242489 = STRING: 
IF-MIB::ifPhysAddress.134246590 = STRING: 
IF-MIB::ifPhysAddress.134246608 = STRING: 
IF-MIB::ifPhysAddress.134246627 = STRING: 
IF-MIB::ifPhysAddress.134246663 = STRING: 
IF-MIB::ifPhysAddress.134247040 = STRING: 
IF-MIB::ifPhysAddress.134247058 = STRING: 
IF-MIB::ifPhysAddress.134247060 = STRING: 
IF-MIB::ifPhysAddress.134247066 = STRING: 
IF-MIB::ifPhysAddress.134247067 = STRING: 
IF-MIB::ifPhysAddress.134247080 = STRING: 
IF-MIB::ifPhysAddress.134247090 = STRING: 
IF-MIB::ifPhysAddress.134247091 = STRING: 
IF-MIB::ifPhysAddress.134247095 = STRING: 
IF-MIB::ifPhysAddress.134247107 = STRING: 
IF-MIB::ifPhysAddress.134247113 = STRING: 
IF-MIB::ifPhysAddress.134247116 = STRING: 
IF-MIB::ifPhysAddress.134247117 = STRING: 
IF-MIB::ifPhysAddress.134247118 = STRING: 
IF-MIB::ifPhysAddress.134247119 = STRING: 
IF-MIB::ifPhysAddress.134247121 = STRING: 
IF-MIB::ifPhysAddress.134247122 = STRING: 
IF-MIB::ifPhysAddress.134247123 = STRING: 
IF-MIB::ifPhysAddress.134247125 = STRING: 
IF-MIB::ifPhysAddress.134247126 = STRING: 
IF-MIB::ifPhysAddress.134247127 = STRING: 
IF-MIB::ifPhysAddress.134247128 = STRING: 
IF-MIB::ifPhysAddress.134247129 = STRING: 
IF-MIB::ifPhysAddress.134247130 = STRING: 
IF-MIB::ifPhysAddress.134247132 = STRING: 
IF-MIB::ifPhysAddress.134247135 = STRING: 
IF-MIB::ifPhysAddress.134247136 = STRING: 
IF-MIB::ifPhysAddress.134247137 = STRING: 
IF-MIB::ifPhysAddress.134247139 = STRING: 
IF-MIB::ifPhysAddress.134247140 = STRING: 
IF-MIB::ifPhysAddress.134247141 = STRING: 
IF-MIB::ifPhysAddress.134247142 = STRING: 
IF-MIB::ifPhysAddress.134247143 = STRING: 
IF-MIB::ifPhysAddress.134247144 = STRING: 
IF-MIB::ifPhysAddress.134247145 = STRING: 
IF-MIB::ifPhysAddress.134247146 = STRING: 
IF-MIB::ifPhysAddress.134247147 = STRING: 
IF-MIB::ifPhysAddress.134247148 = STRING: 
IF-MIB::ifPhysAddress.134247149 = STRING: 
IF-MIB::ifPhysAddress.134247150 = STRING: 
IF-MIB::ifPhysAddress.134247152 = STRING: 
IF-MIB::ifPhysAddress.134247153 = STRING: 
IF-MIB::ifPhysAddress.134247154 = STRING: 
IF-MIB::ifPhysAddress.134247155 = STRING: 
IF-MIB::ifPhysAddress.134247156 = STRING: 
IF-MIB::ifPhysAddress.134247170 = STRING: 
IF-MIB::ifPhysAddress.134247171 = STRING: 
IF-MIB::ifPhysAddress.134247175 = STRING: 
IF-MIB::ifPhysAddress.134247187 = STRING: 
IF-MIB::ifPhysAddress.134247193 = STRING: 
IF-MIB::ifPhysAddress.134247196 = STRING: 
IF-MIB::ifPhysAddress.134247197 = STRING: 
IF-MIB::ifPhysAddress.134247198 = STRING: 
IF-MIB::ifPhysAddress.134247199 = STRING: 
IF-MIB::ifPhysAddress.134247201 = STRING: 
IF-MIB::ifPhysAddress.134247202 = STRING: 
IF-MIB::ifPhysAddress.134247203 = STRING: 
IF-MIB::ifPhysAddress.134247205 = STRING: 
IF-MIB::ifPhysAddress.134247206 = STRING: 
IF-MIB::ifPhysAddress.134247207 = STRING: 
IF-MIB::ifPhysAddress.134247208 = STRING: 
IF-MIB::ifPhysAddress.134247209 = STRING: 
IF-MIB::ifPhysAddress.134247210 = STRING: 
IF-MIB::ifPhysAddress.134247212 = STRING: 
IF-MIB::ifPhysAddress.134247215 = STRING: 
IF-MIB::ifPhysAddress.134247216 = STRING: 
IF-MIB::ifPhysAddress.134247217 = STRING: 
IF-MIB::ifPhysAddress.134247219 = STRING: 
IF-MIB::ifPhysAddress.134247220 = STRING: 
IF-MIB::ifPhysAddress.134247221 = STRING: 
IF-MIB::ifPhysAddress.134247222 = STRING: 
IF-MIB::ifPhysAddress.134247223 = STRING: 
IF-MIB::ifPhysAddress.134247224 = STRING: 
IF-MIB::ifPhysAddress.134247225 = STRING: 
IF-MIB::ifPhysAddress.134247226 = STRING: 
IF-MIB::ifPhysAddress.134247227 = STRING: 
IF-MIB::ifPhysAddress.134247228 = STRING: 
IF-MIB::ifPhysAddress.134247229 = STRING: 
IF-MIB::ifPhysAddress.134247230 = STRING: 
IF-MIB::ifPhysAddress.134247232 = STRING: 
IF-MIB::ifPhysAddress.134247233 = STRING: 
IF-MIB::ifPhysAddress.134247234 = STRING: 
IF-MIB::ifPhysAddress.134247235 = STRING: 
IF-MIB::ifPhysAddress.134247236 = STRING: 
IF-MIB::ifPhysAddress.134247246 = STRING: 
IF-MIB::ifPhysAddress.134247247 = STRING: 
IF-MIB::ifPhysAddress.134247248 = STRING: 
IF-MIB::ifPhysAddress.134247249 = STRING: 
IF-MIB::ifPhysAddress.134247250 = STRING: 
IF-MIB::ifPhysAddress.134247251 = STRING: 
IF-MIB::ifPhysAddress.134247252 = STRING: 
IF-MIB::ifPhysAddress.134247253 = STRING: 
IF-MIB::ifPhysAddress.134247254 = STRING: 
IF-MIB::ifPhysAddress.134247255 = STRING: 
IF-MIB::ifPhysAddress.134247274 = STRING: 
IF-MIB::ifPhysAddress.134247275 = STRING: 
IF-MIB::ifPhysAddress.134247276 = STRING: 
IF-MIB::ifPhysAddress.134247283 = STRING: 
IF-MIB::ifPhysAddress.134247284 = STRING: 
IF-MIB::ifPhysAddress.134247285 = STRING: 
IF-MIB::ifPhysAddress.134247286 = STRING: 
IF-MIB::ifPhysAddress.134247287 = STRING: 
IF-MIB::ifPhysAddress.134247289 = STRING: 
IF-MIB::ifPhysAddress.134247290 = STRING: 
IF-MIB::ifPhysAddress.134247291 = STRING: 
IF-MIB::ifPhysAddress.134247292 = STRING: 
IF-MIB::ifPhysAddress.134247294 = STRING: 
IF-MIB::ifPhysAddress.134247295 = STRING: 
IF-MIB::ifPhysAddress.134247296 = STRING: 
IF-MIB::ifPhysAddress.134247372 = STRING: 
IF-MIB::ifPhysAddress.134247373 = STRING: 
IF-MIB::ifPhysAddress.134247374 = STRING: 
IF-MIB::ifPhysAddress.134247375 = STRING: 
IF-MIB::ifPhysAddress.134247376 = STRING: 
IF-MIB::ifPhysAddress.134247377 = STRING: 
IF-MIB::ifPhysAddress.134247381 = STRING: 
IF-MIB::ifPhysAddress.134247382 = STRING: 
IF-MIB::ifPhysAddress.134247383 = STRING: 
IF-MIB::ifPhysAddress.134247410 = STRING: 
IF-MIB::ifPhysAddress.134247411 = STRING: 
IF-MIB::ifPhysAddress.134247412 = STRING: 
IF-MIB::ifPhysAddress.134247468 = STRING: 
IF-MIB::ifPhysAddress.134247469 = STRING: 
IF-MIB::ifPhysAddress.134247470 = STRING: 
IF-MIB::ifPhysAddress.134262781 = STRING: 
IF-MIB::ifPhysAddress.134262782 = STRING: 
IF-MIB::ifPhysAddress.134262783 = STRING: 
IF-MIB::ifPhysAddress.134262784 = STRING: 
IF-MIB::ifPhysAddress.134262786 = STRING: 
IF-MIB::ifPhysAddress.134262789 = STRING: 
IF-MIB::ifPhysAddress.134262790 = STRING: 
IF-MIB::ifPhysAddress.134262791 = STRING: 
IF-MIB::ifPhysAddress.134262793 = STRING: 
IF-MIB::ifPhysAddress.134262794 = STRING: 
IF-MIB::ifPhysAddress.134262795 = STRING: 
IF-MIB::ifPhysAddress.134262797 = STRING: 
IF-MIB::ifPhysAddress.134262798 = STRING: 
IF-MIB::ifPhysAddress.134262799 = STRING: 
IF-MIB::ifPhysAddress.134262800 = STRING: 
IF-MIB::ifPhysAddress.134262802 = STRING: 
IF-MIB::ifPhysAddress.134262804 = STRING: 
IF-MIB::ifPhysAddress.134262806 = STRING: 
IF-MIB::ifPhysAddress.134262807 = STRING: 
IF-MIB::ifPhysAddress.134262814 = STRING: 
IF-MIB::ifPhysAddress.134262815 = STRING: 
IF-MIB::ifPhysAddress.134262816 = STRING: 
IF-MIB::ifPhysAddress.134262819 = STRING: 
IF-MIB::ifPhysAddress.134262821 = STRING: 
IF-MIB::ifPhysAddress.134262822 = STRING: 
IF-MIB::ifPhysAddress.134262824 = STRING: 
IF-MIB::ifPhysAddress.134262825 = STRING: 
IF-MIB::ifPhysAddress.134262827 = STRING: 
IF-MIB::ifPhysAddress.134262828 = STRING: 
IF-MIB::ifPhysAddress.134262838 = STRING: 
IF-MIB::ifPhysAddress.134262839 = STRING: 
IF-MIB::ifPhysAddress.134262840 = STRING: 
IF-MIB::ifPhysAddress.134262855 = STRING: 
IF-MIB::ifPhysAddress.134262856 = STRING: 
IF-MIB::ifPhysAddress.134262857 = STRING: 
IF-MIB::ifPhysAddress.134262865 = STRING: 
IF-MIB::ifPhysAddress.134262866 = STRING: 
IF-MIB::ifPhysAddress.134262867 = STRING: 
IF-MIB::ifPhysAddress.134262868 = STRING: 
IF-MIB::ifPhysAddress.134262870 = STRING: 
IF-MIB::ifPhysAddress.134262871 = STRING: 
IF-MIB::ifPhysAddress.134262872 = STRING: 
IF-MIB::ifPhysAddress.134266870 = STRING: 
IF-MIB::ifPhysAddress.134266871 = STRING: 
IF-MIB::ifPhysAddress.134266873 = STRING: 
IF-MIB::ifPhysAddress.134266886 = STRING: 
IF-MIB::ifPhysAddress.134266914 = STRING: 
IF-MIB::ifPhysAddress.134266918 = STRING: 
IF-MIB::ifPhysAddress.134266919 = STRING: 
IF-MIB::ifPhysAddress.134266920 = STRING: 
IF-MIB::ifPhysAddress.134266921 = STRING: 
IF-MIB::ifPhysAddress.134266923 = STRING: 
IF-MIB::ifPhysAddress.134266924 = STRING: 
IF-MIB::ifPhysAddress.134266925 = STRING: 
IF-MIB::ifPhysAddress.134266935 = STRING: 
IF-MIB::ifPhysAddress.134266937 = STRING: 
IF-MIB::ifPhysAddress.134266938 = STRING: 
IF-MIB::ifPhysAddress.134266939 = STRING: 
IF-MIB::ifPhysAddress.134266940 = STRING: 
IF-MIB::ifPhysAddress.134266941 = STRING: 
IF-MIB::ifPhysAddress.134266942 = STRING: 
IF-MIB::ifPhysAddress.134266944 = STRING: 
IF-MIB::ifPhysAddress.134266945 = STRING: 
IF-MIB::ifPhysAddress.134266946 = STRING: 
IF-MIB::ifPhysAddress.134270965 = STRING: 
IF-MIB::ifPhysAddress.134270966 = STRING: 
IF-MIB::ifPhysAddress.134270967 = STRING: 
IF-MIB::ifPhysAddress.134270968 = STRING: 
IF-MIB::ifPhysAddress.134270969 = STRING: 
IF-MIB::ifPhysAddress.134270970 = STRING: 
IF-MIB::ifPhysAddress.134270971 = STRING: 
IF-MIB::ifPhysAddress.134270978 = STRING: 
IF-MIB::ifPhysAddress.134270979 = STRING: 
IF-MIB::ifPhysAddress.134270983 = STRING: 
IF-MIB::ifPhysAddress.134270984 = STRING: 
IF-MIB::ifPhysAddress.134270985 = STRING: 
IF-MIB::ifPhysAddress.134270986 = STRING: 
IF-MIB::ifPhysAddress.134270988 = STRING: 
IF-MIB::ifPhysAddress.134270989 = STRING: 
IF-MIB::ifPhysAddress.134270990 = STRING: 
IF-MIB::ifPhysAddress.134270991 = STRING: 
IF-MIB::ifPhysAddress.134270992 = STRING: 
IF-MIB::ifPhysAddress.134270993 = STRING: 
IF-MIB::ifPhysAddress.134270994 = STRING: 
IF-MIB::ifPhysAddress.134270995 = STRING: 
IF-MIB::ifPhysAddress.134270996 = STRING: 
IF-MIB::ifPhysAddress.134270997 = STRING: 

Problem Solved?

Yes, i was able to sort out my snmp configuration on my target device and when i ran the data query on the cacti GUI, i was able to discovery my device's interface statistics.


Wednesday, October 4, 2017

How to make HTTPD (Apache) service to listen on multiple port numbers - Linux?


Summary:

In this post, we are going to make our HTTPD service listen on multiple port numbers, for example 80, 8080, 443, and 9008

Problem or Goal:

Our aim is to make our HTTPD service (Apache) to listen on multiple service port numbers 80, 8080, 443, 9008

Cause:

In so many applications, you will find yourself with a requirement to make your HTTPD service to listen on multiple port numbers, it could be for security reasons or just trying to fine tune or load balance your server. 

Solution:

Before we change the configuration, let's run a simple test to check which ports are open? and which ones are not!

Testing port 80, OK
# wget localhost:80
--2017-10-04 16:08:11--  http://localhost/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5404 (5.3K) [text/html]
Saving to: “index.html.13”

100%[=====================================================================================================================================================>] 5,404       --.-K/s   in 0s      

2017-10-04 16:08:11 (293 MB/s) - “index.html.13” saved [5404/5404]

Testing port 8080, Not OK
# wget localhost:8080
--2017-10-04 15:24:52--  http://localhost:8080/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:8080... failed: Connection refused.
Connecting to localhost|127.0.0.1|:8080... failed: Connection refused.

Testing port 443, Not OK
# wget localhost:443
--2017-10-04 15:25:00--  http://localhost:443/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:443... failed: Connection refused.
Connecting to localhost|127.0.0.1|:443... failed: Connection refused.

Testing port 9008, Not OK
# wget localhost:9008
--2017-10-04 15:25:08--  http://localhost:9008/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:9008... failed: Connection refused.
Connecting to localhost|127.0.0.1|:9008... failed: Connection refused.

Now let us make the server listen on all the above ports that tested "Not Ok"

Login into your server as user "root" or make sure you have "sudo" privileges!
Access the "httpd.conf" file located under "/etc/httpd/conf" and edit it to include the new port numbers.
see screen shoots below:

Before:

After editing:

Remember to restart your HTTPD service:
# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]


Problem Solved?

Let's repeat the connection tests:

Testing port 80, OK
# wget localhost:80
--2017-10-04 16:08:11--  http://localhost/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5404 (5.3K) [text/html]
Saving to: “index.html.13”

100%[=====================================================================================================================================================>] 5,404       --.-K/s   in 0s      

2017-10-04 16:08:11 (293 MB/s) - “index.html.13” saved [5404/5404]

Testing port 8080, OK
# wget localhost:8080
--2017-10-04 16:08:19--  http://localhost:8080/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5404 (5.3K) [text/html]
Saving to: “index.html.14”

100%[=====================================================================================================================================================>] 5,404       --.-K/s   in 0s      

2017-10-04 16:08:19 (330 MB/s) - “index.html.14” saved [5404/5404]

Testing port 443,  OK
# wget localhost:443
--2017-10-04 16:08:23--  http://localhost:443/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5404 (5.3K) [text/html]
Saving to: “index.html.15”

100%[=====================================================================================================================================================>] 5,404       --.-K/s   in 0s      

2017-10-04 16:08:23 (382 MB/s) - “index.html.15” saved [5404/5404]

Testing port 9008, OK
# wget localhost:9008
--2017-10-04 16:08:27--  http://localhost:9008/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:9008... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5404 (5.3K) [text/html]
Saving to: “index.html.16”

100%[=====================================================================================================================================================>] 5,404       --.-K/s   in 0s      

2017-10-04 16:08:27 (353 MB/s) - “index.html.16” saved [5404/5404]

Our server can successfully listen on ports 80, 8080, 443 and 9008