Brian Marshall | 8 Sep 2009 22:28
Favicon

Re: Can't compile on CentOS 5.2

Hi All,

I can't get suPHP to compile with a stock CentOS 5.2 system. If I donwload the current these are my results. I get the same results using the most current build 0.7.1. Any help would be greatly appreciated.

Here's my packages

[root <at> smizbiz suphp-0.7.0]# yum list | grep http
httpd.x86_64                             2.2.3-22.el5.centos.2  installed       
httpd-devel.x86_64                       2.2.3-22.el5.centos.2  installed       
httpd-devel.i386                         2.2.3-22.el5.centos.2  installed       
httpd-manual.x86_64                      2.2.3-22.el5.centos.2  installed             
[root <at> smizbiz suphp-0.7.0]# yum list | grep php
php.x86_64                               5.1.6-23.2.el5_3       installed       
php-cli.x86_64                           5.1.6-23.2.el5_3       installed 


Here's my apache deps

[root <at> smizbiz ~]# which apxs
/usr/sbin/apxs
[root <at> smizbiz ~]# which apr-1-config
/usr/bin/apr-1-config

Here's my configure string
./configure --prefix=/usr --sysconfdir=/etc --with-apr=/usr/bin/apr-1-config --with-apxs=/usr/sbin/apxs --with-apache-user=apache --with-setid-mode=owner --with-php=/usr/bin/php-cgi --with-logfile=/var/log/httpd/suphp_log --enable-SUPHP_USE_USERGROUP=yes

Configure results

root <at> smizbiz suphp-0.7.0]# ./configure --prefix=/usr --sysconfdir=/etc --with-apr=/usr/bin/apr-1-config --with-apxs=/usr/sbin/apxs --with-apache-user=apache --with-setid-mode=owner --with-php=/usr/bin/php-cgi --with-logfile=/var/log/httpd/suphp_log --enable-SUPHP_USE_USERGROUP=yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether build environment is sane... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
appending configuration tag "F77" to libtool
checking for ANSI C header files... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for APR... yes
checking for dynamic Apache module support (via APXS)... cannot open /httpd/build/config_vars.mk: No such file or directory at /usr/sbin/apxs line 201.
cannot open /httpd/build/config_vars.mk: No such file or directory at /usr/sbin/apxs line 201.
./configure: line 20370: /: is a directory
cannot open /httpd/build/config_vars.mk: No such file or directory at /usr/sbin/apxs line 201.
cannot open /httpd/build/config_vars.mk: No such file or directory at /usr/sbin/apxs line 201.
cannot open /httpd/build/config_vars.mk: No such file or directory at /usr/sbin/apxs line 201.
found at /usr/sbin/apxs (version )
checking for set-UID/set-GID mode... ok - using owner
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/apache/Makefile
config.status: creating src/apache2/Makefile
config.status: creating src/config.h
config.status: executing depfiles commands


Here's my make result

[root <at> smizbiz suphp-0.7.0]# make
Making all in src
make[1]: Entering directory `/tmp/suphp-0.7.0/src'
make  all-recursive
make[2]: Entering directory `/tmp/suphp-0.7.0/src'
Making all in apache
make[3]: Entering directory `/tmp/suphp-0.7.0/src/apache'
/bin/sh ../../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../src    -I -DSUPHP_PATH_TO_SUPHP=\"/usr/sbin/suphp\"  -g -O2 -MT mod_suphp.lo -MD -MP -MF .deps/mod_suphp.Tpo -c -o mod_suphp.lo mod_suphp.c
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I../../src -I -DSUPHP_PATH_TO_SUPHP=\"/usr/sbin/suphp\" -g -O2 -MT mod_suphp.lo -MD -MP -MF .deps/mod_suphp.Tpo -c mod_suphp.c  -fPIC -DPIC -o .libs/mod_suphp.o
mod_suphp.c:24:19: error: httpd.h: No such file or directory
mod_suphp.c:25:25: error: http_config.h: No such file or directory
mod_suphp.c:26:26: error: http_request.h: No such file or directory
mod_suphp.c:27:23: error: http_core.h: No such file or directory
mod_suphp.c:28:27: error: http_protocol.h: No such file or directory
mod_suphp.c:29:23: error: http_main.h: No such file or directory
mod_suphp.c:30:22: error: http_log.h: No such file or directory
mod_suphp.c:31:25: error: util_script.h: No such file or directory
mod_suphp.c:47: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'MODULE_VAR_EXPORT'
mod_suphp.c:59: error: expected specifier-qualifier-list before 'table'
mod_suphp.c:66: error: expected ')' before '*' token
mod_suphp.c:84: error: expected ')' before '*' token
mod_suphp.c:125: error: expected ')' before '*' token
mod_suphp.c:145: error: expected ')' before '*' token
mod_suphp.c:184: error: expected ')' before '*' token
mod_suphp.c:203: error: expected ')' before '*' token
mod_suphp.c:232: error: expected ')' before '*' token
mod_suphp.c:246: error: expected ')' before '*' token
mod_suphp.c:262: error: expected ')' before '*' token
mod_suphp.c:276: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'suphp_cmds'
mod_suphp.c:296: error: expected declaration specifiers or '...' before 'child_info'
mod_suphp.c: In function 'suphp_source_child':
mod_suphp.c:297: error: 'request_rec' undeclared (first use in this function)
mod_suphp.c:297: error: (Each undeclared identifier is reported only once
mod_suphp.c:297: error: for each function it appears in.)
mod_suphp.c:297: error: 'r' undeclared (first use in this function)
mod_suphp.c:297: error: expected expression before ')' token
mod_suphp.c:299: error: 'pool' undeclared (first use in this function)
mod_suphp.c:299: error: 'p' undeclared (first use in this function)
mod_suphp.c:302: error: 'suphp_module' undeclared (first use in this function)
mod_suphp.c:302: warning: assignment makes pointer from integer without a cast
mod_suphp.c:309: warning: assignment makes pointer from integer without a cast
mod_suphp.c:310: error: 'suphp_conf' has no member named 'php_path'
mod_suphp.c:310: warning: assignment makes pointer from integer without a cast
mod_suphp.c:312: warning: assignment makes pointer from integer without a cast
mod_suphp.c:313: error: 'NULL' undeclared (first use in this function)
mod_suphp.c:317: warning: assignment makes pointer from integer without a cast
mod_suphp.c:325: error: 'suphp_conf' has no member named 'php_path'
mod_suphp.c:328: error: 'APLOG_MARK' undeclared (first use in this function)
mod_suphp.c:328: error: 'APLOG_ERR' undeclared (first use in this function)
mod_suphp.c:329: error: 'suphp_conf' has no member named 'php_path'
mod_suphp.c:330: warning: incompatible implicit declaration of built-in function 'exit'
mod_suphp.c: At top level:
mod_suphp.c:336: error: expected declaration specifiers or '...' before 'child_info'
mod_suphp.c: In function 'suphp_child':
mod_suphp.c:337: error: 'request_rec' undeclared (first use in this function)
mod_suphp.c:337: error: 'r' undeclared (first use in this function)
mod_suphp.c:337: error: expected expression before ')' token
mod_suphp.c:338: error: 'core_dir_config' undeclared (first use in this function)
mod_suphp.c:338: error: 'core_conf' undeclared (first use in this function)
mod_suphp.c:339: error: 'pool' undeclared (first use in this function)
mod_suphp.c:339: error: 'p' undeclared (first use in this function)
mod_suphp.c:343: error: expected expression before ')' token
mod_suphp.c:351: warning: assignment makes pointer from integer without a cast
mod_suphp.c:353: error: 'NULL' undeclared (first use in this function)
mod_suphp.c:357: warning: assignment makes pointer from integer without a cast
mod_suphp.c:411: error: 'APLOG_MARK' undeclared (first use in this function)
mod_suphp.c:411: error: 'APLOG_ERR' undeclared (first use in this function)
mod_suphp.c:413: warning: incompatible implicit declaration of built-in function 'exit'
mod_suphp.c: At top level:
mod_suphp.c:421: error: expected ')' before '*' token
mod_suphp.c:505: error: expected ')' before '*' token
mod_suphp.c:789: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'suphp_handlers'
mod_suphp.c:798: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'MODULE_VAR_EXPORT'
make[3]: *** [mod_suphp.lo] Error 1
make[3]: Leaving directory `/tmp/suphp-0.7.0/src/apache'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/suphp-0.7.0/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/tmp/suphp-0.7.0/src'
make: *** [all-recursive] Error 1
[root <at> smizbiz suphp-0.7.0]# 


_______________________________________________
suPHP mailing list
suPHP@...
https://lists.marsching.com/mailman/listinfo/suphp
Ricardo J. Barberis | 9 Sep 2009 00:15
X-Face
Favicon

Re: Can't compile on CentOS 5.2

El Martes 08 Septiembre 2009, Brian Marshall escribió:
> Hi All,
>
> I can't get suPHP to compile with a stock CentOS 5.2 system. If I
> donwload the current these are my results. I get the same results
> using the most current build 0.7.1. Any help would be greatly
> appreciated.
>
> Here's my packages
>
> [root <at> smizbiz suphp-0.7.0]# yum list | grep http
> httpd.x86_64                             2.2.3-22.el5.centos.2
> installed
> httpd-devel.x86_64                       2.2.3-22.el5.centos.2
> installed
> httpd-devel.i386                         2.2.3-22.el5.centos.2
> installed
> httpd-manual.x86_64                      2.2.3-22.el5.centos.2
> installed
> [root <at> smizbiz suphp-0.7.0]# yum list | grep php
> php.x86_64                               5.1.6-23.2.el5_3
> installed
> php-cli.x86_64                           5.1.6-23.2.el5_3
> installed
>
>
> Here's my apache deps
>
> [root <at> smizbiz ~]# which apxs
> /usr/sbin/apxs
> [root <at> smizbiz ~]# which apr-1-config
> /usr/bin/apr-1-config
>
> Here's my configure string
> ./configure --prefix=/usr --sysconfdir=/etc --with-apr=/usr/bin/apr-1-
> config --with-apxs=/usr/sbin/apxs --with-apache-user=apache --with-

I looks like you're using apxs from apache 1.x?

Check "rpm -ql httpd | grep apxs2" to find out apache 2.x's version and 
maybe "rpm -qf /usr/sbin/apxs" to find where apxs comes from.

Cheers,
--

-- 
Ricardo J. Barberis 
Senior SysAdmin - I+D 
Dattatec.com :: Soluciones de Web Hosting 
Su Hosting hecho Simple..! 

_______________________________________________
suPHP mailing list
suPHP <at> lists.marsching.com
https://lists.marsching.com/mailman/listinfo/suphp
Erick Calder | 17 Sep 2009 01:23

how to execute a command?

hi, I need to execute a command under an account different from that  
which runs my web server.  perhaps I'm failing to understand what  
mod_suphp is meant to do but I can't seem to figure out proper usage.   
this is what I generally would do to execute a shell command:

<? echo exec("whoami"); ?>

if I wanted it to run under user "rpm", how would I do it?  I've read  
the docs but am no brighter for them.

thx - e
Andre Schild | 17 Sep 2009 07:38
Picon
Favicon
Gravatar

Re: how to execute a command?

Hello Eric,

this depends with what options you did compile the suPHP.

--with-setid-mode=MODE

There are 3 possibilities:

"owner":    Run scripts with owner UID/GID, so your .php script must be
owned by "rpm"

"force":    Run scripts with UID/GID specified in Apache configuration,
not recommended.

"paranoid": Same as "owner", but you have to also specify the "allowed"
users/groups in the Apache configuration

So you .php script has to be owned by "rpm" AND in the apache
config you have to specify

suPHP_UserGroup rpm andrpmgroup

Todays "paranoid" is recommended.

André

> > -----Original Message-----
> > From: Erick Calder [mailto:e <at> arix.com]
> > Sent: Thursday, September 17, 2009 1:24 AM
> > To: suphp@...
> > Subject: [suPHP] how to execute a command?
> >
> > hi, I need to execute a command under an account different from that
> > which runs my web server.  perhaps I'm failing to understand what
> > mod_suphp is meant to do but I can't seem to figure out proper 
usage.
> > this is what I generally would do to execute a shell command:
> >
> > <? echo exec("whoami"); ?>
> >
> > if I wanted it to run under user "rpm", how would I do it?  I've 
read
> > the docs but am no brighter for them.
> >
> > thx - e
> >
> > _______________________________________________
> > suPHP mailing list
> > suPHP@...
> > https://lists.marsching.com/mailman/listinfo/suphp
Erick Calder | 17 Sep 2009 08:20

Re: how to execute a command?

duh!  suggestion: add that small fact to your FAQ for nitwits like me :)

ok, so in /etc/suphp.conf I have the following section:

[handlers]
x-httpd-suphp=php:/usr/bin/php-cgi

and in /etc/httpd/conf.d/mod_suphp.conf I have:

LoadModule suphp_module modules/mod_suphp.so
suPHP_Engine on
suPHP_AddHandler x-httpd-suphp
AddHandler x-httpd-suphp .suphp

I then put a script in some directory (/var/www/arix.com/tst.suphp,  
chowned as rpm:rpm)... put it appears that the directory where I place  
it must also be owned by rpm... so I [mkdir /var/www/arix.com/rpm;  
chown rpm:rpm ...] and moved the script there, but the parent  
directory needs to be owned by rpm too...

so I put the following directive in my httpd.conf and moved the script  
there:

<directory /home/rpm>
order allow,deny
allow from all
</directory>

alias /rpm /home/rpm

but then I get: "File "/home/rpm/tst.suphp" is not in document root of  
Vhost "/var/www/arix.com"... ok.  I found and set  
check_vhost_docroot=false within the config file and then I get:  
"Directory "/home/rpm" is writeable by group".  grr... so I create / 
home/rpm/tst and chmod g-w, move the script there but it complains  
about the parent... I found allow_directory_group_writeable and set it  
to true. so now it works.  yikes!

I would really like to just have the script in my /var/www/arix.com  
directory but it and its parents cannot be owned by rpm... I don't see  
a directive to turn that need for ownership.

so what's the typical setup?  where do you guys put things?

(sorry for the lengthy message)

- e

On Sep 16, 2009, at 5:06 PM, Dave D wrote:

> Hi,
>
> To run it as the user RPM chown the file to the rpm user
>
> suPHP runs the PHP script as whoever has ownership on the file.
>
> Regards,
> --Matt
>
>
> On 17/09/2009, at 9:23 AM, Erick Calder wrote:
>
>> hi, I need to execute a command under an account different from that
>> which runs my web server.  perhaps I'm failing to understand what
>> mod_suphp is meant to do but I can't seem to figure out proper usage.
>> this is what I generally would do to execute a shell command:
>>
>> <? echo exec("whoami"); ?>
>>
>> if I wanted it to run under user "rpm", how would I do it?  I've read
>> the docs but am no brighter for them.
>>
>> thx - e
>>
>> _______________________________________________
>> suPHP mailing list
>> suPHP@...
>> https://lists.marsching.com/mailman/listinfo/suphp
>
Erick Calder | 17 Sep 2009 08:22

Re: how to execute a command?

On Sep 16, 2009, at 10:38 PM, Andre Schild wrote:

> this depends with what options you did compile the suPHP.

well... it's an RPM (someone else compiled it) and the docs don't say  
how it was compiled... but I've got it to work, I'm now just trying to  
figure out how to make it more to my liking (see the other reply).
Erick Calder | 17 Sep 2009 09:59

Re: how to execute a command?

one other question: when I run my script, $HOME isn't defined... this  
means that rpm cannot find ~/.rpmmacros and stuff breaks.  I gather I  
can just define it when I system() my commands but how come it's not  
there?

On Sep 16, 2009, at 10:38 PM, Andre Schild wrote:

> Hello Eric,
>
> this depends with what options you did compile the suPHP.
>
> --with-setid-mode=MODE
>
> There are 3 possibilities:
>
> "owner":    Run scripts with owner UID/GID, so your .php script must  
> be
> owned by "rpm"
>
> "force":    Run scripts with UID/GID specified in Apache  
> configuration,
> not recommended.
>
> "paranoid": Same as "owner", but you have to also specify the  
> "allowed"
> users/groups in the Apache configuration
>
> So you .php script has to be owned by "rpm" AND in the apache
> config you have to specify
>
> suPHP_UserGroup rpm andrpmgroup
>
>
>
> Todays "paranoid" is recommended.
>
>
> André
>
>
>>> -----Original Message-----
>>> From: Erick Calder [mailto:e <at> arix.com]
>>> Sent: Thursday, September 17, 2009 1:24 AM
>>> To: suphp@...
>>> Subject: [suPHP] how to execute a command?
>>>
>>> hi, I need to execute a command under an account different from that
>>> which runs my web server.  perhaps I'm failing to understand what
>>> mod_suphp is meant to do but I can't seem to figure out proper
> usage.
>>> this is what I generally would do to execute a shell command:
>>>
>>> <? echo exec("whoami"); ?>
>>>
>>> if I wanted it to run under user "rpm", how would I do it?  I've
> read
>>> the docs but am no brighter for them.
>>>
>>> thx - e
>>>
>>> _______________________________________________
>>> suPHP mailing list
>>> suPHP@...
>>> https://lists.marsching.com/mailman/listinfo/suphp
>
>
> _______________________________________________
> suPHP mailing list
> suPHP@...
> https://lists.marsching.com/mailman/listinfo/suphp
Alex Nordlund | 17 Sep 2009 12:48
Picon
Gravatar

Re: how to execute a command?

You could launch a shell which has those variables

---
//Alex

On Thu, Sep 17, 2009 at 9:59 AM, Erick Calder <e <at> arix.com> wrote:
> one other question: when I run my script, $HOME isn't defined... this
> means that rpm cannot find ~/.rpmmacros and stuff breaks.  I gather I
> can just define it when I system() my commands but how come it's not
> there?
>
> On Sep 16, 2009, at 10:38 PM, Andre Schild wrote:
>
>> Hello Eric,
>>
>> this depends with what options you did compile the suPHP.
>>
>> --with-setid-mode=MODE
>>
>> There are 3 possibilities:
>>
>> "owner":    Run scripts with owner UID/GID, so your .php script must
>> be
>> owned by "rpm"
>>
>> "force":    Run scripts with UID/GID specified in Apache
>> configuration,
>> not recommended.
>>
>> "paranoid": Same as "owner", but you have to also specify the
>> "allowed"
>> users/groups in the Apache configuration
>>
>> So you .php script has to be owned by "rpm" AND in the apache
>> config you have to specify
>>
>> suPHP_UserGroup rpm andrpmgroup
>>
>>
>>
>> Todays "paranoid" is recommended.
>>
>>
>> André
>>
>>
>>>> -----Original Message-----
>>>> From: Erick Calder [mailto:e <at> arix.com]
>>>> Sent: Thursday, September 17, 2009 1:24 AM
>>>> To: suphp@...
>>>> Subject: [suPHP] how to execute a command?
>>>>
>>>> hi, I need to execute a command under an account different from that
>>>> which runs my web server.  perhaps I'm failing to understand what
>>>> mod_suphp is meant to do but I can't seem to figure out proper
>> usage.
>>>> this is what I generally would do to execute a shell command:
>>>>
>>>> <? echo exec("whoami"); ?>
>>>>
>>>> if I wanted it to run under user "rpm", how would I do it?  I've
>> read
>>>> the docs but am no brighter for them.
>>>>
>>>> thx - e
>>>>
>>>> _______________________________________________
>>>> suPHP mailing list
>>>> suPHP@...
>>>> https://lists.marsching.com/mailman/listinfo/suphp
>>
>>
>> _______________________________________________
>> suPHP mailing list
>> suPHP@...
>> https://lists.marsching.com/mailman/listinfo/suphp
>
>
> _______________________________________________
> suPHP mailing list
> suPHP@...
> https://lists.marsching.com/mailman/listinfo/suphp
>
Richard James Salts | 17 Sep 2009 03:36

Re: how to execute a command?

On Wed, Sep 16, 2009 at 04:23:43PM -0700, Erick Calder wrote:
> hi, I need to execute a command under an account different from that  
> which runs my web server.  perhaps I'm failing to understand what  
> mod_suphp is meant to do but I can't seem to figure out proper usage.   
> this is what I generally would do to execute a shell command:
> 
> <? echo exec("whoami"); ?>
> 
> if I wanted it to run under user "rpm", how would I do it?  I've read  
> the docs but am no brighter for them.
suPHP will execute the script as whatever user specified in the virtual host configuration, or if you're
using mod_userdir then it will execute things in ~/public_html as the user whose home directory it is. So
you have one of two options:

1. Enable mod_userdir and put your script in ~rpm/public_html directory.

2. Create a  <Directory>, <Location> or <VirtualHost> block with suPHP_UserGroup rpm rpm and place your
php file there. ( This assumes "force" or "paranoid" was used in configure, with mode "owner" you can just
chown rpm:rpm your script and it should work ).
> 
> thx - e
> 
> _______________________________________________
> suPHP mailing list
> suPHP@...
> https://lists.marsching.com/mailman/listinfo/suphp
Erick Calder | 18 Sep 2009 10:19

Re: how to execute a command?

thanks Richard.  I've gone with option #2 though I had to fiddle with  
a number of options in the config to get it all right.  great module  
though!

On Sep 16, 2009, at 6:36 PM, Richard James Salts wrote:

> On Wed, Sep 16, 2009 at 04:23:43PM -0700, Erick Calder wrote:
>> hi, I need to execute a command under an account different from that
>> which runs my web server.  perhaps I'm failing to understand what
>> mod_suphp is meant to do but I can't seem to figure out proper usage.
>> this is what I generally would do to execute a shell command:
>>
>> <? echo exec("whoami"); ?>
>>
>> if I wanted it to run under user "rpm", how would I do it?  I've read
>> the docs but am no brighter for them.
> suPHP will execute the script as whatever user specified in the  
> virtual host configuration, or if you're using mod_userdir then it  
> will execute things in ~/public_html as the user whose home  
> directory it is. So you have one of two options:
>
> 1. Enable mod_userdir and put your script in ~rpm/public_html  
> directory.
>
> 2. Create a  <Directory>, <Location> or <VirtualHost> block with  
> suPHP_UserGroup rpm rpm and place your php file there. ( This  
> assumes "force" or "paranoid" was used in configure, with mode  
> "owner" you can just chown rpm:rpm your script and it should work ).
>>
>> thx - e
>>
>> _______________________________________________
>> suPHP mailing list
>> suPHP@...
>> https://lists.marsching.com/mailman/listinfo/suphp
>
> _______________________________________________
> suPHP mailing list
> suPHP@...
> https://lists.marsching.com/mailman/listinfo/suphp

Gmane