How To Install Magento 2.2
Magento is a robust and powerful platform for eCommerce websites. It is built with a PHP Framework. It comes with two editions - Magento-2 Commerce (EE), formerly known as Enterprise Edition) and Magento-ii Open up Source (formerly known as Community Edition). Magento-two is a fully customizable and user-friendly interface, which can gear up and control a fully operational east-commerce store in a few minutes.
In brusque, yous can apply Magento-2 EE/Commerce, which is a paid version where you can get all the advanced functionalities with a yearly subscription. You tin choose a slab based on your business-level/stage and Magento-2 CE/Opensource is offered a gratuitous version where anyone can download and apply information technology to build their own business, preferably (modest business concern) where they can do the test on how to build an eCommerce Site. CE tin can modify based on your requirements, it also has the advantage of using Magento extensions to strengthen the functionality.
This step-by-step guide will assistance you lot install/configure the about recent stable Magento2 Customs Edition (two.three) on CENTOS/RHEL 7.6. The aforementioned steps can be used for all the versions of CENTOS/RHEL/Fedora with a few minimal changes in commands.
Prerequisites :
Magento runs on Spider web Server as Apache or Nginx with a backend database (either MySQL or MariaDB)
Apache : Apache 2.4 or afterward
PHP : 7.two or after
MYSQL : five.6 or afterwards OR
MariaDB : MariaDB 10.1 or after
Server Ram : Minimum 2GB (according to the official Magento2)
My Lab Setup :
Server : CentOS-7.6
Apache : Apache/2.4.6
MariaDB : MariaDB ten.1 or subsequently
PHP : 7.2.25
IP address : 192.168.3.103
Domain name : magento-linuxteck.com
To start the installation setup of Magento-2, we need to prepare up the LAMP (Linux, Apache MariaDB, and PHP) stack in our Centos 7.vi server.
Stride 1: Install the LAMP stack
To consummate the steps to install the LAMP stack in CentOS:- please click here:
Showtime, permit'due south update the latest current version of the package.
# yum update -y
Install the EPEL repository using the post-obit command:
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-Key*
# yum -y install epel-release
Install Apache Server using the following command:
# yum install httpd -y
Use the following command to Get-go httpd service and enable it to start automatically after every reboot
# systemctl enable httpd
# systemctl start httpd
# systemctl status httpd
Now, we need to add some boosted configuration to the Apache Server in-guild to install the Magento awarding.
(a) Brand sure the Apache version :
# httpd -v
Server version: Apache/two.iv.6 (CentOS)
Server congenital: Aug 8 2022 11:41:18
(b) Magento volition be hosted under the DocumentRoot of /var/www/html in Apache Server. (You tin provide your path)
# mkdir -p /var/www/html/magento2
(c) If you take any normal user who needs to admission/modify the files of Magento other than the root user, then you need to change the ownership of Magento directory (/var/www/html/magento). In my case, a normal user named "magento"
# chown -R magento:magento /var/www/html/magento2
Using the following command you can cross-check the ownership of the directory
# ls -ld /var/world wide web/html/magento2/
drwxr-xr-x 2 magento magento 6 Dec 23 17:51 /var/world wide web/html/magento2/
(d) We need to set permissions in the above directory to ensure that all files and folders are attainable through the Magento awarding
# chmod -R 755 /var/world wide web/html/
# ls -ld /var/www/html/
drwxr-xr-x iii root root 22 Dec 31 xiv:48 /var/www/html/
(e) Now create a new Virtual Host in Apache Server: This is mainly used for adding multiple domain requests in a single apache server. To initialize this set-up, we need a directory to store our virtual host (this is zippo but to store individual websites in dissimilar directories), as well as we demand to tell the path of virtual hosts to the Apache configuration file to serve the sites for the visitors.
(i) Here we volition create two directories under Apache Server "/etc/httpd". One directory will save all the configuration files for the virtual host and the other directory will serve as a symbolic link for the newly created virtual host.
This directory is to store all the configuration files for the virtual host
# mkdir /etc/httpd/available-virtualhosts
# mkdir /etc/httpd/enable-virtualhosts ## This will be served for the symbolic links
(2) Create your first Virtual host file
# vi /etc/httpd/available-virtualhosts/magento.conf ## The virtual host file should be ended with ".conf"
<VirtualHost *:80>
ServerName magento-linuxteck.com
ServerAlias magento-linuxteck.com
DocumentRoot /var/world wide web/html/magento2
ErrorLog /var/log/magento/error.log
CustomLog /var/log/magento/access.log combined
</VirtualHost>
Salvage and get out.
(iii) Logs, you can create a folder "magento" nether /var/log, so that it will non mix upwardly with other logs
# mkdir /var/log/magento
(iv) Activate the symbolic link for the newly created virtual host configuration file
# ln -southward /etc/httpd/available-virtualhosts/magento.conf /etc/httpd/enable-virtualhosts/magento.conf
(v) Add the post-obit entry (including an optional directory) to the end of the Apache's configuration file. This is i of the easiest methods to activate and de-activate the virtual hosts in Apache. This concept was developed by Debain's well-wishers.
# vi /etc/httpd/conf/httpd.conf
IncludeOptional enable-virtualhosts/*.conf
Salve and get out.
(half-dozen) Create a dummy folio for the newly added virtual host
# vi /var/www/html/magento2/index.html
This is a testing page for magento-linuxteck.com
Save and exit.
(vii) Utilise the post-obit command to open Firewall ports HTTP (80) and HTTPS (443) services OR just disable the Firewall.
# firewall-cmd --permanent --add-port=80/tcp
# firewall-cmd --permanent --add-port=443/tcp
# firewall-cmd --reload
OR
# systemctl disable firewalld.service
# systemctl stop firewalld.service
(nine) Disable the SELinux or click here to configure SELinux for apache.
(x) At present, it's time to restart the Apache Server.
# systemctl restart httpd.service
Note: Open your web browser and hit "http://magento-linuxteck.com/" to run into the newly created dummy page
Install and Configure PHP vii.ii
In Centos-7, the default repository congenital with PHP five.4 version is not uniform with magento2 the latest version. It requires PHP 7.two or higher versions. Run across the following steps to install and configure PHP 7.2.
(a) Actuate EPEL and Remi "yum" repositories
This section discusses how to install and configure MySQL 5.6. CentOS 6.10 repositories take MySQL 5.one; to install a different version of MySQL, come across the MySQL documentation. # yum install epel-release
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
(b) Use the following control to install PHP 7.two and it's a dependency on your CentOS-seven Server
# yum --enablerepo=remi-php72 install php php-bcmath php-dom php-gd php-intl php-mbstring php-pdo_mysql php-soap php-zip
# yum install -y php72-php-xmlrpc.x86_64
(c) PHP seven.2 is installed, check the following command to find the version of PHP
# php -v
PHP 7.2.26 (cli) (built: Dec 17 2022 xiv:06:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.ii.0, Copyright (c) 1998-2018 Zend Technologies
(d) Tweaking PHP's default configuration file which is "php.ini". Based on our requirements we demand to alter the settings of PHP. These changes are related to uploading maximum size, display log errors, resource limits, setting the time zone, setting the maximum php execution time, etc.
Modify the following changes in your php.ini file. For the appointment, you can modify it based on your zone
# half-dozen /etc/php.ini
max_input_time = 30
memory_limit= 2G
error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
error_log = /var/log/php/error.log
appointment.timezone = Asia/Calcutta
cgi.fix_pathinfo=1
Save and leave.
Note: After every change in the php.ini file, do not forget to restart your web server.
(e) In CentOS-7 the mod_rewrite will be enabled by default, in case if information technology is not enabled, then follow the steps to enable "mod_rewrite" manually
Open this file and add the post-obit entry at the end of the file
# six /etc/httpd/conf.modules.d/00-base.conf
LoadModule rewrite_module modules/mod_rewrite.and then
Salve and go out.
Note: Restart your Apache Server!
(f) THIS IS AN OPTIONAL, IF THE. HTACESS NOT WORKING, So Nosotros NEED TO TWEAK THIS ENTRY INTO HTTP.CONF FILE.
Find the section <directory /var/world wide web> and change AllowOverride None to AllowOverride All
<Directory /var/www>
AllowOverride All
</Directory>
Save and get out.
Note: Finally, Restart your Apache Server!
(g) Create an info.php file under /var/www/html/magento2 to check all the current PHP configurations from your Spider web Browser
# echo "<?php phpinfo(); ?>" > /var/world wide web/html/magento2/info.php
Annotation: Open your web browser and hit: http://magento-linuxteck.com/info.php. Once you're confirmed, so delete the info.php file
Install and Configure Maria DB (Replacement of MySQL)
This section will show you how to install and configure the Database Management System (DBMS) for Magento2. As all we know, the launch of RHEL/CENTOS-7 RedHat has switched their default database management system from MySQL to MariaDB and the default MariaDB version is 5.5 which is non compatible with Magento2. As mentioned higher up, the compatible version is 10.1 or later. Information technology tin be upgraded through the MariaDB yum repository. Follow these steps to install and configure MariaDB x.one from yum repository:
(a) Create a repository configuration file for MariaDB 10.ane
# cat > /etc/yum.repos.d/mariadb.repo << EOF
[mariadb]
name=MariaDB
baseurl=http://yum.mariadb.org/10.1/centos7-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=i
enabled=ane
EOF
(b) Import GPG public primal
# rpm --import https://yum.mariadb.org/RPM-GPG-Key-MariaDB
(c) Enable yum enshroud for the recently added repo
# yum makecache fast
(d) Install MariaDB ten.1 version
# yum install -y mariadb-server
(e) Utilize the following command to start MariaDB service and enable it to start automatically after every reboot
# systemctl enable mariadb.service
# systemctl beginning mariadb.service
(f) Configure Maria DB
# mysql_secure_installation
(yard) Connect to MariaDB database instance using root credentials.
# mysql -u root -pXXXXXX (XXXXX is your root DB countersign )
Welcome to the MariaDB monitor.
Your MariaDB Server version: x.1.43-MariaDB MariaDB Server
MariaDB [(none)]>
(h) Create a new mysql user and database for Magento Applications.
MariaDB [(none)]> create database magento2;
Query OK, i row afflicted (0.00 sec)MariaDB [(none)]> create user [email protected] identified past '[e-mail protected]';
Query OK, 0 rows affected (0.01 sec)MariaDB [(none)]> grant all privileges on magento2.* to [e-mail protected] identified past '[email protected]';
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> quit
Adieu
Stride 2: Install Composer
(a) Utilize the following yum command to install PHP Composer
# yum --enablerepo=remi-php72 install php composer
(b) After installation check the version of the composer
# composer -V
Composer version i.9.1 2022-11-01 17:xx:17
Step 3: Install Magento CE
(a) Download magento2-2.three Community Edition from Magento Official Website. Click here to download: http://www.magentocommerce.com/download
(b) Later on downloading, extract the tar file of Magento2 into your Certificate Root (/var/world wide web/html/magento2)
# tar -xvf magento2-2.3.ii.tar.gz -C /var/world wide web/html/magento2/
Annotation: Make sure afterwards extraction all the Magento2 cores files should exist placed nether /var/world wide web/html/magento2 and remove whatsoever previously created dummy "alphabetize.html and info.php" from the same binder.
# pwd
/var/www/html/magento2
# ls
Output:
app composer.json generated pub vendor
auth.json.sample composer.lock grunt-config.json.sample lib nginx.conf.sample README.md
bin COPYING.txt Gruntfile.js.sample LICENSE_AFL.txt package.json.sample setup
CHANGELOG.doctor dev index.php LICENSE.txt phpserver var
(c) To install the Magento2 awarding via browser we need to modify the ownership of /var/www/html/magento2 to apache user and grouping. Follow the below command to exercise the same.
# chown -R apache:apache /var/www/html/magento2/
# ls -ld /var/world wide web/html/magento2/
Output:
drwxr-xr-x 13 apache apache 4096 Jan 2 13:55 /var/www/html/magento2/
(d) At present use the following command to download all the packages and their dependencies of Maento2 using composer from Terminal.
# composer install
Note: This will download all Magento components and their dependencies. Once you accept successfully installed magento2 using composer you will see a line ending with "Generating Autoload Files".
Access Magento Web Installation Wizard
(a) At present open your browser and hit "http://magento-linuxteck.com" and you volition get the WEB magician setup. Follow these screenshots for farther steps:
The first page will redirect you to the License Agreement Page of Magento2.
(i) Click on Agree and Setup Magento
(ii) Click on Start Readiness Check
(iii) If there are any fails plant during the Readiness Bank check, then you need to rectify before click Next. In our case in that location are no failures, and then click Next
(iv) Now fill in the Database details which you lot have created above and click on Next
(v) Make the changes to the Spider web Configuration based on your needs and click on Next
(vi) Customize your Store and click on Next
(vii) Create an Admin Account and click on Adjacent
(viii) Click on Install Now
(ix) Magento2 installation on CentOS 7 server in progress
(x) Magento2 installation has been completed.
(b) Due to the security measures of Magento2 awarding, we need to revoke the permission of the post-obit directories:
'/var/www/html/magento2/app/etc'. The following command will remove the write permission
# chmod -w /var/www/html/magento2/app/etc
Output:
chmod: /var/www/html/magento2/app/etc: new permissions are r-xrwxr-x, not r-xr-xr-ten
(c) Now Click on Launch Magento Admin
(d) Once y'all log in as an Admin User (linuxteck) , you'll see the Magento2 dashboard, which will appear something like this:
Determination
Congratulations, you take successfully installed Magento2 Customs Edition on RHEL/CentOS seven.6. During the installation of your Magento setup, if you face any difficulties, merely let the states know through the annotate box.
I hope this article will help y'all to set upwards a 'magento2 application on RHEL/CentOS-7. Drop me your feedback/comments.
Thanks!
Source: https://www.linuxteck.com/how-to-install-magento-2-2-on-rhel-centos-7-6/
Posted by: washingtonbeiriver.blogspot.com

0 Response to "How To Install Magento 2.2"
Post a Comment