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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Xinchen,

thank you for your reply.

Nope, Apache runs in its standard configuration and is listening on
"*:80" and "*:443", quiet as normal.

But after some tests yesterday and after checking the init scripts of
apache2 and openvpn (where that problem occours) ive testet to invoke
the "apache2ctl" script. if i use "exec('apache2ctl restart');"
everything works fine and as i expected it. that means imho, that the
behavior described below is caused by the standard apache initscript...

i think its possible that the initscript is setting some vars which will
cause that "bug"?

i'll have a look at that, but maybe thats the solution for my problem.

thanks

kind regards

Ronny


> 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
>>
>> .
>>


-- 
Cloud IT Services GmbH   Telefon: +49 351 47940230
Altplauen 19             Telefax: +49 351 47940239
01187 Dresden            E-Mail:  it@xxxxxxxxxxxxxxxxxxxxx
                         Web:     www.cloud-it-services.com

GeschÃftsfÃhrung:        Wolfram GÃrlich
Sitz der Gesellschaft:   Blankenburg
Amtsgericht Stendal:     HRB 12528


Diese E-Mail enthÃlt vertrauliche und/oder rechtlich geschÃtzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtÃmlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.
Internetkommunikationen sind nicht sicher. Daher Ãbernimmt die
Cloud IT Services GmbH keinerlei Haftung fÃr den Inhalt dieser
Nachricht. Jegliche Ansichten oder dargestellte Meinungen
sind ausschlieÃlich solche des Autors und reprÃsentieren nicht
notwendigerweise die der Cloud IT Services GmbH.

This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden. Internet communications are not secure and
therefore Cloud IT Services GmbH does not accept legal responsibility
for the contents of this message. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
Cloud IT Services GmbH.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux