LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-24-2006, 05:02 PM   #1
disorderly
Member
 
Registered: Sep 2003
Location: NJ
Distribution: RHEL5
Posts: 154

Rep: Reputation: 30
apache - users and groups


hello,
i have apache running as user/group: apache/apache.
DocumentRoot is owned by root and is /var/www/html. when i want to create a new folder in /var/www/html, i have to do it as root and then change it to my username/group and it's a pain.

can someone clue me in on a better way to have this setup? i'd like our users to be able to add files & folders to /var/www/html/folders but i read that i shouldn't add my username to the apache group, is that right? something about a wheel group right?

thanks,
disorderly
 
Old 05-24-2006, 05:40 PM   #2
hobbestec
LQ Newbie
 
Registered: Nov 2003
Location: Boston, MA
Distribution: Debian, Ubuntu, Fedora
Posts: 27

Rep: Reputation: 15
Do your users have their own home directories? You can use the UserDir directive to specify a folder name in their home directory that holds their website files such as public_html. The user would upload files into their own public_html folder, then can go to a url like www.yourname.com/~user to see the website that they have stored in their own home directory.
 
Old 05-24-2006, 05:55 PM   #3
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
I prefer using hobbestec's method when setting up a webserver with multiple users. If all of you have to be able to write to the /var/www/html, you can create a croup called something like webdev and give recursively give it read and write access to /var/www/html.
 
Old 05-24-2006, 07:05 PM   #4
disorderly
Member
 
Registered: Sep 2003
Location: NJ
Distribution: RHEL5
Posts: 154

Original Poster
Rep: Reputation: 30
thanks for the replies guys
@hobbestec - our setup is much simpler than even that. there are only 4 of us that are adding webpages to the webserver, and i'm just looking to not have to switch to root every time i want to add a file in the /var/www/html/* folder.

@reddazz - if i give webdev, read and write permissions to /var/www/html, will subsequently created files be readable by webdev group? or just the existing ones?

two more simple things:
1) should /var/www/html be owned by user&group: root, apache, or should it be owned by user root, but group webdev?

2) and when i run scripts in programs (like mambo,joomla, etc..) they always add files as user: apache so i can't modify them without, again, chmod'ing them as root. if i add apache to the webdev group would it fix this irritating problem??

thanks again,
disorderly
 
Old 05-25-2006, 06:11 AM   #5
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Quote:
@reddazz - if i give webdev, read and write permissions to /var/www/html, will subsequently created files be readable by webdev group? or just the existing ones?
Oops, I forgot to mention that you would also have to recursively change ownership of /var/www/html so that all files belong to the webdev group. /var/www/html can be owned by user root (or whatever user you want) but the group has to be changed to webdev so that others in this group can write to /var/www/html. As for your problems with Mambo, joomla etc, adding apache to webdev group may resolve your problems.

Its probably a good idea to invest in a test machine to use a test server so that you production machine isn't affected by changes you make whilst trying to test things out.

Last edited by reddazz; 05-25-2006 at 06:13 AM.
 
Old 05-25-2006, 11:04 AM   #6
disorderly
Member
 
Registered: Sep 2003
Location: NJ
Distribution: RHEL5
Posts: 154

Original Poster
Rep: Reputation: 30
thank you reddazz that is exactly the information i was looking for.
i've chmod'ed /var/www/html as 2775 so now the group under webdev is able to read/write to the folders and the files they create are their own, but modifiable by the webdev group.

it's not going to open any security holes i don't know about by adding apache to webdev group right - because this sounds like the perfect solution!

oh, and no worries, i have a test environment on which to experiment so at worst i bork the system and i can't use it to read slashdot for a day or so
thanks again,
disorderly
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Users and groups ssmaitra Linux - Newbie 5 12-11-2005 07:10 AM
users and groups twb2005 Linux From Scratch 2 10-10-2005 02:47 PM
apache X users and groups. stomach Linux - Software 0 09-09-2005 10:58 AM
Apache users and Groups m2azer Linux - Newbie 1 09-19-2004 08:17 PM
users and groups krfulton Linux - Security 1 01-05-2004 04:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:22 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