I think it’s really cool that with Media Temple (dv) you have your own defined amount of ram. This means you can fully utilize that memory to the max! The first thing I did when I got my account was installed APC Cache.
What is APC Cache? Well it is an opcode cache. The gist of it is this.. It stores your PHP scripts in the server’s memory already compiled. This means the next time someone hits that page, it only has to execute. It doesn’t need to load all the files up which saves on disk speed and it doesn’t need to compile everything which saves on CPU usage. It can really make things fast.
1. Setup Root Access
Goto the “Root Access & Developer Tools” page inside the Media Temple AccountCenter. You’ll need to login to the server with root access to edit the proper files. Make sure your password is *ultra secure*.
2. SSH Into the Server and Install APC
Download Putty if you don’t have an SSH program. Once logged in type the following commands:
- cd /usr/local/src
- wget http://pecl.php.net/get/APC-3.0.19.tgz
- gunzip -c APC-3.0.19.tgz | tar xf -
- cd APC-3.0.19
- ./configure –enable-apc –enable-apc-mmap –with-apxs2=/usr/sbin/apxs –with-php-config=/usr/bin/php-config
- make install
Note that each bullet is a one line command. That really long one you’ll have to ensure is all on one line.
3. Edit php.ini to tell PHP to use APC
- vi +/extension_dir /etc/php.ini
- press i
- press enter to start a new line
- type extension = “apc.so”
- press esc and then type :wq to exit and save (if you mess up type :q! to quit without saving)
- service httpd stop
- service httpd start
That should do it! It’s pretty simple indeed, but the effect is huge. If you are using WHM/Cpanel I recommend the instructions here.