Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

File Permission problem on perl -cgi program

by nagivreddy93 (Novice)
on May 04, 2011 at 06:02 UTC ( [id://902818]=perlquestion: print w/replies, xml ) Need Help??

nagivreddy93 has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I have given a 777 permission for file (-rwxrwxrwx 1 nagios nagios 75 May 2 13:27 set_bpi_perms.sh), when I run the program on Console (terminal), it's works perfectely but in the web(cgi) it's not working properly.

below are the users and group access permissions:

/etc/group file
nagios:x:500:
apache:x:501:
nagcmd:x:502:apache,nagios

Below is the error displaying when i run in cgi program:

File bpi.conf is not writable! Please execute the following commands as the root user to set correct permissions:
cd /usr/local/nagios/share/nagiosbpi
chmod +x set_bpi_perms.sh
./set_bpi_perms.sh

and bpi.conf file also having a 777 permission

The code is working perfectely on other servers, i have deployed a code on new server it's getting error messages
Please let me know your ideas on this ..


Thanks Reddy.

Replies are listed 'Best First'.
Re: File Permission problem on perl -cgi program
by Anonymous Monk on May 04, 2011 at 07:22 UTC
    Please let me know your ideas on this ..

    You describe an impossible situation, so one of your assumptions must be wrong, the solution is to test all assumptions :) Maybe the programs cwd is wrong, maybe the program is running in a chroot jail or some other kind of sandbox....

Re: File Permission problem on perl -cgi program
by Anonymous Monk on May 04, 2011 at 10:39 UTC

    Web servers are often fussy about running commands that can be modified "too easily". A script that allows anyone to modify it certainly would fall in that category. Try mode 555. (Do you really want to allow any user to modify your scripts? Making any file writable by everyone is asking for trouble).

Re: File Permission problem on perl -cgi program
by scorpio17 (Canon) on May 05, 2011 at 14:42 UTC

    Does this server happen to have SELinux enabled? If so, you have to check the security context of the file (chcon), as well as the usual read/write permission settings (chmod).

    Or else you could simply disable SELinux...

      Thanks for your help.. I disabled the selinux and reboot the server, it's works perfectely....

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://902818]
Approved by mertserger
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-03-28 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found