LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-03-2011, 08:28 PM   #61
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1

Quote:
Originally Posted by MTK358 View Post
Does "my bash" mean "/var/www/cgi-bin/testing.sh", and what is "/var/www/cgi-bin/dmidecode"? Also, what is the "my php" file?
Quote:
/var/www/cgi-bin/dmidecode
the dmidecode is just a name.. you should not mind that.. it also can be change into serial.
=_= and also it not my php file.. what i mean was that is code for "my php".. -_- you ask a weird questions.. to made it easier for you change my php into "inside script.php". also the "inside my bash" is just a word..

Last edited by athrin; 05-04-2011 at 01:50 AM.
 
Old 05-04-2011, 12:28 AM   #62
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Quote:
Originally Posted by athrin View Post
the dmidecode is just a name.. you should not mind that.. it also can be change into serial.
=_= and also it not my php file.. what i mean was that is code for "my php".. -_- you ask a weird questions.. to made it easier for you change my php into "inside script.php". also the "inside my bash" is just a word..
athrin: You need to work you your communication skills. "inside my bash" is not just a word it is three words. And "to made it easier"?
 
Old 05-04-2011, 01:49 AM   #63
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by micxz View Post
athrin: You need to work you your communication skills. "inside my bash" is not just a word it is three words. And "to made it easier"?
haha.. ok2.. sorry,that just my bad habit.
 
Old 05-04-2011, 03:36 AM   #64
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
sigh~
looks like this threat is unsolved.. = =
 
Old 05-04-2011, 06:53 AM   #65
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
How about posting every single script (PHP and BASH) that has to do with dmidecode, and the full path and permissions of each of them?
 
Old 05-04-2011, 08:40 PM   #66
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
= =..i already post both php and bash script before.
Quote:
full path and permissions of each of them?
what do you mean by that?
 
Old 05-04-2011, 11:58 PM   #67
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Have you tried putting the full paths for this line:
Code:
sudo dmidecode | grep Number > /var/www/cgi-bin/dmidecode
Like so:
Code:
/usr/bin/sudo /usr/sbin/dmidecode | /usr/bin/grep Number > /var/www/cgi-bin/dmidecode
As apache's $PATH my not include /usr/sbin etc.

Last edited by micxz; 05-04-2011 at 11:59 PM. Reason: added full path for sudo as well
 
Old 05-05-2011, 12:19 AM   #68
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
i just need change this
Quote:
sudo dmidecode | grep Number > /var/www/cgi-bin/dmidecode
into
Quote:
/usr/bin/sudo /usr/sbin/dmidecode | /usr/bin/grep Number > /var/www/cgi-bin/dmidecode
right??

what do you mean by
Quote:
As apache's $PATH my not include /usr/sbin etc.
??
 
Old 05-05-2011, 12:22 AM   #69
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
i dont really understand the code that u give to me
Quote:
/usr/bin/sudo /usr/sbin/dmidecode | /usr/bin/grep Number > /var/www/cgi-bin/dmidecode
can you please explain to me the function for the code above

Last edited by athrin; 05-05-2011 at 12:26 AM.
 
Old 05-05-2011, 12:26 AM   #70
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
right that's what I'm saying but check each to make sure your paths are the same as what I posted.
Newbie $PATH explanation:
http://linux.about.com/od/linux101/l/blnewbie3_1_4.htm

Last edited by micxz; 05-05-2011 at 12:27 AM.
 
Old 05-05-2011, 12:30 AM   #71
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Quote:
Originally Posted by athrin View Post
i dont really understand the code that u give to me
can you please explain to me the function for the code above
There is no difference in the two. You wrote it without the full paths and I did. They are the same. After you read the link I posted you should understand how your shell knows where dmidecode is.
 
Old 05-05-2011, 12:52 AM   #72
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
i used the code that given to check $PATH and this output shown
Quote:
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
i search the dmidecode one by one and its locate inside /usr/sbin/

Last edited by athrin; 05-05-2011 at 12:54 AM.
 
Old 05-05-2011, 01:40 AM   #73
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
What I'm trying to tell you is when you run a cgi or php script it runs as apache. apache's $PATH may be different.
 
Old 05-05-2011, 01:49 AM   #74
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
oh~
so i need to find $PATH to apache or httpd and change it right?
err... my httpd also located inside /usr/sbin

Last edited by athrin; 05-05-2011 at 02:00 AM.
 
Old 05-09-2011, 09:40 PM   #75
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
so this threat is unsolve right??
yes.. i got permission denied from the code that you give to me.
Code:
/usr/bin/sudo /usr/sbin/dmidecode | /usr/bin/grep Number > /var/www/cgi-bin/dmidecode
and what about the path? and also why "| /usr/bin/grep Number" came from?
well i got permission denied if i run the script with sh script.sh after that with web

Last edited by athrin; 05-09-2011 at 10:01 PM.
 
  


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
[SOLVED] How to execute bash script from web page mustkill Linux - Server 16 05-20-2010 11:01 AM
how i can run bash script on my web? mikejosh Programming 2 04-09-2010 09:59 AM
How do I execute a bash script from a link on a web page? Is there any way to do this digilifellc Linux - Desktop 5 03-10-2010 11:24 AM
How toExecute bash scripts from web interface milescook Linux - Software 3 05-28-2006 08:44 AM
Execute bash commands from web page solomage Linux - Software 1 10-07-2004 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:57 AM.

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