httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Silvino C. Ferreira" <si...@devferr.com>
Subject Re: [users@httpd] CGI differences in apache 2.0 and 2.2
Date Mon, 12 Feb 2007 13:30:22 GMT
As root you can see the PATH variable for any running process in the 
/proc directory.  Here is what you need to do:

1. su to root
2. run the command   ps -e | grep httpd   which will show you all of 
process ids for apache

3. cd to /proc and do an ls.  You should see a directory with the same 
number as each of the httpd process ids

4. cd to one of those directories and then cat the environ file. The 
information is just one long sting and  not nicely formated, but  PATH 
should be obvious.

Sil


Steve Pelikan wrote:
> > Just having suexec loaded shouldn't make any difference because(AFAIK)
> > it isn't actually used unless you explicitly request its use.
>
> Good point.
> Okay, in a perl cgi script run by version 2.2 the command system("ls") 
> returns an error code (256, as I recall which corresponds to actual 
> exitcode 1) which I can print after the system("ls") call.
>
> Using apache 2.0 the perl statement system("ls") returns 0 as it should.
>
> Using a nonsense command system("foo"); produces an error code of -1 
> with both 2.0 and 2.2
>
> An additional bit of info that suggests there's a path/permissions 
> problem is that perl cgi scripts run with the apache 2.2 report an 
> error with a require("/home/pelikan/test.txt"); (can't find file) but can
> do require("/var/www/cgi-bin/test.txt");  As if whoever's running the 
> script can see cgi-bin but not /home/pelikan (though the /home/pelikan 
> is set to let anyone read and execute)
>
> The file test.txt exists in both places.
>
>
>
> Apache runs as user 'apache' and there's no login allowed for that 
> user so I don't know how to run a program or view the path for user 
> apache. I'll read up on how to do cron and see if I turn that into a 
> test.
>
> THanks!
>
> Steve P
>
> Steve Swift wrote:
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message