Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Strange apache behaviour

  • 13-11-2003 2:52pm
    #1
    Subscribers Posts: 1,911 ✭✭✭


    Just noticed some strange behaviour with apache and php.

    I've some scripts that I can upload files through.
    If I'm logged in as myself and apache is started with:
    sudo service httpd restart
    all is well
    If I'm logged in as root and restart apache with:
    service httpd restart
    my files don't upload

    Now, afaik the two commands should be equivalent but there is obviously something funny going on.

    anyone shed any light on this?


Comments

  • Registered Users, Registered Users 2 Posts: 2,763 ✭✭✭niallb


    Well noticed,
    what OS are you running, and what versions of apache, php etc.
    What flavour of php are you using?
    How does the upload fail?
    Who owns the directory you upload the files to?

    You'll need to shed a bit more light on this yourself first
    before we can really see what's happening!

    Possibly when you run it with sudo, apache never drops
    privileges back to the apache user.

    run ps aux (linux) or ps -ef | grep httpd and see who is running your apache after restarting it each way.

    You may discover that the failing upload is actually the correct behaviour, and that you'll need to change the permissions on the upload directory to have it work normally.

    NiallB


  • Registered Users, Registered Users 2 Posts: 4,495 ✭✭✭Gerry


    When you are logged in as root, your environment is set up differently. Quite possibly, your root path is missing some stuff thats in your normal user path. Or maybe it can't find some libraries or something ( though this should not be an issue really ). I had some issues on solaris with this, so I basically hacked up the apachectl script to have the correct environment in it.
    You need to compare the PATH and LD_LIBRARY_PATH for the normal user and the root user.
    ( Of course I could be completely wrong )


  • Subscribers Posts: 1,911 ✭✭✭Draco


    What I suspect is happening (since I haven't had a chance to check my theory out) is that when I kick it off as root rather than using sudo PHP is going into safe mode which would prevent the file uploads. Everything else seems to work fine.


Advertisement