Solved

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

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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Suggested Solutions

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…
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.
Suggested Courses

738 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