Execution problem unix commands in Perl CGI


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Execution problem unix commands in Perl CGI
# 22  
Old 01-06-2012
Quote:
Originally Posted by Navrattan Bansa
# Make sure it belongs to the web server.
chown apache:apache /etc/apache-key

what is apache here ?? Is It already in my system or i have to create it.
The system username 'apache' and the system group 'apache'. If you're using the apache webserver, you already have both of these.

If you don't, it may be some other user and group, but you never mentioned not having apache.
# 23  
Old 01-06-2012
it would be in /etc/passwd, isn't in it?

---------- Post updated at 01:11 AM ---------- Previous update was at 01:11 AM ----------

m i right?

---------- Post updated at 01:15 AM ---------- Previous update was at 01:11 AM ----------

do i need to change anything in id_rsa ?? after copy operation
# 24  
Old 01-06-2012
Quote:
Originally Posted by Navrattan Bansa
it would be in /etc/passwd, isn't in it?
If you don't have apache, chown will say so. It won't catch fire or explode -- none of the commands I've given you are dangerous. If you don't have apache, you'll need to figure out what web server you do have so I can write different instructions for you.

Did 'chown apache:apache /path/to/filename' print an error message? If not, then it worked, and you have apache.

Yes, 'apache' would be in /etc/passwd as well as /etc/group

Quote:
do i need to change anything in id_rsa ?? after copy operation
The contents of the file itself don't change.

You need to run the commands I showed you to set its permissions and its folders' permissions correctly.
# 25  
Old 01-06-2012
oka thankx dude

---------- Post updated at 01:27 AM ---------- Previous update was at 01:24 AM ----------

hey one thing more when i say on the terminal:
ps -ef | grep tomcat
It gives me all correct info.
When i run this via cgi then why it is showing some wrong information.

Last edited by Navrattan Bansa; 01-06-2012 at 04:26 PM..
# 26  
Old 01-06-2012
Did chown work?

Quote:
Originally Posted by Navrattan Bansa
hey one thing more when i say on the terminal:
ps -ef | grep tomcat
It gives me all correct info.
When i run this via cgi then why it is showing some wrong information.
Depending on what's happening it could be various things. Just knowing that it's "wrong" in some vague manner doesn't tell me which of those might be happening.

What do you see when you run it in terminal?

What do you see when you run it in CGI?

What is your CGI code?

Quote:
?????
Quote:
Originally Posted by Corona688
We are not here 24/7. If you don't get an answer immediately, wait!
# 27  
Old 01-06-2012
Navrattan Bansa,
Gentle reminder: please stop bumping-up posts and follow the rules.
# 28  
Old 01-06-2012
on terminal i see like:
Code:
apache (id:number)
apache (id:number)

i get full info of tomcat running.
on cgi i code like
Code:
system("ps -ef | grep tomcat")

but i dont get the tomcat running info.
Moderator's Comments:
Mod Comment
Please use code tags when posting data and code samples!

Last edited by vgersh99; 01-06-2012 at 04:34 PM.. Reason: please use code tags!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl execution commands

I don't know to debug the program todaylive.pl program. plz someone let me know what are the commands I need to know to debug the perl programs to find out the error on it. (3 Replies)
Discussion started by: ramkumar15
3 Replies

2. Shell Programming and Scripting

Perl CGI : unable to download the excel sheet from perl cgi page

Hi All, I have written an cgi perl script that displays an image(Excel image) and when clicked on that Image I need to download a excel sheet. I made sure that excel sheet exists in the folder with the given name but still I am not able to download the sheet. print "<center><table... (2 Replies)
Discussion started by: scriptscript
2 Replies

3. Shell Programming and Scripting

Perl cgi pages out of cgi-bin folder in WINDOWS

Hi team, I have a typical problem with cgi pages in apache webserver in WINDOWS I am able to execute(display) the pages that are saved in cgi-bin folder. But I am not able to execute the pages stored in htdocs or other folder other than cgi-bin folder. Could anyone please let me know how... (1 Reply)
Discussion started by: scriptscript
1 Replies

4. Web Development

problem with exporting vairable from one perl cgi to another perl cgi script while redirecting.

Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect. Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is redirected to welcome page. My... (3 Replies)
Discussion started by: Arun_Linux
3 Replies

5. Web Development

cgi script and external UNIX commands (like swadm)

Hi, I am trying to implement a server monitoring dashboard using cgi scripting. I am planning to run the necessary unix scripts from the web page using cgi. This method works fine for standard unix commands but I am unable to run some external unix commands (like swadm show_processes, swadm... (9 Replies)
Discussion started by: jofinjoseph
9 Replies

6. Shell Programming and Scripting

Execution problem with perl

I got the below error when using the below code...it seem that perl interpret the "'" in the middle and therefore the pipe is not finished. perl -wle ' @a=`who| perl -wlane 'print \$F;' | sort -u` ; chomp @a ; print @a; ' the error message in cygwin is:- perl: No match. | sort... (12 Replies)
Discussion started by: ahmad.diab
12 Replies

7. UNIX Desktop Questions & Answers

CGI execution problem on Unix

Hello everyone, I have developed a cgi application on windows. i have created a folder in webapps of tomcat, within that a WEB-INF folder and in that cgi folder. This cgi folder contains one executable. The web.xml is as follows: <servlet> <servlet-name>cgi</servlet-name> ... (2 Replies)
Discussion started by: Preeti_t
2 Replies

8. Solaris

Solaris 10.5 perl and cron job execution problem

Hi, I want to run a crontab job on solaris 10.5. I have configured the crontab accordingly 10 * * * * /scripts/dbalter.pl >> /scripts/cronout.txt However this does not work .Then I go to /var/mail/root and find an error in the output: From root@myserver Wed Feb 4 17:02:00 2009... (1 Reply)
Discussion started by: sonu2die4
1 Replies

9. Shell Programming and Scripting

Problem while execution of second set of commands

Hi, I have a shell script with code . perf.env cd $QRY_DIR for SHELL_FILE in sql1 do export SNAME=$SHELL_FILE ${SCRIPT_DIR}/perf_qry.sh ${SPOOL_DIR} ${DB_ENVNAME} ${NAME} & RC=$(expr ${RC:-0} + $? ) sleep 60 if then echo sysdate>test1 echo query1.txt>>test1 grep -i... (6 Replies)
Discussion started by: ran16
6 Replies

10. Shell Programming and Scripting

Problem while execution of second set of commands

Hi, I have a shell script with code . perf.env cd $QRY_DIR for SHELL_FILE in sql1 do export SNAME=$SHELL_FILE ${SCRIPT_DIR}/perf_qry.sh ${SPOOL_DIR} ${DB_ENVNAME} ${NAME} & RC=$(expr ${RC:-0} + $? ) sleep 60 if then echo sysdate>test1 echo query1.txt>>test1 grep -i... (0 Replies)
Discussion started by: ran16
0 Replies
Login or Register to Ask a Question