LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-05-2013, 05:00 AM   #1
techsaffie
LQ Newbie
 
Registered: Apr 2013
Posts: 2

Rep: Reputation: Disabled
Question apache php + suphp/suexec > totally lost


hi guys/girls

I have been reading all over the web for a decent method on how to run a script as a different user, but I'm totally lost now ...

My objective:
- Apache server (running as user apache) with php webpage > ok
- php webpage has to launch bash script (bash script has to be executed as different userX:groupY) > not ok
- I'm on red hat 6.4

I understand that I should get something like suexec or suphp and set the suuid bit on the script.

> However this raises my first question, at one point in time I was able to launch the script by suexec, but it would only execute as root.
I never managed to get it working under the userX:groupY
Is this normal?
> if somebody could help me out with this and also with the php part, cause my php knowledge is a bit light it seems, I would be very happy

httpd -v
Server version: Apache/2.2.15 (Unix)
Server built: Dec 5 2012 04:03:05

suexec -V
-D AP_DOC_ROOT="/var/www"
-D AP_GID_MIN=100
-D AP_HTTPD_USER="apache"
-D AP_LOG_EXEC="/var/log/httpd/suexec.log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_UID_MIN=500
-D AP_USERDIR_SUFFIX="public_html"

/www/html>ls -l
-rwsr-xr-x 1 userX groupY 4807 Mar 5 14:51 runscript
-rw-r--r-- 1 userX groupY 151 Mar 5 14:51 runscript.c
-rwsr-xr-x 1 userX groupY 24 Mar 4 16:12 script.sh
-rw-r--r-- 1 root root 650 Apr 5 11:35 test.php


thx
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
suexec and suphp liang3391 Linux - Server 1 08-16-2009 06:11 PM
apache suexec and suphp liang3391 Linux - Software 1 07-26-2009 04:19 PM
Error when config Apache 2.x PHP 5.x with SuPHP longvnit Linux - Server 9 05-20-2009 02:23 PM


All times are GMT -5. The time now is 01:36 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration