Solved

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

Posted on 2014-07-20
4
942 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now