Start New Discussion within our Linux and Unix Community

Hi,

I use Ubuntu8. I have a folder in /var/www/Project1. When i try to save a php file into /var/www/Project1/ it generates error(writing permition).
This is what i do but doesn't solve my problem:

root@ubuntu:/home/ubuntu# sudo useradd myuser
root@ubuntu:/home/ubuntu# sudo chown myuser /var/www/Project1/
OR
root@ubuntu:/home/ubuntu# sudo chown root /var/www/Project1/

What is missing?

Thanks

If you're root, you won't need sudo. If under root you get permission errors, then you have some other issues. Perhaps check how your filesystem(s) are mounted.

u can try by changing the permissions

$ su
# cd /var
# chmod 777 www

then anyone can read/write from this folder

OK... it is somewhat a security expose :P .As i use my pc 4 myself i was not concerned about it. But if you want to use it only for yourself then i guess u have to change the owner to yourself. then

chmod 744

should do it.

it's very simple
whenever you are trying to access /var/www, using "cd /var/www"

what you should do...
1)open terminal
2)type "sudo bash"
3)it will ask you for your user account password, fill the password
4) now do "cd /var/www"

This way you have full write access

now do whatever you want to do via terminal

Few things I want to know whether you are trying to write to that folder by your application i.e; Apache/php or simply by terminal using root user?

--
Manoj

If you're root, you won't need sudo. If under root you get permission errors, then you have some other issues. Perhaps check how your filesystem(s) are mounted.

This article has been dead for over six months. Start a new discussion instead.