LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 06-14-2007, 01:49 PM   #1
crmaykish
LQ Newbie
 
Registered: Dec 2005
Posts: 3

Rep: Reputation: 0
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.
 
Old 06-15-2007, 03:58 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
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
 
Old 06-16-2007, 01:30 PM   #3
crmaykish
LQ Newbie
 
Registered: Dec 2005
Posts: 3

Original Poster
Rep: Reputation: 0
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)?
 
Old 06-16-2007, 01:34 PM   #4
crmaykish
LQ Newbie
 
Registered: Dec 2005
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
Old 07-24-2008, 10:47 AM   #5
oldog
LQ Newbie
 
Registered: Jul 2008
Posts: 6

Rep: Reputation: 0
Quote:
Originally Posted by crmaykish View Post
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.)
 
Old 09-08-2009, 01:30 AM   #6
zkriesse
LQ Newbie
 
Registered: Sep 2009
Posts: 11

Rep: Reputation: 0
Exclamation HELP!!!!!!!!

Quote:
Originally Posted by crmaykish View Post
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!
 
  


Reply

Tags
apache, debian, error, etch, permission, server



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
Compiling Apache 2 on Debian Etch grapnell Linux - Software 17 08-11-2007 11:49 AM
null permissions on .ssh dir of a debian etch gabsik Linux - General 2 05-31-2007 07:23 AM
Problem setting up modem in KPPP in Debian Etch Cage47 Linux - Software 1 04-17-2007 02:12 PM
Setting file permissions so Apache can serve my files thomasfingram Linux - Security 6 12-06-2005 05:54 PM
Permissions in Debian - sudo works, su doesn't (etch/64Studio) greennick Linux - Software 0 09-12-2005 03:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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