|
Home > Archive > Apache Server configuration support > September 2007 > [Apache] Following symbolic link
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
[Apache] Following symbolic link
|
|
| Joah Senegal 2007-09-24, 7:25 pm |
| Hello all,
I use the following script to run a command on my linux machine:
<?php
$output = shell_exec('ls -lart');
echo "<pre>$output</pre>";
?>
The script works fine if I use commands like cat ls dir. I get a output
back.
But now I made a symbolic link called groupmanager wich points to
/usr/lib/news/bin/ctlinnd. ctlinnd is a program to add a new group to a NNTP
server. normally this program should output "ok" or an error. but I get no
output. So the command isn;t executed. Its proberbly a security issue.
I added this to /etc/httpd/conf/httpd.conf
<Directory /usr/lib/news/bin>
Options All
AllowOverride All
</Directory>
My appache server is running under the user "apache".
I tried to do in the bash "sudo apache" to try the command manually under
this user... but it says the user isn;t available at the moment (even if I
shutdown apache)
if I type the command manual in the bash under user root everything works
fine.
I already performed chmod 777 on the files I need. but it stil doens;t works
anyone know what the problem here?
| |
| Davide Bianchi 2007-09-24, 7:25 pm |
| On 2007-09-24, Joah Senegal <bloker@hva.nl> wrote:
> But now I made a symbolic link called groupmanager wich points to
> /usr/lib/news/bin/ctlinnd.
You can't simply run any command out from a php script, the command is
probably trying to open files, load libraries and the like and all this
require different permissions. You either write a proper CGI script
and use the correct permissions or use one of the many web interface to
do the same things. Why re-inventing the wheel?
Davide
--
It's nice to be loved, but there's a lot to be said for CRINGING RESPECT
--Anonymous button bin
| |
| Joah Senegal 2007-09-24, 7:25 pm |
| No it is possible with the above script. Read mij topicstart.... I already
performed succesfully commands like ls, dir, who, chmod and more. Only this
program (ctlinnd) wont execute with this method.
"Davide Bianchi" <davideyeahsure@onlyforfun.net> wrote in message
news:slrnfffsi8.37j.davideyeahsure@fogg.onlyforfun.net...
> On 2007-09-24, Joah Senegal <bloker@hva.nl> wrote:
>
> You can't simply run any command out from a php script, the command is
> probably trying to open files, load libraries and the like and all this
> require different permissions. You either write a proper CGI script
> and use the correct permissions or use one of the many web interface to
> do the same things. Why re-inventing the wheel?
>
> Davide
>
> --
> It's nice to be loved, but there's a lot to be said for CRINGING RESPECT
> --Anonymous button bin
|
|
|
|
|