LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-18-2016, 03:27 AM   #1
White-Gandalf
LQ Newbie
 
Registered: May 2016
Posts: 2

Rep: Reputation: Disabled
Question Whats the best way to handle files for www-data


Yes, sorry for the humble question. It takes a little bit more than a single line to describe the intend...

On a regular basis, it happens that i forget to change ownerschip of some files in the /var/www/ area after synchronizing something with the server and eventually doing some debugging.

Since i have to scp under the root account (i am not having ownership of the web server; the person responsible for that thing insisted having me login as root - not my responsibility nor in any way changeable, even if you would like me to do), the files and directories i have to handle mostly end up being changed to ownership of root, thus making the php scripts unable to write to certain locations - where there are a lot of.

Thus i regularly end up leaving some of the files or directories in root ownership, and thus having users complaining about non functional web applications.

Thus to my question: To migitate forgetting to change the ownership of those damned files, is there a way to automate it, so that every file, whose ownership was www-data and which becomes changed, automatically gets ownership reset to "www-data"? (Well: i eventually will get this done via a batch script, but since im still not familiar with linux (instead coming from windows), this is something i like to postpone into the future, if possible...)

Or is there a reliable way to accomplish this (respectively prevent changing ownership at all) via configuration of file system rights?

(My xp level in unix is still fairly low...)
 
Old 05-18-2016, 11:44 AM   #2
ardvark71
LQ Veteran
 
Registered: Feb 2015
Location: Oregon, USA
Distribution: Lubuntu 14.04, Windows Vista
Posts: 5,683
Blog Entries: 3

Rep: Reputation: 769Reputation: 769Reputation: 769Reputation: 769Reputation: 769Reputation: 769Reputation: 769
Hello and welcome to forum

Please watch the language, in part because folks from different age ranges use these forums.

Also, please note this forum is for introductions only. Please resubmit your question in either the "Newbie" or another appropriate forum. Thanks!

Regards...

Last edited by ardvark71; 05-18-2016 at 11:45 AM. Reason: Changed wording.
 
Old 05-18-2016, 11:58 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,457
Blog Entries: 10

Rep: Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639
Welcome to the forums. To request your thread be moved, you can click on the report button. You also can change the title of the thread to something matching your question.
 
Old 05-18-2016, 12:17 PM   #4
White-Gandalf
LQ Newbie
 
Registered: May 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
Angry

@ardvark71: Sorry, i was forced by the forum itself to post the very first question, whatever it would be, in this "LinuxQuestions.org Member Intro" Area. No way to prevent that. Wrong address (i'm in no way able to force anything on the owners of this forum)...

Aside of that: Which terms of my language do you regard as offensive? I have thoroughly reviewed the question and cannot find anything applicable to terrorist banning rules. If you have rules in place that were not covered by the usage agreement, could you please point me to the direction of their documentation?

Not a very warm welcome! Maybe i should go looking somewhere other...
 
Old 05-18-2016, 12:24 PM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,457
Blog Entries: 10

Rep: Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639
OK, please calm down.

In an effort to be helpful and proactive I have asked a moderator to move this thread to LQ Newbie, please wait as much as 1/2 day or 1 day for that to happen, they work fast, but everyone sometimes is not online all the time.

Not a huge deal, but you used a swear word and LQ rules are that profanities are not allowed in any form, regardless of how light or heavy they are.

You used "d...mned", just once that I can see, it's not so very heinous, however it is technically a profane word, just a heads up there.

There have been discussions such as how bad is bad, and the general conclusion is that any use of the slightest slang/profane word should just be noted as "inappropriate". People can get childish about it, people can get offended that a very slight/questionable word is deemed bad. Not much we can do, and if you use that word generally sparingly, nothing likely will ever come of it or happen to you except maybe Jeremy once or twice commenting to try avoid profanities. If you use much worse, in large supply, that'd be a very different case.

As far as the posting limits/etc. I was unaware that you had to first post to the intro forum.

[Perhaps you can use the report button to request a moderator to move your thread. That is how it's done in spite of the implication that "report" sounds negative.] I've already done this.

Or, you could try to visit the Newbie forum and create a new thread there.

Once again, Welcome to the forums.

Regarding your question:

Without getting fully detailed into your question, I will say that it is possible at a top level to do some things like:
Code:
sudo chown -R <new-owner> *
sudo chgrp -R <new-group> *
However you do NOT do that at the ultimate top level of "/", you would say do that in your /home/user-name directory if you've found that files are not owned by your user and in your group. The sudo gives temporary super user privileges to your signon for executing those commands and the first time you issue it you should have to enter your user password as a security measure. The -R flags will recurse into directories. The "*" is a wildcard which will do it to everything, hence the notation to not do this in a directory where it will affect root, or other user's things. And finally those commands are to change ownership and change group. If you do a long listing, "ls -l" of your files, you'll see the owner, as well as the group and other information on a file. Files you own should also be in the same group as your user.

EDIT: Note that Aardvark71 is regularly on the forums and typically very helpful to many members. I'm certain they meant no offense. Please bear in mind that people entering the forums many, many times ask very limited questions. You did not, and even acknowledged that you felt you were limited in thread access. This should not be the case moving forwards and what Aardvark71 and myself are trying to do here is give you guidance for moving forwards for some ideas how to move threads or start new threads to get effective exposure for your questions.

Last edited by rtmistler; 05-18-2016 at 12:35 PM.
 
Old 05-18-2016, 12:58 PM   #6
ardvark71
LQ Veteran
 
Registered: Feb 2015
Location: Oregon, USA
Distribution: Lubuntu 14.04, Windows Vista
Posts: 5,683
Blog Entries: 3

Rep: Reputation: 769Reputation: 769Reputation: 769Reputation: 769Reputation: 769Reputation: 769Reputation: 769
Quote:
Originally Posted by White-Gandalf View Post
Aside of that: Which terms of my language do you regard as offensive? I have thoroughly reviewed the question and cannot find anything applicable to terrorist banning rules. If you have rules in place that were not covered by the usage agreement, could you please point me to the direction of their documentation?
Hi...

I was referring to the swear word towards the end of your post that rtmistler mentioned. In terms of the rule that would cover this, I believe it's this one...

Quote:
Do not post any messages that are obscene, vulgar, sexually-orientated, hateful, threatening, hostile or insulting.
Quote:
Originally Posted by White-Gandalf View Post
Not a very warm welcome! Maybe i should go looking somewhere other...
I wasn't trying to be unfriendly, just attempting to help you understand forum rules and as rtmistler alluded to, to "get you on the right track," so to speak. I was not aware that LQ
required all new members to post in this forum first. I hadn't even heard of that. Perhaps Jeremy or one of the moderators could provide confirmation of this.

Regards...
 
Old 05-18-2016, 02:39 PM   #7
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,457
Blog Entries: 10

Rep: Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639Reputation: 1639
Quote:
Originally Posted by White-Gandalf View Post
@ardvark71: Sorry, i was forced by the forum itself to post the very first question, whatever it would be, in this "LinuxQuestions.org Member Intro" Area. No way to prevent that. Wrong address (i'm in no way able to force anything on the owners of this forum)...
I believe this to be an untrue assumption. Just create a thread in another forum.

Presently the new user in the following link has made exactly two posts, one to start their thread and one to say "thanks", the thread is not in the New Member Intro forum, but in the Newbie forum: http://www.linuxquestions.org/questi...or-4175580091/

To add to that, I'm positive I've encountered plenty of "first posts" in Newbie and Software forums.
 
  


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
[SOLVED] chown: invalid user 'www-data:www-data' thund3rstruck Linux - Server 4 03-21-2013 02:53 AM
Cannot handle TLS data - what is this? simopal6 Linux - Software 6 06-30-2008 01:09 PM
Whats up with www.gnu.org ...? tarballed General 5 03-17-2004 04:13 PM


All times are GMT -5. The time now is 06:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration