Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

[PROBLEM] Apache as root on 1 file (visudo)
Thank you for your donation

Pages (2): 1 2 Next »
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Problem: Apache as root on 1 file (visudo)
27th Jan, 2014, 03:09 AM
Post: #1
lukeg01 Offline
Registered
Posts: 77
Joined: Dec 2013
Reputation: 1
Apache as root on 1 file (visudo)
hello,
i got a problem
i need apache to have acces to 2 scripts ( /home/xbian/lights/elro & /home/xbian/lights/action {there is a duplicate in /home/xbian/wiringPi/examples/lights})
when adding this to the visudo file
www-data ALL=(ALL) NOPASSWD: /home/xbian/wiringPi/examples/lights/./
it doesn't work, it can't run the scripts, so i tryed:
www-data ALL=(ALL) NOPASSWD: /home/xbian/wiringPi/examples/lights/
now im on : www-data ALL=NOPASSWD: ALL
and still doesn't work

i prefer the link to the file sinds it is more safe but can't get it to work...

luke
Find all posts by this user
Quote this message in a reply
27th Jan, 2014, 04:57 AM
Post: #2
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Apache as root on 1 file (visudo)
Just use pilight Smile

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
27th Jan, 2014, 05:02 AM
Post: #3
lukeg01 Offline
Registered
Posts: 77
Joined: Dec 2013
Reputation: 1
RE: Apache as root on 1 file (visudo)
(27th Jan, 2014 04:57 AM)CurlyMo Wrote:  Just use pilight Smile

Is there a list of brands pi light works with ?
And how does it posts command from web interface, that way I can include it in my web app
Can I switch lights from terminal this way?

Luke
Find all posts by this user
Quote this message in a reply
27th Jan, 2014, 06:18 AM
Post: #4
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
Re: Apache as root on 1 file (visudo)
Did you even took the effort to check the pilight website? ConfusedConfused

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
27th Jan, 2014, 03:10 PM
Post: #5
lukeg01 Offline
Registered
Posts: 77
Joined: Dec 2013
Reputation: 1
RE: Apache as root on 1 file (visudo)
(27th Jan, 2014 06:18 AM)CurlyMo Wrote:  Did you even took the effort to check the pilight website? ConfusedConfused
Yes, but didn' find it
Find all posts by this user
Quote this message in a reply
27th Jan, 2014, 07:51 PM
Post: #6
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Apache as root on 1 file (visudo)
- The list of brands can be found on the main page on the right. Can't be clearer.
- The last blog post is about the webinterface.
- The frontpage message is all about what pilight is (including it's webinterface).
- The second to last blog post is about how to switch lights from the command line.

You can't be serious when you say you took some effort.

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
3rd Feb, 2014, 12:23 PM
Post: #7
mk01 Offline
Registered
Posts: 2,485
Joined: Mar 2013
Reputation: 209
RE: Apache as root on 1 file (visudo)
@lukeg01

www-data ALL= NOPASSWD: /home/xbian/wiringPi/examples/lights

and command to run it (issued by apache) needs to be : "sudo /home/xbian/wiringPi/examples/lights"

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
5th Feb, 2014, 06:38 AM
Post: #8
lukeg01 Offline
Registered
Posts: 77
Joined: Dec 2013
Reputation: 1
RE: Apache as root on 1 file (visudo)
(3rd Feb, 2014 12:23 PM)mk01 Wrote:  @lukeg01

www-data ALL= NOPASSWD: /home/xbian/wiringPi/examples/lights

and command to run it (issued by apache) needs to be : "sudo /home/xbian/wiringPi/examples/lights"

Still doesn't work... Take a look at my PHP page, I think it goes wrong there

PHP Code:
<?php
if ( isset($_POST['button']) ) {
shell_exec('sudo /home/xbian/wiringPi/examples/lights/elro '.$_POST["button"].'');
}
?>

<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<head>

    <!-- Basic Page Needs
  ================================================== -->
    <meta charset="utf-8">
    <title>Licau</title>
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Mobile Specific Metas
  ================================================== -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <!-- CSS
  ================================================== -->
    <link rel="stylesheet" href="stylesheets/base.css">
    <link rel="stylesheet" href="stylesheets/skeleton.css">
    <link rel="stylesheet" href="stylesheets/layout.css">

    <!--[if lt IE 9]>
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Favicons
    ================================================== -->
    <link rel="shortcut icon" href="images/favicon.ico">
    <link rel="apple-touch-icon" href="images/light.png">
    <link rel="apple-touch-icon" sizes="72x72" href="images/light.png">
    <link rel="apple-touch-icon" sizes="114x114" href="images/light.png">

</head>
<body>



    <!-- Primary Page Layout
    ================================================== -->

    <!-- Delete everything in this .container and get started on your own site! -->

    <div class="container">
        <div class="sixteen columns">
            <h1 class="remove-bottom" style="margin-top: 40px"><img src="./images/light.png"> Licau</h1>
            <h5>Version 0.1</h5>
            <hr/>
                <h3>Beneden</h3>
                         <legend>Woonkamer</legend>
                          <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
                             <button class="button" type="submit" name="button" value="22 C on" />aan</button>
                             <button class="button" type="submit" name="button" value="22 C off" />uit</button>
                          </form>
            <hr/>
            
                <h3>Boven</h3>
                         <legend>Hal</legend>
                          <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
                             <button class="button" type="submit" name="button" value="22 A on" />aan</button>
                             <button class="button" type="submit" name="button" value="22 A off" />uit</button>
                          </form>
                          
                         <legend>Elektrische Deken</legend>
                          <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
                             <button class="button" type="submit" name="button" value="22 C on" />aan</button>
                             <button class="button" type="submit" name="button" value="22 C off" />uit</button>
                          </form>
            <hr/>
        </div>
        

    </div><!-- container -->


<!-- End Document
================================================== -->
</body>
</html> 

What I use in terminal= /home/xbian/wiringPi/examples/lights/elro 22 A on
Find all posts by this user
Quote this message in a reply
5th Feb, 2014, 06:57 AM
Post: #9
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Apache as root on 1 file (visudo)
@mk01, shouldn't you be promoting pilight as a favor Wink
@lukeg01, still didn't hear from you why pilight doesn't suit your needs.

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
5th Feb, 2014, 07:10 AM
Post: #10
lukeg01 Offline
Registered
Posts: 77
Joined: Dec 2013
Reputation: 1
RE: Apache as root on 1 file (visudo)
(5th Feb, 2014 06:57 AM)CurlyMo Wrote:  @mk01, shouldn't you be promoting pilight as a favor Wink
@lukeg01, still didn't hear from you why pilight doesn't suit your needs.


It doesn't work with my sender, I want I system I understand at least a bit, pilight is a bit hard for me
Find all posts by this user
Quote this message in a reply
5th Feb, 2014, 07:26 AM
Post: #11
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Apache as root on 1 file (visudo)
I never heard any user that had sender problems? It's wierd that you want a system you understand but i only read questions here on how to get it to work Wink

Did you read the tutorials?
http://www.pilight.org/post/controlling-radio-outlets

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
5th Feb, 2014, 07:32 AM
Post: #12
lukeg01 Offline
Registered
Posts: 77
Joined: Dec 2013
Reputation: 1
RE: Apache as root on 1 file (visudo)
(5th Feb, 2014 07:26 AM)CurlyMo Wrote:  I never heard any user that had sender problems? It's wierd that you want a system you understand but i only read questions here on how to get it to work Wink

Did you read the tutorials?
http://www.pilight.org/post/controlling-radio-outlets

I found it @ the Dutch Tweakers

http://gathering.tweakers.net/forum/list_messages/1556119

Says it written by you?
Find all posts by this user
Quote this message in a reply
5th Feb, 2014, 08:09 AM
Post: #13
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Apache as root on 1 file (visudo)
Who me? Wink

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
5th Feb, 2014, 08:12 AM
Post: #14
lukeg01 Offline
Registered
Posts: 77
Joined: Dec 2013
Reputation: 1
RE: Apache as root on 1 file (visudo)
(5th Feb, 2014 08:09 AM)CurlyMo Wrote:  Who me? Wink

Looks like it to me,
But does work with the sender i got
And in a LPF really needed? I'm using it without now and it works
Find all posts by this user
Quote this message in a reply
5th Feb, 2014, 08:31 AM
Post: #15
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Apache as root on 1 file (visudo)
A new LPF will be released soon, so be patient and follow the tweakers topic.

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Pages (2): 1 2 Next »
Post Reply 


  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 17th May, 2025, 02:44 AM Powered By MyBB, © 2002-2025 MyBB Group.