Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have mod_ldap user authorization in my Apache, username 'test1' etc. I need to run all php scripts after authorization under user test1.

suEXEC allows script to be executed under the user that is owner of home directory,

To be clear, when I'm going to http://mysite/~test2 with suEXEC it's running as test2 and I want to run it as test1

share|improve this question

2 Answers 2

Have a look at suPHP it allows you to run PHP scripts as a specified user.

share|improve this answer
    
As i can understand compile options for suPHP are: "owner": Run scripts with owner UID/GID "force": Run scripts with UID/GID specified in Apache configuration "paranoid": Run scripts with owner UID/GID but also check if they match the UID/GID specified in the Apache configuration Can't understand how i can set id to autheticated user id :( –  saylas Nov 1 '10 at 22:44

The simplest solution is to use sudo, which was created exactly for running commands as another user.

It will however require the user's password to be provided, unless you use NOPASSWD in /etc/sudoers for that user/group.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.