MAGENTO 2 INSTALLATION ON CENT OS 7 WITH APACHE,PHP5.6,MARIADB & PHPMYADMIN
STEP 1 : Apache installation
#yum -y install httpd
#
systemctl start httpd
#
systemctl enable httpd
#firewall-cmd
--zone=public --permanent --add-service=http
#
firewall-cmd --zone=public --permanent --add-service=https
#
firewall-cmd --reload
·
Changes made in /etc/httpd/conf/httpd.conf
Ø
ServerName <ipaddress or doman
name>:80
Ø
Require all granted( within
<Directory "/var/www"> )
Ø
Options Indexes FollowSymLinks
Multiviews
#httpd
-v
STEP 2: PHP Installation
#yum -y
update
#yum -y
install epel-release
#wget
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
#wget
https://centos7.iuscommunity.org/ius-release.rpm
#rpm
-Uvh ius-release*.rpm
#yum -y
update
#yum -y
install php56u php56u-opcache php56u-xml php56u-mcrypt php56u-gd php56u-devel
php56u-mysql php56u-intl php56u-mbstring php56u-bcmath php56u-soap
·
Edit /etc/php.ini file
·
memory_limit=1024M
·
always_populate_raw_post_data =
-1 (//ensure this value)
·
Make sure asp_tags = off
#service
httpd restart
STEP 3: PHPMyAdmin Installation (version 4.7.6)
# yum
install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
# yum
--enablerepo=remi install phpMyAdmin
·
Edit
/etc/httpd/conf.d/phpMyAdmin.conf
Require all granted [ under <IfModule mod_authz_core.c> ]
·
edit
/etc/phpMyAdmin/config.inc.php
$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or
cookie based)?
# systemctl restart httpd.service
STEP 4: MARIADB INSTALLATION
Ø
To
install MariaDB database, we need to add the following official MariaDB
repository to file /etc/yum.repos.d/MariaDB.repo as shown.
[mariadb]
name =
MariaDB
baseurl
= http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
#yum -y
install mariadb-server mariadb
#systemctl
start mariadb
#systemctl
enable mariadb
#mysql
(it will give version)
#mysql_secure_installation
# mysql
-u root -p
##
Creating New User for Magento Database ##
mysql>
CREATE USER magento@localhost IDENTIFIED BY "your_password_here";
##
Create New Database ##
mysql>
create database magento;
## Grant
Privileges to Database ##
mysql>
GRANT ALL ON magento.* TO magento@localhost;
## FLUSH
privileges ##
mysql>
FLUSH PRIVILEGES;
## Exit
##
mysql>
exit
while
having problems in accessing or creating
databases for root user do the following
cd
/var/lib/
chown -R
mysql:mysql ./mysql/ //give
the ownership & group as mysql for mysql directory
STEP 5: Magento Installation
1.
Download
the magento 2.0.17 compressed file
wget https://github.com/magento/magento2/archive/2.0.17.tar.gz
2.
Untar
the file to web root directory
tar -xvzf magento2-2.0.17.tar.gz
-C /var/www/html/
3.
cd
/var/www/html/
4.
mv
magento2-2.0.17/* /var/www/html/
5.
curl
-sS https://getcomposer.org/installer | sudo php --install-dir=/usr/bin --filename=composer
6.
composer
install –v ( within /var/ww/html/)
7.
sudo chown -R apache:apache /var/www/html/
8.
sudo chmod -R 775 /var/www/html/
9.
service
httpd restart
10. export
PATH=$PATH:/var/www/html/bin (for
executing magento commands in any terminal)
STEP 6: Modifications/Permissions for Magento
The
commands in this step should be run from your Magento installation directory
(where you extracted the archive). If you are not still in that directory,
navigate there before proceeding.
#find
var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
#find
var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
#chmod
u+x bin/magento
#chown
-R apache:apache var/
#chown
-R apache:apache pub/media/
# chown
-R apache:apache pub/static/
#chown
-R apache:apache app/etc/
#setenforce
0
#service
httpd restart
STEP 7: Finishing Magento Installation
– Go to
your Magento site: your_server_ip/, you should see a welcome screen. Click on
Agree and Setup Magento to start.
–
Magento will now check your machine to see if some requirements is met. Hit
Next when done.
– Enter
your database’s information. Hit Next when done.
– After that,
Magento will prompt your to enter your site’s info. Hit Next when done
– Enter
some more infos of location and language for your store. Hit Next when done
– Next,
enter your new admin account’s info. Hit Next when done
– Hit
Install Now to finish your setup.
Congratulations,
you have successfully installed your Magento 2 store on your CentOS server.