Thursday, June 8, 2017

How to install Magento 2.1 on Lubuntu 16.04

How to install Magento 2.1 on Lubuntu 16.04

Magento is one of the most popular e-commerce platforms in the entire universe, with magento you can create online shop that can handles thousand of request every day. In this article i will show you how to install magento 2.1 on lubuntu 16.04.

Installing magento is not easy as installing let's say wordpress cms, there are some extra step in order to properly install magento. I guess this tutorial is for more advanced users, but if you follow exactly as i said in this tutorial then you should have no problem.

Just let you know for this tutorial i'm going to install magento 2.1 CE (community edition) on lubuntu 16.04, with apache 2 web server, php 7.0 and mysql 5.7, here's magento 2.1 system requirements:

Magento 2.1 system requirements
  • php 7.0
  • MySql
  • Web server (apache 2 or nginx)
NOTE: for this tutorial i'm not creating any apache virtual host and local domain, so the magento will be available through url http://localhost/magento/.

Step by step how to install Magento CE 2.1 on Lubuntu 16.04
  • make sure you have apache web server installed and mod rewrite is enable
  • make sure you have php and mysql installed
  • install some packages needed for magento
  • sudo apt-get install php7.0-common php7.0-gd php7.0-mcrypt php7.0-curl php7.0-intl php7.0-xsl php7.0-mbstring php7.0-zip php7.0-iconv
  • download Magento CE 2.1 package from google drive or magento official site
  • create new folder named 'magento' on /var/www/html/
  • sudo mkdir /var/www/html/magento
  • extract the Magento CE 2.1 package into /var/www/html/magento/
  • cd ~/Downloads
    sudo tar -jxvf Magento-CE-2.1.6-2017-03-29-01-43-36.tar.bz2 -C /var/www/html/magento
  • create new user named 'magento'
  • sudo useradd magento
  • add user 'magento' to apache web server user group (www-data)
  • sudo usermod -g www-data magento
  • go to magento directory /var/www/html/magento
  • cd /var/www/html/magento
  • run this command to setup permission for user 'magento', (NOTE: the first and second command may takes a while to finish).
  • sudo find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
    sudo find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
    sudo chown -R magento:www-data .
    sudo chmod u+x bin/magento
  • open apache configuration file
  • sudo leafpad /etc/apache2/apache2.conf
  • add the following code
  •  <Directory /var/www/html>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                allow from all
  • save and exit
  • restart apache web server
  • sudo service apache2 restart
  • open http://localhost/magento/ to start the magento web installation setup
  • finish the magento web installation setup
During the web installation setup, you need to specify database name, database user and password, you will also get the magento admin login url, just make sure you remember the admin login url.

No comments:

Post a Comment