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

Posted on in Categories , , , last updated September 25, 2008

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:

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

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

A. Under FreeBSD jail you do not have loopback address – and So do not configure any server including httpd with or 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 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. which is not available in jail, so if your IP is, enter:


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

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

Leave a Comment