Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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??
@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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.