Help me to solve following problem.
I have: Red Hat Linux release 9 (Shrike) + Apache 2.0.40. I have written small PHP script which executes the C++ program (myprogram) using exec() function. myprogram does fork() and runs as daemon. myprogram opens one outbound tcp connection and does not listen any ports. After calling PHP script from browser, it runs C++ program, all works fine.
Now I wish to stop web server. I do: service httpd stop. The server stops. But when I have tried to start it again, have seen such mistake:
make_sock: could not bind to address 0.0.0.0:443
no listening sockets available, shutting down
I have entered netstat -nlp and have seen the following:
Code:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
...
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 14656/myprogram
...
myprogram listen on server's port! If I start two copies of program, they listen on 80 and 443 ports.
How it can be? And how I can fix it?
Thanks.