Results 1 to 5 of 5
  1. #1

    Programme not running as owner? works on redhat but not on fedora?

    following php code is part of my script and owned by user "X"

    (X is created by WHM)

    exec ("./my_shell_script.sh> /dev/null &");
    and my_shell_script.sh is a shell script and diven right permission to be executed;

    contents of my shell script is

    #!/bin/sh

    while true
    do
    ./my_program
    sleep 1
    done

    I can run the php script on a redhat - works fine, "my_program" is listed in the current processos and its owned by the user "X"

    so the same php script can terminate the program (" my_program") since its owned by the same user /owner

    but when I run the same script in Fedora "my program" is not stable (I could see multiple instances and not stable) and its owned by user "nobody" - I am unable to reminate the program becasue the programm is runnng as nobody

    note: shell is enabled on both redhat and fedora accounts

    is it because i am using two different operating systems or I have configured the OS differently?

    please help me
    Last edited by bala; 06-25-2005 at 07:45 AM.

  2. #2
    Join Date
    Jul 2003
    Location
    Kuwait
    Posts
    5,099
    Are you sure suexec is not coming into play here?
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

  3. #3
    suexec is enabled in both systems

  4. This has nothing to do with Redhat/Fedora and everything to do with your Apache setup.

    Apache by default, runs modules all under the same user (i.e. "nobody", "www", "www-data") If you happen to be using mod_php, then this is what's going to happen.

    To have PHP scripts run under a particular user identification, you have a couple of courses of actions:

    1. Use su-exec (it's quite possible, it's simply not setup correctly on your system)
    2. Use the MPM module with Apache2 (This still doesn't work correctly as far as I know)
    3. Use mod_suphp http://www.suphp.org/

    Apache is configured differently on both machines. A list of LoadModule lines might give a clue, but realisitically, you're going to need to go through.

    If you can get the output of httpd -L (or apache -L ... it depends what your apache binary is called) on both machines, a reasonably accurate comparison could be made. Although normally it's painstaking as both are typically quite large.

    Phil.
    Philip Reynolds
    Hosting365
    Value for money dedicated servers
    at Rack365 - http://rack365.ie/

  5. #5
    thanks for the reply phil...

    its working fine after recompiling the apache with phpsuexec

    thanks a lot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •