Solved

centos command: get file owner and group owner info of web server?

Posted on 2014-07-20
4
967 Views
Last Modified: 2014-07-24
Hi,

I have to change the the ownership of a directory and its subs to the Web server but how do I know what is Web server owner?

The info is listed in the TCPDF PHP class:
http://www.tcpdf.org/installation.php

It states:
When you have finished uploading the files and folders, change the files owner to the Web server user (typically "www-data" or "apache"). On POSIX based systems (like Unix, Linux, etc), change to the TCPDF directory and enter the following system command (substitute the user name appropriate for your system): chown -R apache.

But I'm not if it's www-data or apache or some other name.

Thanks and Father bless<><
Victor =)
0
Comment
Question by:Victor Kimura
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 35

Accepted Solution

by:
Seth Simmons earned 167 total points
ID: 40207606
a couple things...if apache is currently running, you can do ps aux | grep httpd and on the left side it will show the user account

the other way is to look at the httpd.conf file and find the user it's configured for
grep User httpd.conf
0
 
LVL 12

Assisted Solution

by:Kent W
Kent W earned 167 total points
ID: 40207696
In centos he default web user is apache.  There is also an apache group.
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 166 total points
ID: 40208196
You could cd to the parent directory and run

ls -l | grep dirname

Before you run the chown command:

- You need to be root
- Make sure that the username apache exists in /etc/passwd file

grep apache /etc/passwd
0
 

Author Closing Comment

by:Victor Kimura
ID: 40217744
Thank you, fellas! =)
0

Featured Post

Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question