LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-06-2010, 01:00 PM   #1
NModern
LQ Newbie
 
Registered: Feb 2010
Posts: 3

Rep: Reputation: 0
Unhappy Have problem with security


i have installed CentOS on my computer.

And i have installed webmin, virtualmin to control "Virtual Servers" (sites).


Apache runs under user apache

But i can read any folder and file with php from any site.

how i can solve this problem??
 
Old 02-06-2010, 08:39 PM   #2
geek745
Member
 
Registered: Jul 2004
Location: Alton, IL
Distribution: Linux Mint; Slackware; Ubuntu; Slax
Posts: 172
Blog Entries: 2

Rep: Reputation: 34
This is due to the permissions that the process running php has. You'll need new PHP configurations for each site (you are allowed to use php.ini over again in any web root to override global settings, as long as you enable this override). Here, you can change each php process to run as a user that has exclusive access to those files (x00).

See the PHP docs at http://docs.php.net/docs, specifically, http://docs.php.net/manual/en/configuration.php

Note that some of this configuration is only possible if using PHP as CGI, rather than an apache module.
 
Old 02-07-2010, 03:31 AM   #3
NModern
LQ Newbie
 
Registered: Feb 2010
Posts: 3

Original Poster
Rep: Reputation: 0
can you describe how to configure this with php.ini?
 
Old 02-19-2010, 02:30 AM   #4
geek745
Member
 
Registered: Jul 2004
Location: Alton, IL
Distribution: Linux Mint; Slackware; Ubuntu; Slax
Posts: 172
Blog Entries: 2

Rep: Reputation: 34
Sorry I was slow getting back to you. I did some more looking and it seems that, while you can get a custom php.ini in each directory, that does not help as far as locking down the php upload scope of access to the filesystem.

You would have to spawn a new apache process for each virtual host, using a different operating system user (different config file) for each one, and set the umask to 700 so that the files created cannot be readable by anyone other than the owner and root. Then again, perhaps the virtual hosts should be processed by the same apache process (to listen on the same port 80), which would mean that you need to enable overrides in .htaccess for each virtual host and therein change the running user, which would secure the php rights...

Also, I am not familiar with webmin/virtualmin, so I do not know how easy this configuration would be to implement and manage...
 
Old 02-27-2010, 08:57 AM   #5
NModern
LQ Newbie
 
Registered: Feb 2010
Posts: 3

Original Poster
Rep: Reputation: 0
ok thank you very much. I will keep it in mind. and search for the step by step solution.
 
  


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
Problem with security shafey Linux - Security 1 08-18-2009 02:07 AM
security problem ayush1440 Linux - Security 1 02-21-2008 11:54 AM
I have a security problem gubak Linux - Security 4 03-04-2005 08:06 AM
Security Problem.. Loghan Linux - Software 1 08-25-2003 08:56 AM

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

All times are GMT -5. The time now is 03:58 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