Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

(Apologies if there's a more appropriate StackExchange forum for this. If that's the case, please let me know.)

I'm looking to set up a LAMP server (Ubuntu 12.04) for a website that will probably get very little traffic at the beginning (so I'll start with a VPS with 512MB RAM), but will hopefully receive a lot more traffic in the future (at which point I'll upgrade to more RAM and change some of the config options). I'm going to use Drupal 7 to actually serve the content.

I just finished reading an exhaustive book on Linux, but I'm still confused about a lot of the nitty-gritty, so I had some questions...

(I know there are a lot of questions here, but I didn't want to flood you guys with multiple posts at once. Feel free to only answer a question or two -- that'd still be a big help.)

Allocating Memory: I was thinking of using this kind of setup: mpm_worker, php5-fpm, APC, fastcgi, memcache, XHProf. Do the memory limits below make sense for a VPS with 512MB RAM? (I'm mostly wondering about the settings in bold).

  • mpm_worker: Within the mpm_worker_module IfModule directive in httpd.conf: StartServers 3, ThreadsPerChild 25, ThreadLimit 75, MinSpareThreads 25, MaxSpareThreads 75, MaxRequestsPerChild 10000, MaxClients 150
  • php5-fpm: In /etc/php5/fpm/php.ini: memory_limit = 96M, max_execution_time = 120, max_input_time = 300, post_max_size = 10M, upload_max_filesize = 10M
  • php5-fpm: In /etc/php5/fpm/pool.d/(pool name, such as www.conf): pm = dynamic, pm.max_children = 2 (I'd icrease this number when i upgrade the server RAM), pm.start_servers = 2, pm.min_spare_servers = 1, pm.max_spare_servers = 2
  • APC: In /etc/php5/conf.d/apc.ini: apc.shm_size = 64M, apc.shm_segments=2
  • Suhosin (for mysql security): In /etc/php5/conf.d/suhosin.ini: suhosin.memory_limit=64M

Scalabilty:

  • How important is it to create separate partititions for root, boot, home, tmp, usr, and var? Although I don't expect a lot of traffic for the first few months, I want to make sure I'm being smart about building a scalable foundation for my site.
  • Do I want to build a customized kernel, and/or are there are specific modules I simply want to load into my current module.
  • Is it important to ensure the server has a static IP address (in /etc/network/interfaces) instead of using DHCP?
  • Is there anything else that's pretty much a best practice that I should add to my setup, such as Varnish?

Security:

  • Are any of these security utilities super useful (Note: I currently am planning on using xyz): TripWire, nessus, Secunia, Treachery, netcat, Update Notifier, webalizer, awstats
  • What shell should apache2 use (or would it be just the www-data user’s shell)? What about FTP (or sftp) for drupal?
  • Which chroot jails should I set up? (Seems like apache and vsftpd don’t need chroot jails).

Commands/Syntax:

  • For whatever modules I’m going to use with apache (e.g., APC), would I need to put a LoadModule directive in httpd.conf to load it and then use a2enmod to enable it?
  • Should I no longer use “/etc/init.d/apache2 restart”, etc. (should I instead use “initctl start jobname” or “service start jobname”)?
share|improve this question
    
Please split these up, don't worry about flooding, the site is designed for one post per question, as it stands your question is too large/epic to be answered. –  Jorge Castro Oct 10 '12 at 23:34
    
damn.. it really is epic –  Nikhil May 19 '13 at 23:47
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.