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 10-29-2010, 03:16 PM   #1
caffemisto
LQ Newbie
 
Registered: Jul 2009
Location: Central California
Distribution: Slackware
Posts: 17

Rep: Reputation: 0
FTP'ing to /var/www: what is the trick


Hi,

I started tinkering with a Linux server setup at home. Mainly just web serving and FTP for now. It's running apache2 and vsftpd. I signed up for a dyndns.org account so I can do web work while away from the house.

I would like to FTP into the server via Dreamweaver to upload files once done working with them. Then use a browser to http to the live page to see the outcome.

Well, I ran into a couple of issues:

1. Connection via FTP worked fine, but could not show the contents of /var/www in Dreamweaver. I did some research and sounded like a rights/permissions issue. So I made my account part of www-data group and made www-data owner of everything under /var/www. That allowed me to display the contents of /var/www in Dreamweaver, work with the files, uploade them, etc.

2. Then issue #2 came up: when I opened the browser and tried to display the page, I received a 403 Forbidden message from the server. So I changed the ownership of /var/www back to root. That allowed me to display the page in the browser, but now FTP is broken in Dreamweaver.

So I need to find "balance to the force" here. How can I configure /var/www so that it allows me to upload/update/erase/create files while still allowing a browser to display the page(s) of the site?

Please let me know if there's any other information you need me to post here.

Thanks for your help.
 
Old 10-29-2010, 03:25 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Why don't you just change the group ownership of the directory and give the group read-write access?
 
Old 10-29-2010, 04:14 PM   #3
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
don't use root ownership - ever !

Just make the web directory world readable (by apache or whoever ) then you have the result.
By setting the permissions of the web directory to 755 you have done all you need to do.
 
Old 10-29-2010, 08:59 PM   #4
caffemisto
LQ Newbie
 
Registered: Jul 2009
Location: Central California
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks for your replies.

This is what I did after reading them:

cd /var
sudo chgrp -R www-data www

ls -al www

output:
drwxrwxrwx 3 www-data www-data 4096 2010-10-28 13:46 .
drwxr-xr-x 15 root root 4096 2010-10-28 11:57 ..
-rw------- 1 www-data www-data 2415 2010-10-28 13:26
-rw------- 1 www-data www-data 518 2010-10-28 13:26
drwx------ 2 www-data www-data 4096 2010-10-28 13:26 img
-rw------- 1 www-data www-data 3998 2010-10-28 13:26 index.html

Then:

sudo chmod -R 755 www
ls -al www

output:
drwxr-xr-x 3 www-data www-data 4096 2010-10-28 13:46 .
drwxr-xr-x 15 root root 4096 2010-10-28 11:57 ..
-rwxr-xr-x 1 www-data www-data 2415 2010-10-28 13:26
-rwxr-xr-x 1 www-data www-data 518 2010-10-28 13:26
drwxr-xr-x 2 www-data www-data 4096 2010-10-28 13:26 img
-rwxr-xr-x 1 www-data www-data 3998 2010-10-28 13:26 index.html

So, based on my user account being part of the www-data group I should have read/write access to everything under 'www', but it's not happening.

I got a message from Dreamweaver that it could not put files in the server. So I tried the command line 'ftp' to rule out DW, but when I tried to create a folder it didn't work, either.

Opening a browser and surfing to the site still works, though.
 
  


Reply


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
/var/www domain name help illNino Linux - Newbie 6 11-04-2009 11:58 PM
Apache var/www bmeserver Linux - Newbie 3 08-14-2009 09:56 PM
Who should own /var/www and it's contents? morrolan Linux - Server 4 04-03-2007 02:55 PM
VSFTPD /var/www mmethe Linux - Software 2 05-10-2005 04:37 AM
thanks boss....... now i don't have a /var/www joesbox General 4 11-08-2003 01:38 AM

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

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