LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   allow users to edit /var/www/html/someFile (http://www.linuxquestions.org/questions/linux-server-73/allow-users-to-edit-var-www-html-somefile-538897/)

blizunt7 03-19-2007 08:33 PM

allow users to edit /var/www/html/someFile
 
Hey all,
Been working with apache for a while now, but As long as I have been creating web site, ive been logging onto my site, and then as root editing all my /var/www/html/WEBSITE files.
NOw I have the need to add users to the system, and allow them to edit their own web content (/var/www/html/USER/). Figure to have them SSH in and edit.

Ive tried linking this file to their own home directory.

Any idea how to get this working?

THanks so much in advance

merize147 03-19-2007 09:11 PM

You can make them the owner or add their group to the folder you want them to edit.

account: user1
group: user01
/var/www/html/user1

Change owner: chown -R user1 /var/www/html/user1

Change group: chgrp -R user01 /var/www/html/user1

or both together: chown -R user1:user01 /var/www/html/user1

blizunt7 03-19-2007 09:23 PM

hmm, good thinking. haha!

If I can ask another question.

THis folder that we just created for this user, I dont know why IM having trouble accessing the file from a browser. Im using Virtual hosting, not im using 2 other entried, and those work. But for some reason, this doesnt. I moded the folder adam, for permissions adam/adam

When in a browser, i type "IP/adam" I get a 404.
Anything im missing that you can see?


# <VirtualHost IP>
# DocumentRoot /var/www/html/adam
# ServerName www.URL/adam
# ServerAlias URL/adam
# </VirtualHost>


THANKS!!!!

merize147 03-19-2007 09:56 PM

what are the permissions of the folder? The "other" group should have read access

blizunt7 03-19-2007 10:37 PM

Yes, all groups have read access

Sagebrush Gardener 03-19-2007 11:54 PM

> I get a 404.

Check your error_log for the "File does not exist" message. It should tell you the full path of the file that it can't find. Something like this...

[Mon Mar 19 01:39:40 2007] [error] [client 1.2.3.4] File does not exist: /home/newweb/public_html/test/test.html

The file that Apache is looking for may not be the file that you think it should be looking for.

MoMule 03-20-2007 07:34 AM

Ability to update virtual websites
 
Here's a thought...

Set up ProFTP with single user access for that user to ftp into their own home directory.

create a link from a folder in their home directory pointing to the /var/www/html/<folder_to_be_worked_on>

I use this setup for all of my virtual hostings.

Deion "Mule" Christopher

merize147 03-20-2007 07:49 AM

Quote:

Originally Posted by blizunt7
# <VirtualHost IP>


Why are you setting up a virtual host? Is your doc root different then /var/www/html?

as long as your doc root is /var/www/html then the adam folder is just that a folder and can be accessed by adding it to the the end of the URL.

http://<ipaddress>/adam or if you can resolve the name http://<dns_name>/adam

.

sn68 03-20-2007 07:50 AM

Quote:

Originally Posted by blizunt7
When in a browser, i type "IP/adam" I get a 404.
Anything im missing that you can see?

The problem could be SElinux policy, something to do with SELinux context labels, in such cases 403 error occurs even though permissions are correct when accessing through www because the context label was wrong
to configure
chcon -R -h -t httpd_sys_content_t /var/www/html/adam (substitute dir path)

Ref : SELinux Security Context File Labels
Edit:
OOPs ! I read 403 when 404 was asked, but the link given may provide answer


All times are GMT -5. The time now is 06:05 PM.