![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help required in this script. | jojo123 | UNIX for Advanced & Expert Users | 3 | 05-20-2009 04:05 AM |
| Executing a shell script from windows;script present in unix | rajneesh_kapoor | UNIX for Advanced & Expert Users | 4 | 05-08-2009 03:54 PM |
| Ksh Script help required... | marconi | Shell Programming and Scripting | 2 | 07-03-2008 11:28 AM |
| Script required to get a required info from file. Pls. help me. | ntgobinath | Shell Programming and Scripting | 2 | 05-31-2008 09:34 AM |
| Required Script | shameeque | Windows & DOS: Issues & Discussions | 3 | 02-14-2007 04:19 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Apache not executing script!! help required soon
i need to know all possible reasons for apache not able to execute a command on server side script.
I have a cgi script that calls a shell script .This shell script calls a perl script which has commnad in it. Ths command is not getting executed from gui.The return status of shell script is 256. The command is of type: `/path/xxx > /path/t.log`; Here in the t.log log file i can see: sh:xxx: permission denied but the all scripts have 777 permission, even command script has 777 permission. But from terminal evrything is working fine. Even other functions from the gui are working fine except this function. |
|
||||
|
how do i do that?can you please give me an example
Quote:
how to do that?please give me an exmaple |
|
||||
|
edit /etc/passwd, or use the command Code:
usermod -s /bin/bash apache su - apache cd to the path the perl script is in cd /path/ ./perlscript.pl see if it's executable, then Code:
usermod -s /sbin/nologin apache perhaps you have to specify hardcoded variables in the script, depends on what you are doing with it, you don't want to destroy something I guess apache username and path of /sbin/nologin may differ on your system |
|
||||
|
Quote:
Last edited by raksha.s; 05-26-2009 at 01:37 AM.. |
|
||||
|
Hi. raksha.s
To find the process owner. In solaris, it generally use 'ps -ef ' command to list all current process. In other Unix system use "ps -aux" instead. However, If your system has long list of process you can use "ps -ef | more" to watch it page by page. I have a simple script for you to find who is the owner of the httpd process as below. $ pgrep -f httpd | xargs -t -I {} ps -fp {} | cut -d" " -f1 The pgrep -f will fetch the httpds process id. The xargs prepare the output from pgrep as the agruments for ps command. The cut command with -d (delimiter) " " (space) give you the first column (user id) from PS command. For the apache it is, for security, usually running by "nobody" to get the lowest privilege. So, that why I ask you to check the httpd owner. About the cgi script, I hope you have already check that the second script that called by the first script is also permitted. Hope you can find the break point soon. Last edited by tom_cmu; 05-26-2009 at 07:30 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|