I want to launch lighttpdlighttpd when someone tries to connect to port 80.
I started with a simple test script to see if anything was working:
/etc/xinetd.d/www/etc/xinetd.d/www
service www
{
disable = no
socket_type = stream
protocol = tcp
port = 80
log_on_success += USERID
log_on_failure += USERID
server = /usr/server_test.sh
user = root
instances = UNLIMITED
wait = no
log_type = SYSLOG daemon debug
}
where "/usr/server_test.sh"/usr/server_test.sh:
#!/bin/sh
echo "www connection"
lighttpd -D -f /usr/lighttpd.conf &
webconfig -c /usr/cppcms.js &
service xinetd restart
When I try:
nc localhost 80
I get:
www connection 2013-11-25 16:37:13: (network.c.345) can't bind to port: 80 Address already in use
How do I get xinetdxinetd and lighttpdlighttpd to work together, not fight over same port?