LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-04-2004, 12:38 PM   #1
eddi
LQ Newbie
 
Registered: Feb 2004
Location: England UK
Distribution: RH9 Mandrake 10.2
Posts: 14

Rep: Reputation: 0
Question cannot read/write to /var/www


Hi,

I have samba running quite nicely, and i have a few folders that i can access from my XP machine aswell as being able to move files to and from.

However this is not the case with the webserver directory /var/www , i can open it, but i cannot not move my web development work over to it.

I've had ago at permissions with the chmod and gave 777, and that seem the only way it will work, which is not great. The other samba folders are set on 655, so why does this not work for 'www' folder?


Cheers
 
Old 02-04-2004, 03:08 PM   #2
ricstirato
Member
 
Registered: Jan 2004
Location: Gießen, Germany
Distribution: Xubuntu 12.04, Mythbuntu, Ubuntu Server 12.04
Posts: 174

Rep: Reputation: 24
The default owner of /var/www is root, and you probably don't connect as root.

If you are single user, do

chown -R <username> /var/www

The user will then be owner of /var/www and all it's contents. In this case mode 755 (for directories) and 644 (for files) will do.


If there are more users that should have write access, create a group and assign it to /var/www:

groupadd wwwedit
chgrp -R wwwedit /var/www

Add all relevant users to the group, e.g. by editing /etc/group (put a comma separated list of users at the end of the group's line) or use your distro's GUI tool to do so.

In this case, the group must have write access:

chmod -R g+w /var/www

You should also force the group for all new files under /var/www:

chmod 2775 /var/www
cd /var/www
chmod 2775 `find -type d`


To avoid permission problems, the users should have a umask of 002 when they come in via console. Default is 022. You can change this (distro-dependant) by editing these user's ~/.bashrc

If you use Samba to access /var/www, set modes 775 and 664 for directories and files respectively for the www-Share in smb.conf.


An alternative is to use the user's "public_html" directory in their home directories, have a look at Apache's httpd.conf.
In this case the web pages can be accessed in the form

http://<servername>/~<username>/

Permissions for /home/<user> and /home/<user>/public_html must be set to (at least) 701 for this to work.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VSFTPD /var/www mmethe Linux - Software 2 05-10-2005 04:37 AM
help in /var/www/html/!! chidomen Linux - Newbie 4 01-13-2005 11:02 AM
thanks boss....... now i don't have a /var/www joesbox General 4 11-08-2003 01:38 AM
Open office read only, K-write read/write mode lwtvh Linux - Newbie 1 07-19-2003 11:33 AM
chmod of /var/www/html alTereD Linux - Security 1 12-16-2002 02:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration