Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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...

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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#
share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.