1

Here's the configuration :

The directory :

/var/www/mount_ImpExp/ImpExp/

is a shared directory (Linux) from a PC with an IP adress 192.168.1.12

My PC IP adress is 192.168.1.11

I mounted that shared dir with the command : mount -t cifs -o auto,username=myusername,password=mypass //192.168.0.12/LINUX_U /var/www/mount_ImpExp

If I try to manually launch a rsync with :

rsync -t /var/www/mount_ImpExp/ImpExp/compteur_assur /usr/bin/

This works :

ls -al /usr/bin/compteur_assur
-rwxr-xr-x 1 zobz zobz 2501 2009-06-09 15:44 /usr/bin/compteur_assur

Now I create a exec.php file in my website : the path is : /var/www/html/Internet/mywebsite

the source is :

echo date('d/m/Y H:i:s');
echo "<br />";
var_dump(
  system("rsync -t /var/www/mount_ImpExp/ImpExp/compteur_assur /usr/bin/"));

it doesn't work.

In the php.ini the "safemode" is "off". So I may be able to execute any shell command. If I try to modify the exec.php file and do a simple :

var_dump( system("ls -al ."));
file

It works. So the "system" call works.

Thus I tried to modify the options in the httpd.conf file :


    # Ajout Olivier Pons / 11 juin 2009
    <Directory "/var/www/mount_ImpExp/ImpExp">
        AddDefaultCharset UTF-8
        Options All
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

I then restarted the server and nothing works. What shall I do where should I look next ? I'm stuck...

2 Answers 2

1

Okay I found the problem : it a "permission problem" (or "rights problem" I don't know how to say it in English, sorry)

[Batman]:/var/www/html/Internet/mywebsite# chown apache:apache /var/www/mount_ImpExp/
chown: changing ownership of `/var/www/mount_ImpExp/': Permission denied
[Batman]:/var/www/html/Internet/mywebsite# chmod o+r /var/www/mount_ImpExp/
chmod: changing permissions of `/var/www/mount_ImpExp/': Permission denied
[Batman]:/var/www/html/Internet/mywebsite#
0

Looks like you are trying to change the permissions of files you don't own. You need to set yourself as the owner then chmod 750.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .