Installing Magento on Slicehost with Ubuntu
This is an old revision of the document!
(I am not sure if this belongs in the Wiki, but it seemed like the most logical place to store it.)
I am by no means a Linux expert, but if you like Slicehost and want to get Magento working as quickly and as painlessly as possible, here are the steps I took to get it done in a rough state. I HAVE NOT TESTED THIS INSTALLATION THOROUGHLY, SO PLEASE BE AWARE IT IS BY NO MEANS COMPLETE. IN FACT, I AM WRITING THIS AS I AM DOING IT MYSELF FOR FUTURE REFERENCE.
THIS GUIDE DOES NOT COVER HOW TO CREATE A MYSQL USER ACCOUNT, MYSQL DATABASE FOR MAGENTO, MAIL SERVER, NOR SSL.
NOTE: ALTHOUGH YOU CAN RUN ALL THE FOLLOWING AS THE ROOT USER, IT IS STRONGLY ADVISED THAT YOU CREATE A NON-ROOT ACCOUNT AND RUN COMMANDS WITH SUDO.
1. Become a Slicehost customer and create an Ubuntu Dapper slice.
2. SSH into your slice using the root account and the password Slicehost generated for you.
3. UPGRADE FROM DAPPER TO EDGY TO FEISTY by following this guide exactly: http://wiki.slicehost.com/doku.php?id=upgrade_ubuntu_dapper_-_edgy_-_feisty ... this will take about 20 minutes with prompts that you will need to answer as the upgrade ensues.
4. Now that you’ve upgraded from Dapper to Edgy to Feisty, go ahead and create a LAMP Server (Linux, Apache, MySQL, PHP) by running the following command:
sudo tasksel install lamp-server
BE PATIENT… a blue installation progress screen will appear, but it won’t look like it’s making any progress (well, this is what happened to me). Wait about 5-10 minutes, and when it’s done, the screen will disappear with the installation being complete.
5. Now you need to install “mcrypt” which is used by Magento, but BEFORE YOU CAN DO THAT, you have to first set Ubuntu’s package manager (apt) to allow it to download packages from the Universe repositories. To do this, edit the sources.list file:
how to edit it with nano text editor:
sudo nano /etc/apt/sources.list
If you don’t feel comfortable editing this file with nano or a terminal based text editor, then you may want to SFTP into your account using your favorite FTP program, such as CuteFTP. Whichever method you use, you need to uncomment a few lines in the sources.list file, as well as rename everywhere you see the word “edgy” to “feisty” so that packages within these repositories are available to download. My sources.list file ended up looking like this, which I’ve cleaned up a bit for the sake of clarity:
deb http://archive.ubuntu.com/ubuntu/ feisty main restricted deb-src http://archive.ubuntu.com/ubuntu/ feisty main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://archive.ubuntu.com/ubuntu/ feisty-updates main restricted deb-src http://archive.ubuntu.com/ubuntu/ feisty-updates main restricted ## Uncomment the following two lines to add software from the 'universe' ## repository. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free license. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## universe WILL NOT receive any review or updates from the Ubuntu security ## team. deb http://us.archive.ubuntu.com/ubuntu/ feisty universe deb-src http://us.archive.ubuntu.com/ubuntu/ feisty universe ## Uncomment the following two lines to add software from the 'backports' ## repository. ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://us.archive.ubuntu.com/ubuntu/ feisty-backports main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ feisty-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu feisty-security main restricted deb-src http://security.ubuntu.com/ubuntu feisty-security main restricted
Save the file and close it.
6. Now that you have edited your sources.list, you need to update apt so that it is aware of the new repositories by running the following command:
sudo apt-get update
7. Now install mcrypt by running the following command:
sudo apt-get install php5-mcrypt
8. Now you need to enable mcrypt by editing the php.ini file:
sudo nano /etc/php5/apache2/php.ini
Add the following line to the very end of php.ini to enable mcrypt:
9. Now you will need to generate new Symlinks in /etc/apache2/mods-enabled so that Apache 2 enable the extension for URL rewriting. There is an easy way to do it in Ubuntu/Debian. Just type:
sudo a2enmod rewrite
and the corresponding symlinks get created.
In order to make Magento work correctly, this piece of configuration (taken from the installation guide http://www.magentocommerce.com/knowledge-base/entry/magento-installation-guide comment #40) needs to be put at the end of /etc/apache2/apache2.conf (this is assuming that Magento is going to be installed in /var/www/magento—if not, please edit the path accordingly):
<Directory "/var/www/magento"> AllowOverride All </Directory>
10. Now you need to restart Apache for the PHP settings and the Apache settings to take affect:
sudo /etc/init.d/apache2 restart
11. Now you need to install Magento, but before you can do that, you need to install Subversion, the source code manager that Magento was developed with. Run the following command to install Subversion:
sudo apt-get install subversion
12. Now that Subversion is installed, we can download Magento using Subversion by running the following commands:
cd /var/www sudo svn checkout http://svn.magentocommerce.com/source/branches/beta-0.6-latest
13. Rename the directory “beta-0.6-latest” to “magento”
sudo mv beta-0.6-latest magento
(as mentioned above, this guide has not covered how to create a MySQL user, MySQL database or SSL configuration—you will obviously need to do this for a production / live website… please consult guides on the internet or in books as to how to accomplish this… they will need to be done before the installation step mentioned next)
14. Now install Magento using the installation wizard. In your browser, go to:
Magento will prompt you to change the permissions on a few directories, which you need to do before continuing.
Note: the sample product images don’t seem to have been downloaded using Subversion, so if you’re able to browse the demo store and don’t see any product images, don’t worry, they don’t exist because they weren’t downloaded! You will be deleting them anyway, right?
Created Sept. 10, 2007 by Jonathan L.