Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
 /var/www$ wget http://ftp.drupal.org/files/projects/drupal-7.0.tar.gz

This results in:

    --2012-02-08 21:20:17--  http://ftp.drupal.org/files/projects/drupal-7.0.tar.gz
Resolving ftp.drupal.org... 64.50.233.100, 64.50.236.52
Connecting to ftp.drupal.org|64.50.233.100|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2728271 (2.6M) [application/x-gzip]
drupal-7.0.tar.gz: Permission denied

Cannot write to `drupal-7.0.tar.gz' (Permission denied).
eyedea@eyedea-ER912AA-ABA-SR1810NX-NA620:/var/www$ ^C
eyedea@eyedea-ER912AA-ABA-SR1810NX-NA620:/var/www$ wget http://ftp.drupal.org/files/projects/drupal-7.0.tar.gz
--2012-02-08 21:46:34--  http://ftp.drupal.org/files/projects/drupal-7.0.tar.gz
Resolving ftp.drupal.org... 64.50.236.52, 64.50.233.100
Connecting to ftp.drupal.org|64.50.236.52|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2728271 (2.6M) [application/x-gzip]
drupal-7.0.tar.gz: Permission denied

Cannot write to `drupal-7.0.tar.gz' (Permission denied).

I checked the permissions of /var/www and i can't change them. What's going on here?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

It's totally normal. your /var/www directory belongs to root user and root group with those rights drwxr-xr-x.

It's far more better to have /var/www belonging to root, because it will forbid possible security flaws in apache or php to write and change source code on this server.

What you can do about that :

  1. Make your wget with root rights. For instance :

    $ sudo wget http://ftp.drupal.org/files/projects/drupal-7.0.tar.gz or

    $ su -c "wget http://ftp.drupal.org/files/projects/drupal-7.0.tar.gz"

  2. Download it from your $HOME and untar it afterwards

    $ cd ~; wget http://ftp.drupal.org/files/projects/drupal-7.0.tar.gz

  3. Ignore those security recommendations and change rights of /var/www

    $ sudo chown `id -u`:`id -g` /var/www

EDIT : If you have broken your /var/www tree with a chmod -R 777 /var/www/* and haven't burn in hell, you can thank god and quickly execute those commands before he comes for you :

$ sudo find /var/www -type d -exec chmod 755 {} \;
$ sudo find /var/www -type f -exec chmod 644 {} \;
share|improve this answer
    
i should've just used sudo but before i got your response I ended up changing permissions to 777. @_@. What would you recommend I change them back to? –  Bodhidarma Feb 9 '12 at 17:03

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.