How to install Magento in Linux
To install Magento in Linux
Magento is an open source e-Commerce Merchant software that is used to build an on-line show case. Magento is used by 1% in all websites world-wide on internet. Installation of Magento is explained in this article.
Features
- Free and open-sourced.
- Ability to install & change default website theme, without need to change the content.
- 3 Available editions to use which are Community Edition &ndash Professional Edition &ndash Enterprise Edition.
For installing apache, PHP and My SQL
Before installing Magento, install the dependency packages.
root@linuxhelp:~# apt-get install php5 libapache2-mod-php5 php5-mcrypt php5-common php5-cli php5-ldap php5-gd php5-mysql php5-tidy php5-xmlrpc php5-curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libavahi-compat-libdnssd1 libjpeg62 libjs-jquery libruby2.1 libyaml-0-2
ruby2.1 rubygems-integration
Use ' apt-get autoremove' to remove them.
The following extra packages will be installed:
apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1
libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0 libmcrypt4
libmysqlclient18 libtidy-0.99-0 mysql-common php5-json php5-readline
Suggested packages:
.
.
.
Creating config file /etc/php5/apache2/php.ini with new version
Module mpm\_event disabled.
Enabling module mpm\_prefork.
apache2\_switch\_mpm Switch to prefork
apache2\_invoke: Enable module php5
Setting up php5 (5.6.11+dfsg-1ubuntu3.4) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (225-1ubuntu9) ...
Then install apache2 and mysql.
root@linuxhelp:~# apt-get install apache2 mysql-server mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
apache2 is already the newest version.
apache2 set to manually installed.
The following packages were automatically installed and are no longer required:
libavahi-compat-libdnssd1 libjpeg62 libjs-jquery libruby2.1 libyaml-0-2
ruby2.1 rubygems-integration
Use ' apt-get autoremove' to remove them.
The following extra packages will be installed:
libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl
libterm-readkey-perl mysql-client-5.6 mysql-client-core-5.6 mysql-server-5.6
mysql-server-core-5.6
.
.
.
![package configuration](https://assets.linuxhelp.com/scr/a55b4396eb8367fd8c75e26eafd3c0eb.png)
![Credential](https://assets.linuxhelp.com/scr/74df7c0ea3efaea505c0b522dbe476a0.png)
.
.
.
2016-06-27 18:00:38 0 \[Note\] /usr/sbin/mysqld (mysqld 5.6.30-0ubuntu0.15.10.1) starting as process 16872 ...
Setting up libhtml-template-perl (2.95-2) ...
Setting up mysql-client (5.6.30-0ubuntu0.15.10.1) ...
Setting up mysql-server (5.6.30-0ubuntu0.15.10.1) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (225-1ubuntu9) ...
Open the php.ini file, to increase the memory limit.
root@linuxhelp:~# nano /etc/php5/apache2/php.ini
memory\_limit = 512M
Create a new MySQL database for Magento installation.
root@linuxhelp:~# mysql -u root &ndash p
Enter password:
Welcome to the MySQL monitor. Commands end with or g.
Your MySQL connection id is 2
Server version: 5.6.30-0ubuntu0.15.10.1 (Ubuntu)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ' help ' or ' h' for help. Type ' c' to clear the current input statement.
mysql> create database magento
Query OK, 1 row affected (0.02 sec)
mysql> create user magento@localhost identified by ' linuxc'
Query OK, 0 rows affected (0.47 sec)
mysql> grant all on magento.\* to magento@localhost
Query OK, 0 rows affected (0.04 sec)
mysql> flush privileges
Query OK, 0 rows affected (0.06 sec)
mysql> exit
Bye
To Configure apache for magento.
root@linuxhelp:~# nano /etc/apache2/sites-available/000-default.conf
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Now enable " mod_rewrite" module and restart Apache service.
root@linuxhelp:~# a2enmod rewrite
root@linuxhelp:~# service apache2 restart
To Download the magento
Use the following link to download the latest version from the official website,
https://www.magentocommerce.com/download
Extract the downloaded magento file to the location /var/www/html.
root@linuxhelp:/home/user1/Downloads# ls
Magento-CE-2.1.0-2016-06-23-02-28-19.tar.gz
root@linuxhelp:/home/user1/Downloads# tar xvzf Magento-CE-2.1.0-2016-06-23-02-28-19.tar.gz -C /var/www/html/
app/
app/design/
app/design/adminhtml/
app/design/adminhtml/Magento/
app/design/frontend/
app/design/frontend/Magento/
app/etc/
.
.
.
vendor/zendframework/zend-view/src/Strategy/FeedStrategy.php
vendor/zendframework/zend-view/src/Strategy/JsonStrategy.php
vendor/zendframework/zend-view/src/Strategy/PhpRendererStrategy.php
vendor/zendframework/zend-view/src/Stream.php
vendor/zendframework/zend-view/src/Variables.php
vendor/zendframework/zend-view/src/View.php
vendor/zendframework/zend-view/src/ViewEvent.php
Change the permissions of the directory.
root@linuxhelp:/home/user1/Downloads# chown -R www-data:www-data /var/www/html/
Alter the file permission.
root@linuxhelp:/home/user1/Downloads# chmod -R 755 /var/www/html/
Restart the apache and mysql service
root@linuxhelp:/home/user1/Downloads# /etc/init.d/mysql restart
\[ ok \] Restarting mysql (via systemctl): mysql.service.
root@linuxhelp:/home/user1/Downloads# /etc/init.d/apache2 restart
\[ ok \] Restarting apache2 (via systemctl): apache2.service.
After completing all the process, open the browser and type http://< IP_address> /index.php
Click on Agree and setup magento
Now click Start the readiness check
After completed the above step, Click Next to add the databases for magento.
After the Database configuration is completed, Click Next to Web Configuration.
Then click Next to Customize your store.
Now create the admin account.
And click Install now.
Now see the summary of the installation process.
Click on Launch Magento Admin.
Login using the user credentials.
The dashboard of the magento 2.1.0 appears as shown below.
Open the browser and Navigate to http://< IP_address>
Comments ( 1 )