{"id":1920,"date":"2022-07-01T09:39:41","date_gmt":"2022-07-01T09:39:41","guid":{"rendered":"https:\/\/www.checkmateq.com\/blog\/?p=1920"},"modified":"2023-08-06T15:06:41","modified_gmt":"2023-08-06T15:06:41","slug":"magento-2","status":"publish","type":"post","link":"https:\/\/www.checkmateq.com\/blog\/magento-2","title":{"rendered":"How to install Magento2 on Red Hat\/CentOS Machine"},"content":{"rendered":"<p><a href=\"https:\/\/www.checkmateq.com\/magento-development\"><strong>Magento<\/strong><\/a> is an <strong>open-source e-commerce platform<\/strong> used for CMS Development, E-commerce development and running online store. It is developed by Varian Inc. and written in<strong> PHP<\/strong>. In this blog, we will see how to install Magento on a <a href=\"https:\/\/www.checkmateq.com\/cloud\">Red Hat Linux Machine<\/a>.<\/p>\n<h3>Steps to install Magento on Red Hat:<\/h3>\n<p><strong>Step1: Check System Requirements<\/strong><\/p>\n<ul>\n<li>For best performance, your server must have 4GB of memory.<\/li>\n<li>Install the right version of software dependencies. The recommended versions of dependencies according to the Magento version are as below.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1924\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-01-152057-300x188.png\" alt=\"\" width=\"747\" height=\"468\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-01-152057-300x188.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-01-152057-1024x642.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-01-152057-768x482.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-01-152057.png 1183w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p><strong>Step2: Install the Apache web server, MySQL database and PHP<\/strong><\/p>\n<ul>\n<li>First, update the system.<\/li>\n<\/ul>\n<pre>sudo dnf install &amp;&amp; sudo dnf upgrade\r\n<\/pre>\n<ul>\n<li>Install httpd and MySQL with the following command.<\/li>\n<\/ul>\n<pre>sudo dnf install httpd mysql-server -y\r\n<\/pre>\n<ul>\n<li>Enable both services to start at reboot.<\/li>\n<\/ul>\n<pre>sudo systemctl start mysqld httpd\r\nsudo systemctl enable mysqld httpd\r\n<\/pre>\n<ul>\n<li>Next, we need to install PHP and the required extensions. First, add EPEL and REMI repository.<\/li>\n<\/ul>\n<pre>sudo yum -y install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-8.noarch.rpm\r\nsudo yum -y install https:\/\/rpms.remirepo.net\/enterprise\/remi-release-8.rpm\r\n<\/pre>\n<ul>\n<li>Next, install PHP 7.4.<\/li>\n<\/ul>\n<pre>sudo dnf -y install dnf-utils\r\nsudo dnf module reset php -y \r\nsudo dnf module install php:remi-7.4\r\n<\/pre>\n<ul>\n<li>Install the required PHP extensions.<\/li>\n<\/ul>\n<p>sudo dnf install php php-cli php-soap php-pdo php-bcmath php-mysqlnd php-opcache php-xml php-gd php-intl php-mbstring php-json php-iconv php-zip unzip git -y<\/p>\n<ul>\n<li>After installing php, open the php.ini file and make following changes.<\/li>\n<\/ul>\n<pre>allow_url_fopen = On\r\nshort_open_tag = On\r\nmemory_limit = 512M\r\nupload_max_filesize = 128M\r\nmax_execution_time = 3600\r\ndate.timezone = UTC\r\n<\/pre>\n<p><strong>Step3: Create MYSQL database for Magento<\/strong><\/p>\n<ul>\n<li>Use the following command to set the root password and secure your database.<\/li>\n<\/ul>\n<pre>sudo mysql_secure_installation\r\n<\/pre>\n<ul>\n<li>Answer the questions that are prompted.<\/li>\n<\/ul>\n<pre class=\"highlight-height line-numbers language-javascript\" data-line=\"\"><code class=\"language-javascript\">Enter current password for root (enter for none):\r\nSet root password? [Y\/n] Y\r\nNew password:\r\nRe-enter new password:\r\nRemove anonymous users? [Y\/n] Y\r\nDisallow root login remotely? [Y\/n] Y\r\nRemove test database and access to it? [Y\/n] Y\r\nReload privilege tables now? [Y\/n] Y<\/code><\/pre>\n<ul>\n<li>Login to MYSQL and create a user for Magento.<\/li>\n<\/ul>\n<pre class=\"highlight-height line-numbers language-javascript\" data-line=\"\"><code class=\"language-javascript\">mysql -u root -p<\/code><\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1967\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-141528-300x84.png\" alt=\"\" width=\"739\" height=\"207\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-141528-300x84.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-141528-768x214.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-141528.png 871w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<pre>CREATE USER 'magento2'@'localhost' IDENTIFIED BY 'password';\r\nALTER USER 'magento2'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';\r\nGRANT ALL PRIVILEGES ON *.* TO 'magento2'@'localhost' WITH GRANT OPTION;\r\nexit\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1974\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-142752-300x52.png\" alt=\"\" width=\"744\" height=\"129\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-142752-300x52.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-142752-1024x179.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-142752-768x134.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-142752.png 1138w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Now create a database.<\/li>\n<\/ul>\n<pre>mysql -u magento2 -p\r\nCREATE DATABASE magento2;\r\nexit\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1976\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-143023-300x128.png\" alt=\"\" width=\"750\" height=\"320\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-143023-300x128.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-143023-768x328.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-143023.png 994w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p><strong>Step4: Install and configure Elasticsearch<\/strong><\/p>\n<ul>\n<li>Elasticsearch requires Java, so we will first install it. Use the following commands to install Java.<\/li>\n<\/ul>\n<pre>sudo wget https:\/\/download.oracle.com\/java\/17\/latest\/jdk-17_linux-x64_bin.rpm \r\nsudo rpm -Uvh jdk-17_linux-x64_bin.rpm\r\njava -version\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1981\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-144048-300x26.png\" alt=\"\" width=\"750\" height=\"65\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-144048-300x26.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-144048-1024x89.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-144048-768x67.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-144048.png 1066w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Now for installing elasticsearch, add the following repo.<\/li>\n<\/ul>\n<pre>cat &lt;&lt;EOF | sudo tee \/etc\/yum.repos.d\/elasticsearch.repo\r\n[elasticsearch-7.x]\r\nname=Elasticsearch repository for 7.x packages\r\nbaseurl=https:\/\/artifacts.elastic.co\/packages\/oss-7.x\/yum\r\ngpgcheck=1\r\ngpgkey=https:\/\/artifacts.elastic.co\/GPG-KEY-elasticsearch\r\nenabled=1\r\nautorefresh=1\r\ntype=rpm-md\r\nEOF\r\n<\/pre>\n<ul>\n<li>Now clear and update the Yum package index.<\/li>\n<\/ul>\n<pre>sudo yum clean all\r\nsudo yum makecache\r\n<\/pre>\n<ul>\n<li>Next, install elasticsearch using following command.<\/li>\n<\/ul>\n<pre>sudo yum -y install elasticsearch-oss\r\n<\/pre>\n<ul>\n<li>Confirm installation with the following command.<\/li>\n<\/ul>\n<pre>rpm -qi elasticsearch-oss\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1990\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-150341-300x159.png\" alt=\"\" width=\"743\" height=\"394\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-150341-300x159.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-150341-768x406.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-150341.png 994w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Now to configure elastic search open the configuration file.<\/li>\n<\/ul>\n<pre>sudo nano \/etc\/elasticsearch\/elasticsearch.yml\r\n<\/pre>\n<ul>\n<li>Uncomment the <strong>network host line<\/strong> and make its value to 0.0.0.0 to make it publicly available. Make it 127.0.0.1 to make it available only to your machine.<\/li>\n<li>Uncomment<strong> http port<\/strong> line.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1995\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-151445-300x59.png\" alt=\"\" width=\"742\" height=\"146\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-151445-300x59.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-151445-1024x203.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-151445-768x152.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-151445.png 1036w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Uncomment <strong>discovery.seed_hosts<\/strong> line and make its value 127.0.0.1.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-2005\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-153339-300x36.png\" alt=\"\" width=\"742\" height=\"89\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-153339-300x36.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-153339.png 586w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>To set <strong>JVM<\/strong> options like memory limits open the following file.<\/li>\n<\/ul>\n<pre>sudo nano \/etc\/elasticsearch\/jvm.options\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-2011\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-160045-300x51.png\" alt=\"\" width=\"741\" height=\"126\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-160045-300x51.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-160045-768x132.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-160045.png 823w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Use less megabytes of memory if your system has less memory.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-2012\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-160330-300x46.png\" alt=\"\" width=\"743\" height=\"114\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-160330-300x46.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-160330-768x117.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-160330.png 952w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Use the following command to test if elasticsearch is working or not.<\/li>\n<\/ul>\n<pre>curl -X GET\u00a0<span class=\"token string\">'http:\/\/localhost:9200'<\/span>\r\n<\/pre>\n<ul>\n<li>You will get the following output if elasticsearch is working.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-2013\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-160530-300x135.png\" alt=\"Magento\" width=\"740\" height=\"333\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-160530-300x135.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-160530-768x347.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-160530.png 886w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p><strong>Step5: Install composer<\/strong><\/p>\n<ul>\n<li>Use the following command to download the <strong>Composer<\/strong>.<\/li>\n<\/ul>\n<pre>curl -sS https<span class=\"enlighter-c0\">:\/\/getcomposer.org\/installer -o composer-setup.php\r\n<\/span><\/pre>\n<ul>\n<li>Use the following command to install Composer.<\/li>\n<\/ul>\n<pre>sudo php composer-setup.php --install-dir=\/usr\/bin --filename=composer\r\n<\/pre>\n<ul>\n<li>Check the version with the following command.<\/li>\n<\/ul>\n<pre>composer\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-2015\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-162105-300x81.png\" alt=\"Magento\" width=\"744\" height=\"201\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-162105-300x81.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-162105.png 736w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p><strong>Step6: Install Magento2<\/strong><\/p>\n<ul>\n<li>Create an account to Magento2 marketplace and create an access key.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-2021\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-164330-300x65.png\" alt=\"Magento\" width=\"743\" height=\"161\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-164330-300x65.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-164330-1024x221.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-164330-768x166.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-164330-1536x332.png 1536w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-164330-1200x259.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-164330.png 1765w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Go to the following directory.<\/li>\n<\/ul>\n<pre>cd \/var\/www\/html\r\n<\/pre>\n<ul>\n<li>Use the following command to create Magento open source project.<\/li>\n<\/ul>\n<pre>sudo composer create-project --repository-url https:\/\/repo.magento.com\/ magento\/project-community-edition &lt;install-directory-name&gt;\r\n<\/pre>\n<ul>\n<li>Enter <strong>public key<\/strong> for username and <strong>private key<\/strong> for password.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-2022\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-164731-300x45.png\" alt=\"Magento\" width=\"747\" height=\"112\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-164731-300x45.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-164731-1024x153.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-164731-768x115.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-164731-1536x230.png 1536w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-164731-1200x180.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-164731.png 1888w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Now we have to set the required ownership and permission for files and directories. For that first we will create a user and add that user to web server group.<\/li>\n<\/ul>\n<pre>sudo adduser \"magento\"\r\nsudo passwd \"magento\"\r\nsudo usermod -a -G \"apache\" \"magento\"\r\nsudo systemctl restart httpd.service\r\n<\/pre>\n<ul>\n<li>Now set the required permissions with following commands.<\/li>\n<\/ul>\n<pre>cd \/var\/www\/html\/'magento install directory'\r\nsudo find var generated vendor pub\/static pub\/media app\/etc -type f -exec chmod g+w {} +\r\nsudo find var generated vendor pub\/static pub\/media app\/etc -type d -exec chmod g+ws {} +\r\nsudo chown -R magento:apache .\r\nsudo chmod u+x bin\/magento\r\n<\/pre>\n<ul>\n<li>Use the following command in the Magento directory to install Magento.<\/li>\n<\/ul>\n<pre><code class=\"plain plain\">php bin\/magento setup:install\u00a0<\/code><code class=\"plain plain\">--base-url=&lt;your-domain&gt;\u00a0<\/code><code class=\"plain plain\">--db-host=localhost\u00a0<\/code><code class=\"plain plain\">--db-name=magento2\u00a0<\/code><code class=\"plain plain\">--db-user=magento2\u00a0<\/code><code class=\"plain plain\">--db-password=&lt;your-db-password-of-magento2-user&gt;\u00a0<\/code><code class=\"plain plain\">--admin-firstname=Admin\u00a0<\/code><code class=\"plain plain\">--admin-lastname=Admin\u00a0<\/code><code class=\"plain plain\">--admin-email=admin@admin.com\u00a0<\/code><code class=\"plain plain\">--admin-user=admin\u00a0<\/code><code class=\"plain plain\">--admin-password=&lt;your-admin-password&gt;\u00a0<\/code><code class=\"plain plain\">--language=en_US\u00a0<\/code><code class=\"plain plain\">--currency=USD\u00a0<\/code><code class=\"plain plain\">--timezone=America\/Chicago\u00a0<\/code><code class=\"plain plain\"><span class=\"enlighter-text\">--backend-frontname=<\/span><span class=\"enlighter-s0\">admin\u00a0<\/span><\/code><code class=\"plain plain\">--use-rewrites=1\u00a0<\/code><code class=\"plain plain\">--search-engine=elasticsearch7\u00a0<\/code><code class=\"plain plain\">--elasticsearch-host=localhost\u00a0<\/code><code class=\"plain plain\">--elasticsearch-port=9200<\/code><\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-2030\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-172837-300x14.png\" alt=\"\" width=\"750\" height=\"35\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-172837-300x14.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-172837-1024x49.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-172837-768x36.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-172837-1536x73.png 1536w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-172837-1200x57.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-172837.png 1894w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-2031\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-172910-300x37.png\" alt=\"Magento\" width=\"738\" height=\"91\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-172910-300x37.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-172910.png 718w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Next, create httpd host file.<\/li>\n<\/ul>\n<pre>sudo vi \/etc\/httpd\/conf.d\/magento.conf\r\n<\/pre>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Copy and paste following code there.<\/li>\n<\/ul>\n<pre>ServerAdmin admin@example.com\r\nServerName magento2.example.com\r\nDocumentRoot \/var\/www\/html\/magento\/pub\r\nDirectoryIndex index.php\r\n\r\n\r\nOptions Indexes FollowSymLinks MultiViews\r\nAllowOverride All\r\nOrder allow,deny\r\nallow from all\r\n\r\n\r\nErrorLog \/var\/log\/httpd\/magento_error.log\r\nCustomLog \/var\/log\/httpd\/magento_access.log combined\r\n\r\n<\/pre>\n<ul>\n<li>Restart httpd service.<\/li>\n<\/ul>\n<pre>sudo systemctl restart httpd\r\n<\/pre>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Now navigate to the Magento root directory and execute the following commands.<\/li>\n<li>For production mode use following command.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre>\t\r\nsudo php bin\/magento deploy:mode:set production\r\nsudo php bin\/magento cache:flush\r\n<\/pre>\n<ul>\n<li>For development, mode use the following command.<\/li>\n<\/ul>\n<pre>sudo php bin\/magento deploy:mode:set developer\r\nsudo php bin\/magento cache:flush\r\n<\/pre>\n<ul>\n<li>Use following commands to update database and deploy static files.<\/li>\n<\/ul>\n<pre>sudo chmod -R 777 var pub\/static generated generated\/\r\nsudo php bin\/magento indexer:reindex\r\nsudo php bin\/magento setup:upgrade\r\nsudo php bin\/magento setup:static-content:deploy -f\r\nsudo php bin\/magento cache:flush\r\n<\/pre>\n<ul>\n<li>Run following command to install Magento cron jobs.<\/li>\n<\/ul>\n<pre>sudo bin\/magento cron:install\r\n<\/pre>\n<ul>\n<li>Go to your browser and access Magento with the server name.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-2042\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-192700-300x97.png\" alt=\"\" width=\"733\" height=\"237\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-192700-300x97.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-192700-1024x332.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-192700-768x249.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-192700-1536x498.png 1536w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-192700-1200x389.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-192700.png 1873w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Use the following command in the Magento root directory to disable two-factor authentication for admin login.<\/li>\n<\/ul>\n<pre>sudo php bin\/magento module:disable Magento_TwoFactorAuth\r\n<\/pre>\n<ul>\n<li>Access admin panel with following url.<\/li>\n<\/ul>\n<pre>http:\/\/server_name\/admin\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-2043\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-192955-261x300.png\" alt=\"Magento\" width=\"720\" height=\"828\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-192955-261x300.png 261w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-2022-07-04-192955.png 649w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>Author Details<\/strong><\/p>\n<p>This blog is written by M\/S Checkmate global Technologies software development team. Please reach out to our technical consultant to hire experienced <a href=\"https:\/\/www.checkmateq.com\/magento-development\">magento developer<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento is an open-source e-commerce platform used for CMS Development, E-commerce development and running online store. It is developed by Varian Inc. and written in PHP. In this blog, we will see how to install Magento on a Red Hat Linux Machine. Steps to install Magento on Red Hat: Step1: Check System Requirements For best &hellip; <a href=\"https:\/\/www.checkmateq.com\/blog\/magento-2\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to install Magento2 on Red Hat\/CentOS Machine&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":2024,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[15,53,7,11,23,6],"_links":{"self":[{"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/posts\/1920"}],"collection":[{"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/comments?post=1920"}],"version-history":[{"count":76,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/posts\/1920\/revisions"}],"predecessor-version":[{"id":4282,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/posts\/1920\/revisions\/4282"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/media\/2024"}],"wp:attachment":[{"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/media?parent=1920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/categories?post=1920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/tags?post=1920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}