|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
Apache
hi all,
I'm calling perl script from php code;some commands in the script need root user to be executed but i’m 'www' user. For having root privilege i’ve modify the sudoers file ( incomment the line %wheel ALL=(ALL) NOPASSWD:ALL) and i’ve added the user 'www' to the group ‘wheel’ and next i've called the command but without success PHP Code:
thank you in advance |
|
||||
Exact same discussion: http://forums.freebsd.org/showthread.php?t=11510
It's FreeBSD, but the same things apply: shell, path, homedir, etc. |
|
|||
Thanks a lot DutchDaemon, i follow the instruction step by step.
i've started by given to 'www' shell but when i execute the command Code:
sudo -vi /etc/sudoers Code:
sudo: /etc/sudoers is mode 0644, should be 0440 sudo: no valid sudoers sources found, quitting |
|
|||
DutchDaemon,Carpetsmoker really,thank's a lot,You Have Been a Great Help!!!
I spent long time on this, first to understand that i have to dechroot apache in order to execute my perl script and second to give www root privilege. |
|
|||
Moderator,
I'm working on openbsd not Freebsd. |
|
|||
one other question please, in my suddoers file i have:
Code:
# User privilege specification root ALL=(ALL) SETENV: ALL www ALL=(ALL) NOPASSWD: ALL Code:
# User privilege specification root ALL=(ALL) SETENV: ALL www ALL=NOPASSWD: var/www/htdocs/msg.pl PHP Code:
|
|
||||
Why the need for sudo? Can't you solve the problem in a simpler/better way? What is so special about msg.pl that it needs to be run with sudo?
Quote:
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
|||
in msg.pl i try to connect to a gsm, this connection needs root privilege, given 'www' user root privilege is first thing that crossed my mind.
|
|
||||
Well, I would write a simple server which opens a socket, run that as root, and then connect to it with your PHP app.
This way you can keep your server chrooted, and also solved all the complexity problems with sudo and whatnot. I once wrote something similar with Python, I would post it as an example/guide but I can't seem to find it right now But this is a fairly common method of doing this sort of stuff so you should be able to find plenty of documentation/examples. I haven't used sudo in years, so I have little help to offer with that.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
|||
thank you Carpersmorker,i'll try to do it.
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Apache 2.2.14 and PHP | mgreen | NetBSD Package System (pkgsrc) | 0 | 27th January 2010 11:06 AM |
PHP 5.2.6 and Apache 1.3 | dialeight | OpenBSD Packages and Ports | 1 | 15th June 2009 03:04 AM |
Upgrade Apache 1.3 mod_ssl to Apache 2.2 | beandip | FreeBSD Ports and Packages | 11 | 26th March 2009 09:12 PM |
Apache & PHP | themaster | FreeBSD General | 2 | 14th June 2008 05:49 PM |
Apache SSL | mike171562 | FreeBSD General | 0 | 5th May 2008 09:41 PM |