Apache Troubleshooting Failed Test

It says syntax error on line 31 in httpd.conf, please check that.

@Inderpreet and others please spare your 5 minutes to help us :slightly_smiling_face:
Server1: Successfully started httpd service but unable to connect to Server1 from jump. Belo is the error.

Server2: Sucessful in all aspects of task.

Server3: Unable to start the service, dont know what to do as per the error :frowning:

Kindly request all to guide us. This task is very interesting for beginners like me. Completing this would give us a boos t to learn :). Thanks in advance.


For app 1 check if any kind of firewall is blocking the access, don’t try to stop the firewall just try to add necessary rules.

For app 3 see the line no. 31 in Apache config, it has some issues as per logs you shared.

Hi @yogendra, apologies in advance for the long-winded response…

I’d like to add a couple other tips, in addition to what @Inderpreet has already stated, and suggest how you might be able to provide info which might help others assist you better…

For example, you mentioned “Server1: Successfully started httpd service but unable to connect to Server1 from jump. Belo is the error.” but I have no idea how or whether you did that correctly since you don’t have a screenshot of how you verified that - your screenshots only show attempts to connect from the jumphost. Having said that, the fact that you provided screenshots is great - that’s what made me want to chime in and at least attempt to help compared to having no point of reference when people just say it failed…

As for troubleshooting tips, this is my general high level process, I hope you find something helpful from this…

As a general rule of thumb, I always verify everything locally before attempting to verify from a remote host, and it really helps to see both what and how you verified each step when assisting with troubleshooting. Once you’ve established that everything works locally, you can (usually) narrow down remote access issues to firewall, app config (wp-config, for example), or database database grants for remote access.

I’ve also found it helpful to use ‘systemctl -l status servicename’ (notice the -l flag) so the status messages don’t get truncated. The output should always point out the problematic line, so it’s usually just a matter of determining what’s wrong with that line number in the file. Here’s a couple troubleshooting tips in order of what I’ve found quick and helpful when encountering a new technology:

  1. Google for a sample config file - find the same config item in the sample and compare the syntax being sure to make note of formatting (some file formats are whitespace-sensitive), upper/lower-case, whether values are quoted or unquoted, whether they end with a ‘;’ etc…
  2. If you can’t find that compare the same config file across app server 1,2, and 3. So far, my experience has been that the app servers have different configuration errors, which means that the problematic line number is probably (not guaranteed to be) correct on one of the other to app servers…

I hope this helps,


Hi @peterwhite and @Inderpreet

Big Thanks for your time and detailed analysis.

I tried it another way and made it happened.

Steps followed: I uninstalled (yum remove httpd -y) and reinstalled (yum install httpd -y) httpd service and added required port (was 3003 for my task) in httpd.conf file and restarted the service (systemctl restart httpd).
Later i installed firewalld (yum install firewalld) and added the port permanently with this command " firewall-cmd --zone=public --permanent – add - port =3003/tcp".

Task was successful. :slight_smile:

Hi @yogendra, I’m glad to hear that you got everything working!

As a side note, installation of firewalld should have been unnecessary (though it’s a great learning experience) unless the task description specifically stated to install firewalld. The reason being is that all ports should be open by default.

Off the top of my head, the only exception to that would be if the task description does not mention installing a firewall (firewalld or iptables) but you encounter remote connectivity issues and discover there’s already a misconfigured running firewall service in place. In that case, I’d assume the expectation would be to correct the firewall configuration as opposed to disabling it…

Happy to help,

Hi All,

I am still facing issue & not able to resolve the error “httpd[331]: (98)Address already in use: AH00072: make_sock: could not bind to address” when trying to restart the httpd service. Any help/pointers will be appreciated.

I tried the following to resolve the issue:

  1. In httpd.conf uncommented the ServerName & added the App Server IP:Port Number. Output of sudo httpd -t is giving Syntax OK but restart is failing due to above error.

  2. Even I tried the steps uninstalling & reinstalling Apache but no success.


Hi @pmpcert2013,

I haven’t encountered that error on KodeKloud Engineer, yet(?), but I’d suggest trying the tips found in https://www.cyberciti.biz/faq/unix-linux-check-if-port-is-in-use-command/ to determine what’s causing the port conflict.

Hope that helps,

Thanks @peterwhite for the hint. I was working on the similar line & even after after following the given article it didn’t resolve. I was not able to kill the process listening to the same port but Apache restarted after this try. So, at the end I was able to restart Apache. I was able to successfully complete the task. Thanks once again for help.


1 Like

@pmpcert2013, I’m glad to hear that everything worked out!

Along those lines, I’ve encountered similar issues (only once, IIRC) where a service failed to restart the first time, but succeeded the second without making and configuration changes…

Here is my one i was able to access all the there URL’s however task still failed not sure why


@bkodekloud what is your KKE user name ?

Bipin is my username , my maild id is bkodekloudeng@gmail.com

sudo httpd -t gave error message: set the servername directive globally to suppress this message.

This task is killing me from past 4 hrs and no success in bringing the apache service in 1 app server yet.