Forum OpenACS Q&A: OpenACS / IPCop / Error: nssock: failed to listen on 200.200.200.200:8000: Cannot assign requested address

I'm using redhat 9 on my pc.  I also have ipCop firewall running in between my pc and my adsl connection.

I've tried installing openACS.  The installation appears to run fine until I try to browse to the welcome page.

In my server log file (/usr/local/aolserver/log/server.log), I don't have any line like the installation sample below

[01/Jun/2000:12:11:20][5914.2051][-nssock-] Notice: nssock: listening on http://localhost.localdomain:8000 (127.0.0.1:8000)

Instead I have the lines

Error: nssock: failed to listen on 200.200.200.200:8000: Cannot assign requested address.

I don't know why it's not listening to the localhost ip address.  Instead it seems to be trying to listen to the ipCop green interface ip address. (200.200.200.200).

Full log reproduced below.  I'd appreciate any assistance.

thanks
rowan

[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: nsmain: AOLserver/3.3.1+ad13 starting
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: nsmain: security info: uid=99, euid=99, gid=503, egid=503
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: nsmain: max files: FD_SETSIZE = 1024, rl_cur = 1024, rl_max = 1024
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: adp: mapped /*.adp
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: modload: loading '/usr/local/aolserver/bin/nssock.so'
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: modload: loading '/usr/local/aolserver/bin/nslog.so'
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: nslog: opened '/usr/local/aolserver/servers/server1/modules/nslog/access.log'
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: conf: [ns/server/server1]enabletclpages = 0
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: tcl: generating interp init script
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: nsmain: AOLserver/3.3.1+ad13 running
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: nsmain: security info: uid=99, euid=99, gid=503, egid=503
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: serv: waiting for warmup
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: serv: warmed up
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: socks: idle
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: sched: waiting for idle
[08/Aug/2003:16:25:49][24210.1076432176][-sched-] Notice: sched: starting
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Notice: sched: idle
[08/Aug/2003:16:25:49][24210.1074121280][-main-] Error: nssock: failed to listen on 200.200.200.200:8000: Cannot assign requested address
[08/Aug/2003:16:25:49][24210.1076534576][-nssock-] Notice: nssock: starting
[08/Aug/2003:16:25:49][24210.1076534576][-nssock-] Notice: nssock: accepting connections
[08/Aug/2003:16:25:49][24210.1076534576][-nssock-] Notice: exiting

Could you post your config.tcl file and possible some more details of your network setup?  i.e.  IP address of the OpenACS machine as well as those of your IPCop machine.
Try telling AOLserver to use your localhost IP address (127.0.0.1) instead of trying to "autodetect" your IP address.

-Roberto

You're sure nothing else listens on 8000?  Try netstat -na | grep 8000.  Also, try setting IP in config.tcl to 0.0.0.0 (any address) -- does it come up on 200.200.200.200?
Thanks James, Robert and Andrei.

I set the hostname and address to 127.0.0.1 within my sample-config.tcl file and found that I was able to browse to the homepage.  (My sample-config.tcl file follows).

Hopefully I'll explain this clearly but let me know if anything sounds odd.

I have two machines.  One is a firewall running ipCop and the other a redhat 9 linux workstation.  My firewall machine has two network cards.  One card links to my ASDL modem and the other links to my linux workstation.

I have ipCop configured for GREEN+RED interfaces.  The RED interface is for the external network (internet access via my ASDL modem) and the GREEN interface is for my internal network (ie my linux workstation).

I set the GREEN interface address to 200.200.200.200.

inet addr:200.200.200.200
Bcast:200.200.200.255
Mask:255.255.255.0

The ip address for my RED interface is set via DHCP and I set my DHCP hostname as ipcop.

The ip address of my firewall machine is supplied by my internet service provider.  It's not a static ip address.

inet addr:203.217.68.128
Bcast:203.217.68.255
Mask:255.255.255.0

The ip address of my workstation is provided by ipCop.  I enabled ipCop's DHCP server function - providing a range of addresses between

200.200.200.200
and
200.200.200.250

I defined the "primary DNS" setting on the "DHCP server configuration screen" as 200.200.200.200

ifconfig on my local workstation tells me that the ip address of my workstation is

inet addr:200.200.200.201
Bcast:200.200.200.255
Mask:255.255.255.0

# $Header: /usr/local/cvsroot/nsd/aolserver/nsd/sample-config.tcl,v 1.1.1.2 2001/03/31 15:54:50 mayoff Exp $

#
# sample-config.tcl --  The AOLserver Startup Script
#
#      This is a Tcl script that is sourced when AOLserver starts up.
#      A detailed reference is in "doc/config.txt".
#

ns_log notice "config.tcl: starting to read config file..."

#
# Set some Tcl variables that are commonly used throughout this file.
#
set httpport              8000
set httpsport              8443

# The hostname and address should be set to actual values.
#set hostname              [ns_info hostname]
#set address                [ns_info address]

set hostname 127.0.0.1
set address 127.0.0.1

set servername            "server1"
set serverdesc            "Server Name"

set homedir                [file dirname [ns_info config]]
set bindir                [file dirname [ns_info nsd]]

set pageroot              ${homedir}/servers/${servername}/pages
set directoryfile          index.adp,index.html,index.htm

set ext [info sharedlibextension]

# nsssl: Only loads if keyfile.pem and certfile.pem exist.
#set sslmodule              nsssl${ext}  ;# Domestic 128-bit/1024-bit SSL.
set sslmodule              nsssle${ext} ;# Exportable 40-bit/512-bit SSL.
set sslkeyfile  ${homedir}/servers/${servername}/modules/nsssl/keyfile.pem
set sslcertfile  ${homedir}/servers/${servername}/modules/nsssl/certfile.pem

# nscp: Uncomment the sample password and log in with "nsadmin", password "x",
#      type "ns_crypt newpassword salt" and put the encrypted string below.
set nscp_port 9999
set nscp_addr 127.0.0.1
set nscp_user ""
#set nscp_user "nsadmin:t2GqvvaiIUbF2:" ;# sample user="nsadmin", pw="x".

#
# Global server parameters
#
ns_section "ns/parameters"
ns_param  home            $homedir
ns_param  debug          false

#
# Thread library (nsthread) parameters
#
ns_section "ns/threads"
ns_param  mutexmeter      true      ;# measure lock contention
#ns_param  stacksize [expr 128*1024] ;# Per-thread stack size.

#
# MIME types.
#
#  Note: AOLserver already has an exhaustive list of MIME types, but in
#  case something is missing you can add it here.
#
ns_section "ns/mimetypes"
ns_param  default        "*/*"    ;# MIME type for unknown extension.
ns_param  noextension    "*/*"    ;# MIME type for missing extension.
#ns_param  ".xls"          "application/vnd.ms-excel"

############################################################
#
# Server-level configuration
#
#  There is only one server in AOLserver, but this is helpful when multiple
#  servers share the same configuration file.  This file assumes that only
#  one server is in use so it is set at the top in the "server" Tcl variable.
#  Other host-specific values are set up above as Tcl variables, too.
#

ns_section "ns/servers"
ns_param  $servername    $serverdesc

#
# Server parameters
#
ns_section "ns/server/${servername}"
ns_param  directoryfile  $directoryfile
ns_param  pageroot        $pageroot
ns_param  globalstats    true      ;# Enable built-in statistics.
ns_param  urlstats        true      ;# Enable URL statistics.
ns_param  maxurlstats    1000      ;# Max number of URL's to do stats on.
ns_param  enabletclpages  false    ;# Parse *.tcl files in pageroot.

#
# Scaling and Tuning Options
#
#  Note: These values aren't necessarily the defaults.
#
#ns_param  connsperthread  0        ;# Normally there's one conn per thread
#ns_param  flushcontent    false    ;# Flush all data before returning
#ns_param  maxconnections  100      ;# Max connections to put on queue
#ns_param  maxdropped      0        ;# Shut down if dropping too many conns
#ns_param  maxthreads      20        ;# Tune this to scale your server
#ns_param  minthreads      0        ;# Tune this to scale your server
#ns_param  threadtimeout  120      ;# Idle threads die at this rate

# Directory listings -- use an ADP or a Tcl proc to generate them.
#ns_param  directoryadp    $pageroot/dirlist.adp ;# Choose one or the other.
#ns_param  directoryproc  _ns_dirlist          ;#  ...but not both!
#ns_param  directorylisting simple              ;# Can be simple or fancy.

#
# ADP (AOLserver Dynamic Page) configuration
#
ns_section "ns/server/${servername}/adp"
ns_param  map            "/*.adp"  ;# Extensions to parse as ADP's.
#ns_param  map            "/*.html" ;# Any extension can be mapped.
ns_param  enableexpire    false    ;# Set "Expires: now" on all ADP's.
ns_param  enabledebug    false    ;# Allow Tclpro debugging with "?debug".

# ADP special pages
#ns_param  errorpage      ${pageroot}/errorpage.adp ;# ADP error page.

#
# ADP custom parsers -- see adp.c
#
ns_section "ns/server/${servername}/adp/parsers"
ns_param  adp            ".adp"    ;# adp is the default parser.

#
# Socket driver module (HTTP)  -- nssock
#
ns_section "ns/server/${servername}/module/nssock"
ns_param  port            $httpport
ns_param  hostname        $hostname
ns_param  address        $address

#
# Socket driver module (HTTPS) -- nsssl
#
#  nsssl does not load unless sslkeyfile/sslcertfile exist (above).
#
ns_section "ns/server/${servername}/module/nsssl"
ns_param  port            $httpsport
ns_param  hostname        $hostname
ns_param  address        $address
ns_param  keyfile        $sslkeyfile
ns_param  certfile        $sslcertfile

#
# Control port -- nscp
#
#  nscp does not load unless nscp_user is a valid user.
#
ns_section "ns/server/${servername}/module/nscp"
ns_param  port            $nscp_port
ns_param  address        $nscp_addr

ns_section "ns/server/${servername}/module/nscp/users"
ns_param  user            $nscp_user

#
# Access log -- nslog
#
ns_section "ns/server/${servername}/module/nslog"
ns_param  rolllog        true      ;# Should we roll log?
ns_param  rollonsignal    true      ;# Roll log on SIGHUP.
ns_param  rollhour        0        ;# Time to roll log.
ns_param  maxbackup      5        ;# Max number to keep around when rolling.

#
# CGI interface -- nscgi
#
#  WARNING: These directories must not live under pageroot.
#
ns_section "ns/server/${servername}/module/nscgi"
#ns_param  map "GET  /cgi /usr/local/cgi"    ;# CGI script file dir (GET).
#ns_param  map "POST /cgi /usr/local/cgi"    ;# CGI script file dir (POST).

#
# Modules to load
#
ns_section "ns/server/${servername}/modules"
ns_param  nssock          ${bindir}/nssock${ext}
ns_param  nslog          ${bindir}/nslog${ext}
#ns_param  nscgi          ${bindir}/nscgi${ext}  ;# Map the paths before using.
#ns_param  nsperm          ${bindir}/nsperm${ext} ;# Edit passwd before using.

#
# nsssl: Only loads if sslcertfile and sslkeyfile exist (see above).
#
if { [file exists $sslcertfile] && [file exists $sslkeyfile] } {
    ns_param nsssl ${bindir}/${sslmodule}
} else {
    ns_log warning "config.tcl: nsssl not loaded -- key/cert files do not exist."
}

#
# nscp: Only loads if nscp_user is set (see above).
#
if { $nscp_user != "" } {

    if ![string match "127.0.0.1" $nscp_addr] {
    # Anything but 127.0.0.1 is not recommended.
    ns_log warning "config.tcl: nscp listening on ${nscp_addr}:${nscp_port}"
    }
    ns_param nscp ${bindir}/nscp${ext}

} else {
    ns_log warning "config.tcl: nscp not loaded -- user/password is not set."
}

ns_log notice "config.tcl: finished reading config file."

Rowan

This seems to be the startup file for AOLserver not the one for openacs. Should try with the one for openacs.

hi....
now i'm trying to test my aolserver on mac os 10.3.9 but there have problem with ip, which is ip is already in use

any tips??

multimedia:/usr/local/aolserver root# vi /usr/local/aolserver/log/server.log
[27/May/2005:10:18:34][25179.2684400292][-main-] Notice: nsmain: AOLserver/4.0.8 stopping
[27/May/2005:10:18:34][25179.2684400292][-main-] Notice: serv: stopping server: server1
[27/May/2005:10:18:34][25179.2684400292][-main-] Notice: serv: connection threads stopped
[27/May/2005:10:18:34][25179.2684400292][-main-] Notice: driver: shutdown complete
[27/May/2005:10:18:34][25179.2684400292][-main-] Notice: sched: shutdown pending
[27/May/2005:10:18:34][25179.41951744][-driver-] Fatal: driver: poll() failed: Bad file descriptor
[27/May/2005:10:18:47][25346.2684400292][-main-] Notice: nsmain: AOLserver/4.0.8 starting
[27/May/2005:10:18:47][25346.2684400292][-main-] Notice: nsmain: security info: uid=-2, euid=-2, gid=201, egid=201
[27/May/2005:10:18:47][25346.2684400292][-main-] Notice: nsmain: max files: FD_SETSIZE = 1024, rl_cur = 0, rl_max = 1024
[27/May/2005:10:18:47][25346.2684400292][-main-] Notice: adp[server1]: mapped /*.adp
[27/May/2005:10:18:47][25346.2684400292][-main-] Notice: adp[server1]: mapped /*.u_adp
[27/May/2005:10:18:47][25346.2684400292][-main-] Notice: adp[server1]: mapped /*.gb_adp
[27/May/2005:10:18:47][25346.2684400292][-main-] Notice: adp[server1]: mapped /*.sjis_adp
[27/May/2005:10:18:47][25346.2684400292][-main-] Notice: modload: loading '/usr/local/aolserver40r8/bin/nssock.so'
[27/May/2005:10:18:47][25346.2684400292][-main-] Notice: modload: loading '/usr/local/aolserver40r8/bin/nslog.so'
[27/May/2005:10:18:47][25346.2684400292][-main-] Notice: nslog: opened '/usr/local/aolserver40r8/servers/server1/modules/nslog/access.log'
[27/May/2005:10:18:47][25346.2684400292][-main-] Notice: conf: [ns/server/server1]enabletclpages = 0
[27/May/2005:10:18:47][25346.2684400292][-main-] Notice: nsmain: AOLserver/4.0.8 running
[27/May/2005:10:18:47][25346.2684400292][-main-] Notice: nsmain: security info: uid=-2, euid=-2, gid=201, egid=201
[27/May/2005:10:18:47][25346.41949184][-sched-] Notice: sched: starting
[27/May/2005:10:18:47][25346.2684400292][-main-] Error: nssock: failed to listen on 127.0.0.1:8000: Address already in use
"/usr/local/aolserver/log/server.log" 23L, 2228C