LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 03-03-2006, 12:07 AM   #1
ujjwal_wadhawan
LQ Newbie
 
Registered: Mar 2006
Posts: 6

Rep: Reputation: 0
Super User For Apache..!! CBQ permissions...help..!!!


Hi
i am doing a project on bandwidth management.I am using CBQ with some database. The project has a script that has to run in CGI....the script has to execute the command to restart the CBQ service...

Everything works fine except that i cannot execute the shell command from CGI or PHP exec() function,,,

code attached below for reference..

//file getinfo.sh
sh /etc/sysconfig/cbq/restartcbq.sh



//file restartcbq.sh
echo -e "SETTING UP CBQ CLASS <br>"
sleep 1

echo -e "service cbq.init restart nocache "
echo -e "$(su)"
echo -e "<pre> $(service cbq.init restart nocache)</pre>"

echo -e "service cbq.init stats ##########Statistics ##########"
echo -e "<pre> $(service cbq.init stats) </pre>"

echo -e "<br> DONE................................Please Proceed<br>"


// OUTPUT in Webpage

DTU-ISP Suite--SHELL OUTPUT

SETTING UP CBQ CLASS

service cbq.init restart nocache


**CBQ: failed to add class 21 with parent on eth0!



service cbq.init stats ##########Statistics ##########

### eth0: queueing disciplines

qdisc sfq 21: quantum 1514b perturb 10sec
Sent 6293 bytes 20 pkts (dropped 0, overlimits 0)

qdisc cbq 1: rate 10Mbit (bounded,isolated) prio no
<snip>


the same command can be executed from shell with no error what so ever. I have tried adding the following line to /etc/sudoers in the end but its of no use.

<snip>
apache ALL = (ALL) NOPASSWD: /etc/rc.d/init.d/cbq.init,/sbin/tc,/sbin/ip
<snip>

i have also tried giving 777 in chmod to all files in /etc/sysconfig /var/www/html/ /var/www/cgi-bin/ and /etc/rc.d/init.d/

please tell me if i am wrong somewhere...or some superuser thing is missing... i have been googling around...but no success.!

please help..!!!!

thnx in anticipation
Ujjwal

Last edited by ujjwal_wadhawan; 03-03-2006 at 12:09 AM.
 
Old 03-03-2006, 06:53 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
u have to make the script executable for the apache user who usually is called "nobody" or "web" or sth like that. take a look at /etc/httpd/httpd.conf if u run apache-1.xx
look for
user
entry
 
  


Reply



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
Suse -- How to export user PATH to super user? w0262 Linux - Newbie 5 01-10-2006 09:39 PM
super user ruslombia Linux - Software 5 12-15-2005 12:28 PM
Running super user commands as normal user mickyg Linux - Security 5 10-14-2005 07:25 PM
normal user = super user jayakrishnan Linux - General 4 03-19-2002 09:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 09:17 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration