FreeBSD Apache Jail: Connection refused: connect to listener on 0.0.0.0:80 Error and Solution

Q. I’m running Apache 2 server under FreeBSD jail. However, I see lots of warning error messages in /var/log/httpd-error.log as follows:

ADVERTISEMENTS

[Sat Sep 20 20:47:09 2008] [warn] (61)Connection refused: connect to listener on 0.0.0.0:80
[Sat Sep 20 20:47:10 2008] [warn] (61)Connection refused: connect to listener on 0.0.0.0:80
[Sat Sep 20 20:47:11 2008] [warn] (61)Connection refused: connect to listener on 0.0.0.0:80

How do stop all these warning messages flooding my Apache log files?

A. Under FreeBSD jail you do not have loopback address – 127.0.0.1 and 0.0.0.0. So do not configure any server including httpd with 0.0.0.0 or 127.0.0.1 IP address. You need to always set your actual, real IP. Open httpd.conf
# vi /usr/local/etc/apache22/httpd.conf
Find out Listen directive:
#Listen 12.34.56.78:80
Listen directive allows you to bind Apache to specific IP addresses and/or ports, instead of the default. Change this to Listen on specific IP addresses as shown below to prevent Apache from glomming onto all bound IP addresses i.e. 0.0.0.0 which is not available in jail, so if your IP is 202.54.1.2, enter:

Listen 202.54.1.2:80

Save and close the file. Restart apache:
# /usr/local/etc/rc.d/apache22 restart

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.