MediaTemple Magento Installation Guide - Dedicated-Virtual Server

Last modified by Mike Plant on Mon, July 19, 2010 17:48
Source|Old Revisions  

Important Note:

Media Temple’s DV servers now support PHP5, and this article is now somewhat outdated, with the exception being the SSH instructions for downloading and untarring Magento to your server.


This article is a quick step-by-step tutorial on installing Magento on Media Temple (mt) Dedicated-Virtual Server (dv) account. If you have a Grid Service (gs) account you’d read our How to install Magento on Media Temple (mt) Grid-Service (gs) tutorial.

If your (DV) server has Plesk installed, you must disable “CGI support” in the domain setup section of Plesk or you will receive a 404 error.

Download Magento

First we will get the latest bundle using wget, please be sure you substitute the version number of the current version as it changes.

tar -zxvf magento-

Now you will have a magento directory. If you want to keep Magento as a sub-directory for your site, you can rename this directory:

mv magento/ shop/

I have now renamed the folder shop. If you instead would like to have Magento run your entire web site or have the store in your root directory. Simply alter the command above to:

mv magento/* magento/.htaccess ./

This moves all of the magento files into your current working directory(./), including the all important .htaccess file.

Now feel free to remove the magento directory.

rm -f magento

Install PHP5 CGI binary

Continue if using PHP4

Media Temple does now offers PHP 5.2.5 on their (dv) servers. If you have not upgraded your PHP then you will have to install PHP5 as a CGI binary and configure the web server to use it instead of the default PHP4.

It is possible to compile a PHP5 binary yourself, but for the purposes of this solution, we’ve provided one for you. You can download it here:

Note: you will need root access on your DV account to accomplish this part of the installation. To enable root access, you’ll need to open a support ticket in your account center, per this MT Knowledge Base article:

cd /var/www/
chmod 755 cgi-bin
cd cgi-bin
chmod 755 php5-cgi

After that you should get the following:

ll /var/www | grep cgi-bin
drwxr-xr-x  3 root      root 4096 Oct 26 12:25 cgi-bin
ll /var/www/cgi-bin/ | grep php5
-rwxr-xr-x  1 root root 18440550 Aug 31 11:15 php5-cgi

Modify the Magento .htaccess file

By default, the web server will want to run the Magento application using PHP4, which will not work. In order to point it to the new PHP5 CGI binary, you must modify the .htaccess file in the Magento top-level directory to look like this:

<IfModule mod_php5.c>
    php_flag magic_quotes_gpc off
    php_flag short_open_tag on

Action php5-cgi /cgi-bin/php5-cgi
AddHandler php5-cgi .php

DirectoryIndex index.php

RewriteEngine on

#RewriteBase /

RewriteCond %{REQUEST_URI} !^/media/
RewriteCond %{REQUEST_URI} !^/skin/
RewriteCond %{REQUEST_URI} !^/js/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule .* index.php

Set necessary permissions

Set up necessary permissions on files and folders. Ensure that the file magento/var/.htaccess, the directories magento/app/etc, magento/var, and all the directories under magento/media are writable by the web server

cd magento
chmod o+w var var/.htaccess app/etc
chmod -R o+w media

Create a MySQL database and user

Go to your database management interface, create a database, a MySQL user, and password that Magento will use.

Take note of the settings (including database hostname) - you will need that information while installing Magento.

Run the installation wizard

Use your web browser to surf to any Magento page (for example /install or anything) and you will be forwarded to the installation wizard.

Review the license and confirm that you agree on the first step.

Specify database connection and URLs

Enter the database connection data into the fields, check whether installation wizard correctly determined your web-host name and path.

Create an administrator account

Enjoy using Magento!