Hosting Talk | Web Hosting talk India

Web Hosting   Add Host and Hosting News 

 

Go Back   Hosting Talk | Web Hosting talk India > Web Hosting Main Forums > Hosting Security and Technology > Hosting Security and Technology Tutorials

Ads

Reply
 
Thread Tools Display Modes
  #1  
Old 06-22-2012, 11:59 AM
bullten bullten is offline
Junior Member
 
Join Date: Jun 2012
Posts: 12
Default Force User to Use Single php.ini

If you have a Dedicated Server or VPS and use it to sell shared hosting then this article is for you. Today I am going to explain how you can force your users to use same php.ini under suPHP by disallowing .htaccess override. Limiting php.ini use will add security to your server and will disallow users to use custom php.ini file by overriding default php settings set by server administrator (root).

How to make it work:

Its very simple to enable this function in server using suPHP. Just by enabling phprc_paths in /opt/suphp/etc/suphp.conf will do the work for you. See the steps below:

Code:
vi /opt/suphp/etc/suphp.conf
Find the code below and press I to insert text.

Quote:
[phprc_paths]
;Uncommenting these will force all requests to that handler to use the php.ini
;in the specified directory regardless of suPHP_ConfigPath settings.
;application/x-httpd-php=/usr/local/lib/
;application/x-httpd-php4=/usr/local/php4/lib/
;application/x-httpd-php5=/usr/local/lib/
Remove ( ; ) from the last three lines ie.

Quote:
application/x-httpd-php=/usr/local/lib/
application/x-httpd-php4=/usr/local/php4/lib/
application/x-httpd-php5=/usr/local/lib/
Now press ESCAPE button and enter :wq to save the file.

Restart Apache

Code:
/sbin/service httpd restart
Now Users wont be able to override your default php.ini file.

Article Source: Harden php.ini Security
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump


All times are GMT. The time now is 02:59 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2018, SEO by YABBSEO 1.0 2012, YABSoft.com.