Forum

listen(http(s)): Address already in use

Sefk
24 December 2012, 14:33
Hello Hugo,

I am trying to activate ipv6 address on hiawatha. When i trying to start hiawatha it gives error "listen(http(s)): Address already in use". I am trying to make a generic enviroment becouse ip address can be changed so i give interface ip "::1". I can not give a specific ip address. Hiwatha is working on loopback.
Conf file is below :
# Hiawatha main configuration file
#

# GENERAL SETTINGS
#
ConnectionsTotal = 150
ConnectionsPerIP = 10
SystemLogfile = /aaa/srv/var/log/system.log
GarbageLogfile = /aaa/srv/var/log/garbage.log

# BINDING SETTINGS
#
Binding {
BindingID = port5602
Port = 5602
MaxRequestSize = 12000
TimeForRequest = 50

}


Binding {
Port = 5602
MaxRequestSize = 12000
TimeForRequest = 50
Interface = ::1
}


# COMMON GATEWAY INTERFACE (CGI) SETTINGS
#
CGIhandler = /aaa/srv/bin/ssi-cgi:shtml
CGIextension = cgi
TimeForCGI = 350

# DEFAULT WEBSITE
#
Hostname = 127.0.0.1
WebsiteRoot = /aaa/srv/var/www
StartFile = index.shtml
AccessLogfile = /aaa/srv/var/log/access.log
ErrorLogfile = /aaa/srv/var/log/error.log
ExploitLogfile = /karel/srv/var/log/exploit.log
ExecuteCGI = yes



Hiawatha version: 8.5
Operating System: OpenSuse 10.1
Hugo Leisink
24 December 2012, 14:46
When not specifying an interface in a Binding block, Hiawatha will bind all available interfaces. When a second block has the interface option, that interface is already binded by the previous binding block. To solve this, specify an interface in the first binding block.
Sefk
24 December 2012, 14:51
I wrote first binding Interface = 127.0.0.1 also and then i manage to start hiawatha but now hiwatha is working and listen 5602 from both ::1 and 127.0.0.1 . Before i add the v6 address it only listen 0.0.0.0:5602 and i could reach the site . Now i can not reach to the website neither v4 nor v6 address.

# BINDING SETTINGS
#
Binding {
BindingID = port5602
Port = 5602
MaxRequestSize = 12000
TimeForRequest = 50
Interface = 127.0.0.1
}

Binding {
Port = 5602
MaxRequestSize = 12000
TimeForRequest = 50
Interface = ::1
}


# COMMON GATEWAY INTERFACE (CGI) SETTINGS
#
CGIhandler = /aaa/srv/bin/ssi-cgi:shtml
CGIextension = cgi
TimeForCGI = 350

# DEFAULT WEBSITE
#
Hostname = 127.0.0.1
........
Hugo Leisink
24 December 2012, 14:53
You should add a binding block for each interface. Use 'ifconfig' to see what interfaces are available on your system.
Sefk
24 December 2012, 16:17
I found a link that is the same thing i am trying to ask you. http://www.hiawatha-webserver.org/forum/topic/978
You said that you will solve this problem. Is there any development on that issue? My version is 8.5

Here is my new configuration : I got the same error Address already in use.

Binding {
BindingID = port5602
Port = 5602
MaxRequestSize = 12000
TimeForRequest = 50
Interface = 0.0.0.0
}

Binding {
Port = 5602
MaxRequestSize = 12000
TimeForRequest = 50
Interface = ::
}


# COMMON GATEWAY INTERFACE (CGI) SETTINGS
#
CGIhandler = /aaa/srv/bin/ssi-cgi:shtml
CGIextension = cgi
TimeForCGI = 350

# DEFAULT WEBSITE
#
Hostname = 127.0.0.1

I tried different ports also

Binding {
BindingID = port5602
Port = 5602
MaxRequestSize = 12000
TimeForRequest = 50
Interface = 0.0.0.0
}

Binding {
Port = 5603
MaxRequestSize = 12000
TimeForRequest = 50
Interface = ::
}

and i could reach web site from v4 address but can not reach from ipv6 address.

Hugo Leisink
24 December 2012, 17:19
There is no fix for it. The issue is not in Hiawatha, but in the operating system. It's not really a bug, it's just how it works. As soon as you start using the interface option, use it for all bindings and specify a binding for each interface you want Hiawatha to listen to. And don't use '0.0.0.0' or '::', because that's the same as not using the interface option.
This topic has been closed.