LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Tags used in this thread
Popular LQ Tags , , , , ,

Reply
 
Thread Tools
Old 06-14-2007, 02:49 PM   #1
crmaykish
LQ Newbie
 
Registered: Dec 2005
Posts: 3
Thanked: 0
Setting file permissions in Apache on Debian Etch


[Log in to get rid of this advertisement]
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.
crmaykish is offline  
Tag This Post , , , , ,
Reply With Quote
Old 06-15-2007, 04:58 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,042
Thanked: 14
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
j-ray is offline     Reply With Quote
Old 06-16-2007, 02:30 PM   #3
crmaykish
LQ Newbie
 
Registered: Dec 2005
Posts: 3
Thanked: 0

Original Poster
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 is offline     Reply With Quote
Old 06-16-2007, 02:34 PM   #4
crmaykish
LQ Newbie
 
Registered: Dec 2005
Posts: 3
Thanked: 0

Original Poster
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.
crmaykish is offline     Reply With Quote
Old 07-24-2008, 11:47 AM   #5
oldog
LQ Newbie
 
Registered: Jul 2008
Posts: 6
Thanked: 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.)
oldog is offline     Reply With Quote
Old 09-08-2009, 02:30 AM   #6
ZachK18
LQ Newbie
 
Registered: Sep 2009
Location: I live where I'm at...
Distribution: Ubuntu 9.04 Jaunty
Posts: 5
Thanked: 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!
linuxubuntu ZachK18 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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


All times are GMT -5. The time now is 06:39 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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration