LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 08-28-2006, 08:50 AM   #1
adagio
LQ Newbie
 
Registered: Aug 2006
Location: Hampshire, England
Distribution: Ubunto - Dapper Drake
Posts: 4

Rep: Reputation: 0
Angry vsftpd configuration for web server - newbie


Distro Dapper Drake
I want to set up a web server. I have managed to configure Apache to serve files generated on the server, I can upload using ftp to \var\www with a local username and password. Problem - file permissions are wrong and Apache returns
"Forbidden
You don't have permission to access /index.html on this server."

I can manually (on the server) modify the permissions to correct the problem but clearly this is a pain to do each time to each file.
How can I configure vsftpd such that the correct permissions are allocated?
 
Old 08-28-2006, 11:41 PM   #2
blankbmx
LQ Newbie
 
Registered: Aug 2006
Distribution: Debian/CentOS
Posts: 23

Rep: Reputation: 15
You might want to do something like this:

Add the user that you are logging into FTP as to a group, let's say "administrators."

Code:
# usermod -g administrators (username)
You can then modify the permissions of the "/var/www" directory to be writable by owner and group, like such:

Code:
# chmod 775 /var/www
And then finally, make "/var/www" part of the administrators group:

Code:
# chgrp administrators /var/www
This way the files that you upload should be uploaded as part of the administrators group, and apache will be able to serve the files just fine.
 
Old 08-29-2006, 04:39 AM   #3
adagio
LQ Newbie
 
Registered: Aug 2006
Location: Hampshire, England
Distribution: Ubunto - Dapper Drake
Posts: 4

Original Poster
Rep: Reputation: 0
Thank you for taking the trouble to respond to my query. I believe that I have done as you suggest with the user 'david'. The directory \var\www has the properties:

Quote:
drwxrwxr-x 3 david administrators 4096 2006-08-29 10:15 www
the uploaded files have the properties:

Quote:
-rw------- 1 david administrators 3636 2006-08-29 10:34 index.html
-rw------- 1 david administrators 6425 2006-08-29 10:34 profiles.htm
-rw------- 1 david administrators 9602 2006-08-29 10:34 tours.htm
Apache will not serve them.
 
Old 08-29-2006, 05:02 AM   #4
adagio
LQ Newbie
 
Registered: Aug 2006
Location: Hampshire, England
Distribution: Ubunto - Dapper Drake
Posts: 4

Original Poster
Rep: Reputation: 0
Further to above the Apache error log reports:

Quote:
[Tue Aug 29 10:40:13 2006] [error] [client 192.168.0.3] (13)Permission denied: file permissions deny server access: /var/www/index.html
 
Old 08-29-2006, 11:07 AM   #5
blankbmx
LQ Newbie
 
Registered: Aug 2006
Distribution: Debian/CentOS
Posts: 23

Rep: Reputation: 15
try looking in /etc/vsftpd/vsftpd.conf, and see if there is a line that says:

Code:
local_umask=077
If this is set to 077, try setting it to 022.
You must then restart the vsftpd service. Depending on whether you have it set to start up in standalone mode or not, you will have to run one of the following commands:

/etc/init.d/vsftpd restart (for standalone mode)
/etc/init.d/xinetd restart

Files should be uploaded with read permissions for everyone. Thus allowing apache to server your files.
 
Old 08-29-2006, 12:11 PM   #6
adagio
LQ Newbie
 
Registered: Aug 2006
Location: Hampshire, England
Distribution: Ubunto - Dapper Drake
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks again. However, in the last 15 minutes I have just made the following change to apache2.conf.


Quote:
# the lines below were the original
# User www-data
# Group www-data

# added by david 29/08/2006
User david
Group administrators
everything works wonderfully well!
 
Old 08-29-2006, 01:05 PM   #7
blankbmx
LQ Newbie
 
Registered: Aug 2006
Distribution: Debian/CentOS
Posts: 23

Rep: Reputation: 15
i see, so now apache is running as user david:administrators. that works too. but you will probably encounter the same problem if your try to upload any files as a different user in the future. just a heads up.
 
  


Reply

Tags
apache, vsftpd


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
FTP (vsftpd) and web server (apache) TC10284 Linux - Software 2 07-15-2006 06:14 PM
ADSL Router Web configuration pages appears instead of Personal Web Server Pages procyon Linux - Networking 4 12-20-2004 05:44 PM
web server configuration cyrilvictor Linux - Newbie 4 11-01-2004 08:59 AM
web server configuration threize Linux - Networking 1 06-27-2001 01:56 AM
web server configuration threize Linux - Networking 1 06-25-2001 08:30 AM


All times are GMT -5. The time now is 09:12 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration