Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was getting sick of having to sudo every command in my web development folder (/var/www) so I tried to change the permissions to 777. The function seemingly worked (that is, gave no error), although I still wasn't able to edit any of the documents without root access.

Anyway, this isn't really a problem, I just thought I'd give it a shot. The trouble is, now, when I direct my browser to localhost, I get a 403. I presume it has to do with my modifying permissions, although, having changed it to 777, I can't see what permissions it could be lacking. Have I perhaps changed the owner or something similar?

Thanks in advance for any help.

share|improve this question
    
sudo bash -l is handy if you need root for a bit. –  Sirex Sep 2 '10 at 10:05
    
@Sirex: ...or sudo -s –  grawity Sep 2 '10 at 20:08
    
@grawity. Thats my thing learnt for the day then ;-) –  Sirex Sep 3 '10 at 7:07
add comment

1 Answer

up vote 4 down vote accepted

Depending on which distribution of Linux/Unix/BSD you use, your web server may feel that 777 is too insecure for the open web and refuse to serve pages because the permissions are set too liberally. If your /var/www/ folder is writable to anyone someone could just hijack your server, and your apache (or whatever web server you use) ist trying to protect you from that.

Try resetting permissions to the minimum that is needed to operate. You may want to su to the user you need to be (su - www for example) so you don't need to sudo everything, or you can sudo yourself a whole shell as Sirex suggests.

If your web server is running as root now you may also want to give it a user of its own. If it doesn't need to be root, don't let it be root -- for security's sake.

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.