We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,642 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Writing permission to /var/www/

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

7
Contributors
11
Replies
2 Years
Discussion Span
1 Year Ago
Last Updated
13
Views
veledrom
Practically a Posting Shark
822 posts since Apr 2008
Reputation Points: 42
Solved Threads: 1
Skill Endorsements: 0

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.

John A
Vampirical Lurker
Team Colleague
7,633 posts since Apr 2006
Reputation Points: 2,233
Solved Threads: 340
Skill Endorsements: 7

Ho do we check "filesystem(s) are mounted" ?

veledrom
Practically a Posting Shark
822 posts since Apr 2008
Reputation Points: 42
Solved Threads: 1
Skill Endorsements: 0

Run mount with no arguments.

John A
Vampirical Lurker
Team Colleague
7,633 posts since Apr 2006
Reputation Points: 2,233
Solved Threads: 340
Skill Endorsements: 7

-> Alt F2
-> gksu nautilus /directory
->paste there

deepugtm
Junior Poster in Training
96 posts since Aug 2008
Reputation Points: 2
Solved Threads: 2
Skill Endorsements: 0

u can try by changing the permissions

$ su
# cd /var
# chmod 777 www

then anyone can read/write from this folder

farhan.foxtrot
Newbie Poster
21 posts since Aug 2008
Reputation Points: 10
Solved Threads: 2
Skill Endorsements: 0

Isn't it (chmod 777) security hole, if i have more than 1 user?

veledrom
Practically a Posting Shark
822 posts since Apr 2008
Reputation Points: 42
Solved Threads: 1
Skill Endorsements: 0

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.

farhan.foxtrot
Newbie Poster
21 posts since Aug 2008
Reputation Points: 10
Solved Threads: 2
Skill Endorsements: 0

As i am new in Linux i have found an usefull information for myself http://www.december.com/unix/ref/chmod.html

Others like me can use this as well.

Thanks

veledrom
Practically a Posting Shark
822 posts since Apr 2008
Reputation Points: 42
Solved Threads: 1
Skill Endorsements: 0

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

smrati.katiyar
Newbie Poster
11 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

manojsamtani
Light Poster
Banned
37 posts since Apr 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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.

iigwk
Newbie Poster
6 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0889 seconds using 2.68MB