0

I want some help on how to setup my apache server. I would like to tell me what modules do you recommend for each case. I have read many tutorials and almost everyone has different instructions.

  1. Security: suphp or suexec. AFAIK the do the same thing.

    Also can/should i install suhosin along with them?

  2. Caching: XCache or APC.

  3. CGI: fastcgi or fpm. This one confuses me the most. I think they are doing the same job but i have read some tutorials installing them both (ex. this one)

Lastly if possible can you point me which one of the requires further configuration or do i simple enable them (a2enmod)?

Edit: The thing i am more interested is cgi. I am really confused and i would like someone to help me install what is necessary for everything to work correctly. If that makes any difference in my server i will host a couple of wordpress websites, a mail server and i am thinking also owncloud.

Christos Baziotis
  • 5,845
  • 16
  • 59
  • 80

2 Answers2

1

I wrote the article you refer to. The below is my view on your questions, unless you are setting up a shared hosting environment.

  1. Neither, if you wish to use APC. Suhosin: I believe Suhosin's support on modern versions of PHP is shakey, if it is available at all.
  2. Neither, if you wish to use SUexec or SUPHP. If you are using PHP-FPM APC is reliable and widely used, I have no experience with Xcache. APC is EOL, as PHP ships with it's own opcache starting in (I think) 5.5.*
  3. If you are going to use CGI, stay away from plain CGI, and use either FastCGI, or PHP-FPM.*

* While you can use APC etc. with FastCGI, you will use a fair amount of memory compared to the same set up with PHP-FPM, also, if you want use the APC user cache, it's generally ill-advised to use anything other than PHP-FPM or mod_php. Using APC etc with plain CGI is just a no go.

Some background:

  • PHP-FPM: PHP FastCGI Process Manager.
  • mod_fastcgi: Third party Apache module used to communicate with PHP-FPM.
  • mod_fcgi: Official Apache FastCGI implementation, the last time I checked it could not do what was needed to use PHP-FPM in Apache 2.2.

Overall, I would say avoid plain CGI, FastCGI was developed to make up for the shortcomings of CGI, and PHP-FPM was developed to make the most of FastCGI.

My 2c: If any of the sites you wish to host are in anyway mission critical/income/client related, I would say that with your current level of expertise I would recommend either going with a managed server, or at least a pre-installed and configured stack. I don't want to be a scare monger, but if as much as a day or two of down time cannot be absorbed without possibly serious repercussions, it's much better to hand off the stress to the relevant company when something goes wrong.

If you do decide you want to do it all yourself, I would say you need to gain some experience in:

  1. Putting together, and tearing apart your chosen OS on an offline server.
  2. Running a live server for a while with personal or 'play' sites.
  3. Be able to troubleshoot, fix and reconfigure most of your config from memory, under pressure.
  4. Security. Servers, and sites do get hacked.
  5. Backup, backup, backup. In the worst case you may be reduced having to restore backups from somewhere other than your server, to somewhere else, and change where your DNS points to.
Phizes
  • 201
  • 2
  • 8
0
  1. suPHP and suexec do indeed do pretty much the same thing. I use suphp here, but it's a 3rd party module. suexec is part of the Apache distribution and probably has better community support.

  2. See this link on StackExchange for a good discussion of the differences.

  3. Having used neither myself, a cursory google search turned up this link, also on StackExchange. There's a good discussion there of the differences between them but perhaps you've already seen this.

Community
  • 1
  • 1
Lindsay Haisley
  • 392
  • 3
  • 9