LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-17-2012, 05:32 AM   #1
newbie67
LQ Newbie
 
Registered: Mar 2012
Posts: 6

Rep: Reputation: Disabled
How to update a website from another machine


Hi,

I am new to Ubuntu/Apache. Recently I created a web-site, where I placed the files in the directory /var/www/Mysite. I set the owner of all files under /var/www/Mysite as www-data since Apache seemed to use this as the default user. The site is working properly.

However, now I want to update the site periodically by uploading files here from a Windows machine using some sftp client like Filezilla. However, if I connect as an ordinary user, I am not allowed to update the files in /var/www/Mysite, due to permission problem, which is expected. But I cannot also login as www-data, as I do not know its password. I reckon this should be a common enough problem. What is the standard solution?

Should I set a new password to www-data and use that to login through Filezilla? Will Apache work properly then?

Thanks in advance,
 
Old 03-17-2012, 05:59 AM   #2
Celyr
Member
 
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 321

Rep: Reputation: 81
It will, however this is not the standard way,
Just set the files ownership to your real user and give to others the permission to read.

Last edited by Celyr; 03-17-2012 at 06:01 AM.
 
Old 03-18-2012, 07:51 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Actually, I wouldn't change the ownerships; just add yourself to www-data group
 
Old 03-18-2012, 11:49 PM   #4
newbie67
LQ Newbie
 
Registered: Mar 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hello Celyr,
I tried out your suggestion of changing the ownership to a real user (say "newbie") and it worked fine. Thanks. The web application creates some log files. I had to give permission to www-data to write these directories and files.

Hello Chris,
Thanks for your suggestion too. However, I think this will not suit me fully. Almost all the files in my web site are group write-protected (permission 755) by default and I would like to retain it that way. Hence, even if I add the user newbie to www-data group, I won't be able to oevrwrite the files from a sftp client logging in as newbie.

Thanks to both of you,
 
Old 03-20-2012, 05:31 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
you may try using rsync daemon also
 
  


Reply



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
How to block a virtual machine from connecting with a website, from outside the VM jiml8 Linux - General 5 03-24-2010 06:13 PM
cannot update machine using yum updates of another machine abhijitghube Linux - Newbie 5 11-29-2008 11:43 AM
Moving website from one machine to another praisehim Linux - Newbie 2 11-11-2007 01:17 PM
Convert Linux Machine To Website Viewer todd3834 Linux - Newbie 1 09-21-2006 12:54 PM
restricting website access from local machine Stridier Linux - Networking 9 01-30-2006 04:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:44 PM.

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