How to install Magento in Ubuntu ?

Now it’s turn to install another eCommerceMagento‘ which is feature-rich eCommerce platform built on open-source technology. Magento is available in two editions: Community and Enterprise.

Installing and Configuring Apache

$ sudo apt-get install apache2

You may see following message during installation:

apache2: Could not reliably determine the server’s fully qualified domain name, using for ServerName

To fix that problem, you need to edit the httpd.conf file. Open the terminal and type

$ sudo gedit /etc/apache2/httpd.conf

By default httpd.conf file will be blank. Now, simply add the following line to the file.

ServerName localhost

Save the file and exit from gEdit.

Finally restart the server.
$ sudo /etc/init.d/apache2 restart

  • Restarting web server apache2
    …. waiting             [ OK ]

sudo a2enmod rewrite

Installing PHP

sudo apt-get install php5 php5-curl php5-gd php5-mcrypt php5-mysql

Installing MySQL

sudo apt-get install mysql-server

To know more system requirements click on following link :

Now create directory for magento

mkdir /home/magento
chgrp www-data /home/magento
mkdir -p /home/magento/{public,log}

Configuring Apache Virtual Host

Now we are going to create simple virtual host configuration file that will help Apache to display the data of directory /home/ubuntu/magento for any HTTP request to

Create “” file in this location “/etc/apache2/sites-available/” with following content.

<VirtualHost *:80>


DocumentRoot /home/ubuntu/magento/public

LogLevel warn
ErrorLog /home/ubuntu/magento/log/error.log
CustomLog /home/ubuntu/magento/log/access.log combined


Use a2ensite command and restart Apache to load the new configuration file.

sudo a2ensite
sudo service apache2 restart

To ensure that the domain resolves locally to the computer require entries to /etc/hosts file.

# For magento

Now hit in your browser to check working status after completion of above entries.

Now we will execute installation steps of main topic.

Type following command on prompt. It will ask for root user password.

mysql -u root -p

Now lets create database for Magento.

INSERT INTO mysql.user (User,Host,Password) VALUES(‘magento’,’localhost’,PASSWORD(‘magento’));
GRANT ALL PRIVILEGES ON magento.* TO magento@localhost;

Now download latest stable Magento from
and put zip file into /home/ubuntu/magento/public

If error: ERROR 1133 (42000): Can’t find any matching row in the user table

For testing Magento, you can download it from

mv magento-sample-data-* media/
mv magento-sample-data- sample_data.sql

Now we have to insert sample data into database that we earlier created for Magento.

mysql -u magento -p
USE magento;
SOURCE sample_data.sql;

Now everything is setup so open your browser and type and follow installation steps. You will find following screen.

Here is your Magento is working.


Leave a Reply

Your email address will not be published.

Subscribe to Blog via Email

Join 634 other subscribers

Facebook Pagelike Widget
  • DuplicateMySuccess
  • homeworkouthabit
  • webinarstarterblueprint
  • Vishvesh Suthar
  • satyamslg34gmailcom
  • Jozsef Torsan
  • devangpipaliya
  • Sir. George Githunguri
  • turkce
  • Randy
  • Movies Route
  • Rowena Schweinsberg
  • Nisarg shukla
  • magePoint
  • turkce
  • CBD gummies for pain
  • kusbas
  • buy CBD
  • primeworks
  • admin
  • brian2010
  • turkce
  • Charles A. Kush III
  • turkce
  • vteamitdevelopers
  • sergo75
  • erotik
  • turkce
  • erotik
  • CrypTee
  • Thr Viral Blog
  • pharmacies shipping to usa
  • erotik
  • erotik
  • escort bayan
  • Acespritech Solutions Pvt. Ltd.
  • turkce
  • Bobby Carsan
  • Myownbosszone
  • arasty
  • pityfox
  • paynet11
  • Nanoarch Software Solutions
  • corporateinvestigatordelhi
  • turkce
  • BlookUp
  • SMSTS Essex
  • Mr. Gadget Heisenberg
  • lilhedr
  • New Affiliate News
Mobile Application