De: Dan Shoop <email@hidden>
Date: 30 juin 2005 16:31:58 GMT-04:00
À: Sébastien Plourde <email@hidden>,
email@hidden
Objet: Rép : Can't run SIPS in perl script under cgi run
At 11:45 AM -0400 6/30/05, Sébastien Plourde wrote:
Hi,
I'm currently working on a perl script who call, by command line,
Sips for automatically resize images on a webpage.
Thank to Dan Shoop for the script sample he provide to us.
But does anybody know if this command tools have restriction to run
under www ?
I have setup all permission (and i know for the test, all permission
are very very loosy.)
The perl script run very well directly under the terminal and it did
the job.
But not under apache2 ?. The perl work but when it call the command
to sips - sips seems to ignore the param. With every picture chmoded
777.
The proof of concept script operates just fine wrt the web and the www
user so this point to your configuration.
Obviously the www user needs access to the script and to any files it
will access. This means it will need write permissions to write the
resulting files, and read permissions to read the source files and
read and execute the script.
Are you sure you're permitting CGIs to execute? What errors are you
receiving?
We'd need to know more about how you're implementing this to be of any
assistance.
--
I have already a tons of cgi script running on that server and someone
call unix command without problem. They read and write good to and from
any users in the webhosting group.
Here is how I call the sips comand in the perl script :
`sips -Z $size -s format jpeg --out $tmpFile $tmporigine`;
Also I have try this way too :
open($response, "-|", "sips -Z $size -s format jpeg --out $tmpFile
$tmporigine") or $response .= "$!";
those 2 way work well if i run the perl script in the terminal under
sudo mode.
I have made a lot more test.
And what I have saw, is the script work only if the file I want to
convert is absolutely chowned under www, not just with a 777.
This is bad because I never upload my file under that user in ftp
session. I think this is a requirement from sips not from apache ?
If so how I can ask sips to read files from other users. I very don't
want to call a sudo under the cgi