My current server has Rails, Apache, Mongrel, and MySQL installed. I decided to install WordPress also which requires PHP. So I installed PHP 5.1.6, created a database, configured Apache, and got WordPress to work. My server is a 256MB VPS, so it's a low-end server by all means but up until WordPress / PHP installation, it has been running the Rails apps just fine. The one thing I noticed after installing PHP and WordPress is that my server started experiencing heavy swapping causing significant degradation in response time when I try to access the blog or my site. After restarting Apache and Mongrel, it seems to be much better now but I am concerned that the swapping situation could happen again soon.
I am an Apache and PHP noob, so forgive me if I am asking very basic questions. I am not sure I configured Apache correctly for PHP. These are the basic steps I performed:
yum –y install php php-mysql (I am on FC6)
Add the following line to httpd.conf:
AddType application/x-httpd-php .php
Add the following line to httpd.conf's virtualhost directive for Rails:
RewriteRule /blog/?(.*)$ %{DOCUMENT_ROOT}/blog/$1 [NC,QSA,L]
Do the above steps seem correct? I have also seen references to compiling Apache with mod_php but I am not sure what that does exactly. In fact, I don't know much about Apache modules, so any explanation will be helpful. Thanks in advance for any help.