Solved

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

Posted on 2014-07-20
4
956 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
4 Comments
 
LVL 34

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

786 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