?
Solved

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

Posted on 2014-07-20
4
Medium Priority
?
979 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 668 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 668 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 664 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

Limited time offer using promo code EXPERTS30

Designed with a wealth of functionality and convenience, ATEN's new Thunderbolt™ 2 Sharing Switch takes your Thunderbolt setup to the next level. Now through September 15, 2017, Experts Exchange members get 30% off the US7220 on the ATEN USA eShop using promo code EXPERTS30.

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…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month13 days, 4 hours left to enroll

777 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