LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Setting file permissions in Apache on Debian Etch (http://www.linuxquestions.org/questions/linux-server-73/setting-file-permissions-in-apache-on-debian-etch-561847/)

crmaykish 06-14-2007 02:49 PM

Setting file permissions in Apache on Debian Etch
 
I have just set up a server on Debian Etch, I have Apache2, PHP, MySQL and VSFTPD installed. I have ftp access to /var/www and I can upload everything just fine. However when I try to open the server (192.168.1.50) in a browser I get:

Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

Fatal error: Unknown: Failed opening required '/var/www/index.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0

Obviously a permissions problem. I deleted the apache2-defaults folder and changed the ownership of the www folder to webmaster (my ftp user).

What can I do to allow anything in that folder to be viewable from now on?

Thanks.

j-ray 06-15-2007 04:58 AM

chmod 0755 directory
chmod 0444 file.php

so the directory where the files reside has to be executable, the files at least readable.
the solutions above are pretty restrictive, adjust to your needs

crmaykish 06-16-2007 02:30 PM

I can do that and then the files load in the browser, but every time I add a new file or update an existing one, I have to run that again. Is there a way to make it so any file uploaded via ftp to the /var/www is automatically set to a certain permission (ie 0444)?

crmaykish 06-16-2007 02:34 PM

Nevermind, I've got it figured out.

I had to set the umask in my vsftpd configuration so files that are uploaded are set to the proper permissions.

Thanks for your help.

oldog 07-24-2008 11:47 AM

Quote:

Originally Posted by crmaykish (Post 2789714)
Nevermind, I've got it figured out.

I had to set the umask in my vsftpd configuration so files that are uploaded are set to the proper permissions.

Thanks for your help.

Thank you! This solved my problem, which I had been working on for days.

(It is a mystery to me that, if this is required, it is not a common problem. Seems like a ton of people run servers and most of them put files there by ftp. Is it common knowledge that there is a umask setting in the ftp server? Yet in all my searches regarding my problem getting files readable on my server, this is the only place I have seen reference to this problem.)

zkriesse 09-08-2009 02:30 AM

HELP!!!!!!!!
 
Quote:

Originally Posted by crmaykish (Post 2789714)
Nevermind, I've got it figured out.

I had to set the umask in my vsftpd configuration so files that are uploaded are set to the proper permissions.

Thanks for your help.

How did you do that? I've been trying to set up my localhost to use firebird but hit a steel/concrete wall every time with the same error you had...HELP ME PLEASE!


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