Re: PHP Sockets, problem with remote execution (exec/system)

From: Date: Mon, 22 Nov 2010 03:08:16 +0000
Subject: Re: PHP Sockets, problem with remote execution (exec/system)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-309604@lists.php.net to get a copy of this message
Hi: is there a chance that there is a "Listen 8133" in your apache2 configure file? always no as "httpd.conf" or *.conf in the apache2/conf/extra folder. thanks Best regards 惠新宸 Xinchen Hui http://www.laruence.com/ On 2010/11/19 15:18, Ronny Tiebel wrote:
Good Morning List ;) ive allready postet my question on the german phpbar mailinglist, but no responses from anyone yet. i hope someone on that list could give me an advice or hint. i'm writing a php-daemon which will run on a debian lenny/squeeze. this daemon should listen to a specific port of a vpn-interface/ip-address (it creates a socket) if the daemon script recieves a string from my management webinterface (other server) it should run some code e.g. exec('/etc/init.d/apache2 restart'); or system('something'); or whatever. i got it working, but there is a (for me) strange behavior. After the daemon has restarted the apache2 service for example and the php daemon is stoped, the apache2 process takes over the socket. that means, in netstat -tulpen or netstat -anp i first can see something like that:
tcp        0      0 10.0.0.1:8133   0.0.0.0:*    LISTEN      29168/php
tcp6       0      0 :::80         :::*       LISTEN      29155/apache2
after the daemon has restarted apache2 and stops itself (or i have to kill him), netstat shows up the following:
tcp        0      0 10.0.0.1:8133   0.0.0.0:*  LISTEN      31490/apache2
tcp6       0      0 :::80         :::*         LISTEN      31490/apache2
so i cant restart the daemon because apache uses that port/ip (or socket?) after invoking "/etc/init.d/apache2 restart" on the shell, everything is fine again and im able to start the daemon. btw, the same with the openvpn service. (mysql doesnt act like apache or openvpn). Am i missing something? Or is that the default behavior of linux/apache/php/sockets ??? Additional Information about OS etc.
Server/Client   Debian Lenny    Apache 2.2.9    PHP 5.2.6-1+lenny9 with
Suhosin-Patch 0.9.6.2 (cli) (built: Aug 4 2010 06:06:53)
Client/Server   Ubuntu Lucid    Apache 2.2.14   PHP 5.3.2-1ubuntu4.5 with
Suhosin-Patch (cli) (built: Sep 17 2010 13:49:46) Ive tested it both way: Ubuntu as Server, Debian as Client and vice versa. The Ubuntu System (my workstation) is in our Office and the Debian System is in the datacentre@ our provider... Any help would be great! Thanks in advance, kind regards Ronny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php .


« previous php.general (#309604) next »