Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am running my own dedicated server with centOS 5 and WHM/cPanel. I would like to configure my server to meet my needs but I need a little help. It will only be my own websites being run on this server. I'm still a little green when it comes to server administration so please forgive my ignorance.

What I Would Like to Have:

  • I need some public directories to be writable (for user image uploads and things like that) but I don't want those directories to have 777 permissions.
  • I need individual accounts to have the ability to set custom php settings for their own account without affecting other accounts, whether through a php.ini file or through .htaccess or any other method.
  • I would like things to run as fast as possible, whether that means using a php optimizer or cacher, such as eaccelerator or xcache or anything else.
  • I need things to be as secure as possible.

Here Are My Questions

  • What should I use for my php handler? DSO? CGI? fastCGI? suPHP? Other?
  • Should I be using suEXEC? What are the benefits or downfalls of this?
  • What php optimizer/cacher is best to use?
  • Are there any other security tips I need to know about all of this?

I'd appreciate any advice or direction that can be offered.

Thanks!

share|improve this question
add comment

1 Answer

You should choose between performance and easy configuration, which provided by DSO and improved virtual host isolation which provided by FastCGI

In my mind, if you plan to host only own sites you should mod_php(DSO) Pros:

  • Best performance and easy configuration
  • You can use any cacher/optimizer
  • Almost all php settings can be configured per site via php_admin_value in webserver config or htaccess

Contras:

  • All of your php scripts will under apache user - you should carefully set up open_basedir and other php security directives.
  • You cannot specify php extension set per site
share|improve this answer
    
open_basedir has a side effect of disabling the realpath_cache which makes file operations (include,require) very slow. Its also not fool-proof, in that any exec, ~ or preg_replace(/e) can be used to execute an equivalent command as the php user. –  txyoji Nov 22 '13 at 23:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.