LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 01-22-2007, 02:55 PM   #1
wardjame
LQ Newbie
 
Registered: Oct 2005
Posts: 10

Rep: Reputation: 0
running command as apache


I am using ezpublish on a dedicated Plesk server runing RHEL and Apache2. The CMS requires access to the imagemagick executable called "convert". I can run convert as any user I log in as by typing convert -v but when I try to call convert from a web page via php exec I get an error.

As far as I can tell the problem is that the apache user does not have permission to call an executable on the system. php is not in safe maode and openbasedir is also off.

Any suggestions on how I could get this working?

Thank in advance.
 
Old 01-24-2007, 12:47 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,128

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
If you are running PHP in safe_mode then PHP will only allow you to run binaries listed in the safe_mode-exec_dir variable. Usually I create a special directory and put binaries I want PHP to be able to execute in there so I don't have to allow PHP to execute everything in /usr/bin. The settings are stored in /etc/php.ini on my CentOS system.

If you are running SELinux that might also come into play. It is only an option on RHEL 4 though so if you are using 3 you don't need to worry about that. I'm not an SELinux export so I couldn't tell you how to make it allow it, but check for denied messages from it in /var/log/messages to see if it's part of the problem.
 
Old 01-29-2007, 09:25 AM   #3
wardjame
LQ Newbie
 
Registered: Oct 2005
Posts: 10

Original Poster
Rep: Reputation: 0
As I said php was not in safe_mode.

I chowned the convert binary to the apache group and everything is behaving now.

Thanks.
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to start apache : Apache does not appear to be running : number11 Slackware 9 02-11-2005 09:51 AM
sh command running as nobody chongluo Linux - Security 1 12-01-2004 06:03 AM
running shell command with apache didi86 Linux - Software 4 11-28-2004 04:02 PM
Running a command from anywhere tez Linux - Newbie 5 02-27-2004 10:07 PM
command running on cd in Daem0hn Linux - General 3 07-22-2003 03:13 AM


All times are GMT -5. The time now is 06:29 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