Magento 2 has launched and on Magento’s official blog. Magento is the best eCommerce software and solution for online services. As we all know, beta version of Magento 2 was officially launched on 18th December. To know more about Magento 2 read release notes.
How to Install PHP Composer in CentOS/RHEL
How to Install and configure MySQL 5.6 on CentOS
Install PHP 7 on CentOS/RHEL 5/6/7
How to Upgrade PHP version 5.4 to 5.6 on CentOS/RHEL 5/6/7
How to Upgrade PHP version 5.4 to 5.5 on CentOS/RHEL 5/6/7
This tutorial will help you to install Magento 2 on Linux systems.
Step #1 Setup Requirements
This is the set of system requirements for Magento 2:
Operating systems: RHEL, Ubuntu, CentOS, Debian, etc
Apache 2.2 or 2.4 with mod_rewrite module or Nginx 1.8 or latest version.
PHP 5.4.11 or PHP 5.5 or later version. PHP 7.0 also supported.
PHP extensions: PDO/MySQL, mcrypt, mbstring, mhash, curl, simplexml, gd2, ImageMagick 6.3.7, soap, ext-intl
Mail Transfer Agent (MTA) or an SMTP server
Step #2 Install Composer
Introducing Composer mainly is a matter of simply running the installer in your project directory. The main step is to introduce Composer. Run the following command from the terminal:
# curl -sS https://getcomposer.org/installer | php
# mv composer.phar /usr/local/bin/composer
Step #3 Download Magento 2
Magento 2.0, the next generation open source digital commerce platform is now available for download! Get your access to the new code by visiting the Community Edition page for the free download. Also you can download using git.
# cd /var/www/html/magento2
# git clone https://github.com/magento/magento2.git
# git clone [email protected]:magento/magento2.git
Step #5 Change Permission for Magento 2 Directories
After downloading Magento 2 source code change the permission using following command:
# chown -R apache.apache /var/www/html/magento2
# chmod -R 755 /var/www/html/magento2
Step #6 Update Composer on Directories
After you are done with updating the file system permissions and ownership, go onto update Composer and run the installer:
# cd /var/www/html/magento2
# composer install
Step #7 Create Database
Now login to your mysql server and create a database and user for new magento 2 installation.
# mysql -u root -p
mysql> CREATE DATABASE magento2;
mysql> GRANT ALL ON magento2.* TO [email protected]'localhost' IDENTIFIED BY 'secertpassword';
mysql> FLUSH PRIVILEGES;
Step #8 Install Magento 2
Let’s begin the installation of Magento2 using web installer. Access your magento 2 directory on web browser like below.
Agree and Setup Magento
Now click on “Start Rediness Test”.
Magento will check for system requirements here. On successful completion you will see screen like below then Just click Next. Fix issues if shows on this screen and click Try again.
Enter your database details in step 4.
Enter the admin url and website url. Now click Next.
Set the prefered timezone, default currency and default language as per your requirements.
Now create an admin account for your. remember these details for admin login in future .
Click on Install Now button to begin installation and wait for its completion.
You will see a success message on this screen. Now just click on “Launch Magento Admin”.
Step #9 Schedule Magento2 Cronjobs
Finally schedule the backgound cronjobs for your magento2 installation. These cronjobs does some activities like, re-indexing, Newsletters, Update of currency rates, sending automatic emails and generating sitemaps etc.
# crontab -e
*/1 * * * * php /var/www/html/magento2/bin/magento cron:run
*/1 * * * * php /var/www/html/magento2/update/cron.php
*/1 * * * * php /var/www/html/magento2/bin/magento setup:cron:run