LinuxQuestions.org
Visit Jeremy's Blog.
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, 09: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 02:50 AM.
 
Old 05-04-2011, 01:28 AM   #62
micxz
Senior Member
 
Registered: Oct 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, 02: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, 04: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, 07:53 AM   #65
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720
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, 09: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-05-2011, 12:58 AM   #67
micxz
Senior Member
 
Registered: Oct 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-05-2011 at 12:59 AM. Reason: added full path for sudo as well
 
Old 05-05-2011, 01: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, 01: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 01:26 AM.
 
Old 05-05-2011, 01:26 AM   #70
micxz
Senior Member
 
Registered: Oct 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 01:27 AM.
 
Old 05-05-2011, 01:30 AM   #71
micxz
Senior Member
 
Registered: Oct 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, 01: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 01:54 AM.
 
Old 05-05-2011, 02:40 AM   #73
micxz
Senior Member
 
Registered: Oct 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, 02: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 03:00 AM.
 
Old 05-09-2011, 10: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 11:01 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 12:01 PM
how i can run bash script on my web? mikejosh Programming 2 04-09-2010 10: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 12:24 PM
How toExecute bash scripts from web interface milescook Linux - Software 3 05-28-2006 09:44 AM
Execute bash commands from web page solomage Linux - Software 1 10-07-2004 11:54 AM


All times are GMT -5. The time now is 07:13 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration