LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-25-2017, 07:44 PM   #1
oxnume
LQ Newbie
 
Registered: Jan 2017
Posts: 1

Rep: Reputation: Disabled
Permission configuration for a Centos-based web server


I am running an apache server and I can't seem to figure out how best to set up permissions for my web files. Basically I would like to have my dropbox client sync my entire web directory, also I would like postfix to be able to have emails delivered as files to a folder inside my web directory so that I can access them through PHP. Security is not a top priority at the moment compared to easy of access.

This is how things are set up right now (please don't laugh at me for how messy it is):
~/Dropbox/ is my dropbox main folder
~/Dropbox/www contains all my web files

/var/www/html symbolic link -> ~/Dropbox/www
/var/www/html is my document root for apache

~/Dropbox/www/email/new symbolic link -> /home/user/Mailbox/new
/home/user/Mailbox/new is my catchall mailbox for postfix

My problem right now is that I can't seem to set up permissions so that all the different elements have access to the files. I can't seem to grant access to everything even after I chmod everything as 777. Please help with permissions and also if you have a suggestion for a better organization. Thank you!

Last edited by oxnume; 01-25-2017 at 07:47 PM.
 
Old 01-26-2017, 12:11 PM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Undo the link to Dropbox. You can use rsync under cron or something like that to publish the files into Dropbox if you decide you still want to mirror them there. But keep the local files as the original. As for those you want to put on the web, consider these:

https://www.linuxquestions.org/quest...e-users-37043/

However, if you are the only user then simply using chown to take ownership of the directories and files.

Code:
find /var/www/html -type d -exec chmod u=rwx,g=rx,o=rx "{}" \;
find /var/www/html -type f -exec chmod u=rw,g=r,o=r "{}" \;
chown -R oxnume:oxnume /var/www/html/
 
Old 01-26-2017, 12:57 PM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
I don't think you can (or the system won't allow) a Dropbox client to backup the Dropbox directory on the server.
It's cyclically redundant.
 
Old 01-26-2017, 10:13 PM   #4
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
Another issue is that the dropbox directory will have SELinux permissions that will prevent apache accessing them. That should be addressed aswell as I believe there was a boolean that preventsapache using home directories. That would have to be changed as well. So the selinux boolean and the actual file context aretwo immediate issues I see.
 
Old 01-27-2017, 06:37 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by ericson007 View Post
SELinux
Well, there is that.
And the pig likes it?
 
Old 01-27-2017, 09:17 PM   #6
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
That is Shaw if I remember correctly. Have not heard it in ages!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Web server configuration and issue (CentOS, Apache, PHP, MySQL) albie17 Linux - Newbie 2 01-08-2011 05:11 AM
How to make a web-based interface for user configuration program? hong2010 Linux - Software 8 04-09-2010 12:59 AM
Configuration of web based application in linux mobassir Linux - Networking 4 04-23-2009 02:25 AM
web file viewer for apache based web server? zerobane Linux - Server 8 03-11-2009 05:43 AM
any web based configuration for IPtables? ah_man04 Linux - Networking 1 04-16-2005 03:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration