magento2 – TecAdmin https://tecadmin.net How to guide for System Administrator's and Developers Wed, 23 Jun 2021 03:04:57 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 How to Install Magento2 on Fedora 34/33 https://tecadmin.net/install-magento-on-fedora/ https://tecadmin.net/install-magento-on-fedora/#respond Sat, 14 Mar 2020 02:48:13 +0000 https://tecadmin.net/?p=20654 Magento is the best enterprise-class eCommerce software and solution. It is powered by open, flexible, and next-gen architecture. The application developed with Magento will provide the best and engaging shopping experience for users. Its performance is best than other eCommerce applications available. The Magento 2 is the latest release available. This version has a number [...]

The post How to Install Magento2 on Fedora 34/33 appeared first on TecAdmin.

]]>
Magento is the best enterprise-class eCommerce software and solution. It is powered by open, flexible, and next-gen architecture. The application developed with Magento will provide the best and engaging shopping experience for users. Its performance is best than other eCommerce applications available. The Magento 2 is the latest release available. This version has a number of improvement changes and optimizations over the previous Magento version.

This tutorial will help you to configure the Magento application on your Fedora system.

Step 1 – Install LAMP

First of all, you need to set up a LAMP environment on the Fedora system. You can use the following commands to install Apache web server and PHP from default repositories.

sudo dnf update
sudo dnf install httpd

Then install PHP and other required PHP modules.

sudo dnf install php libapache2-mod-php php-mysql php-dom php-simplexml 
sudo dnf install php-curl php-intl php-xsl php-mbstring php-zip php-xml

Step 2 – Install MySQL Server

You can use MySQL or MariaDB as the database server for the Magento application. To install the MySQL server run the following command.

sudo dnf install mysql-server

The default MariaDB database server will be installed. Now start service and complete the initial setup for the database server.

sudo systemctl enable mariadb
sudo systemctl start mariadb

Now run below command to complete Mariadb setup:

sudo mysql_secure_installation

Follow the onscreen instructions. Below is the input required from user:

  • Enter current password for root (enter for none): [PRESS ENTER]
  • Set root password? [Y/n] y
  • New password: [ENTER YOUR PASSWORD]
  • Re-enter new password: [ENTER PASSWORD AGAIN]
  • Remove anonymous users? [Y/n] y
  • Disallow root login remotely? [Y/n] y
  • Remove test database and access to it? [Y/n] y
  • Reload privilege tables now? [Y/n] y

Step 3 – Install PHP Composer

This tutorial required PHP composer to complete the installation. To install the PHP composer on your system execute following commands:

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer    
chmod +x /usr/local/bin/composer   

Step 4 – Download Magento 2

You can download the Magento source code from the official Github repository or website. After finishing the download After downloading the archive file, extract it under the website document root. So we can access it directly from the web browser.

wget https://github.com/magento/magento2/archive/2.3.zip
mv magento2-2.3 /var/www/magento2

After placing Magento files in the proper location, use composer to install required libraries

cd /var/www/magento2
composer install

The composer installation will take some time. Once the composer finished installation, set the recommended permissions on the files to run with the Apache webserver.

sudo chown -R www-data.www-data /var/www/magento2
sudo chmod -R 755 /var/www/magento2
sudo chmod -R 777 /var/www/magento2/{pub,var}

Step 5 – Create MySQL User and Database

We already have MariaDB running on the system and generated the root passwords in previous steps. It’s a good idea to use a separate account for the Magento configuration. Log in to the database server with the root user and create a database and user for the new Magento 2 installation.

mysql -u root -p

mysql> CREATE DATABASE magento2_db;
mysql> CREATE USER magento2_usr@'localhost' IDENTIFIED BY 'pa$$word';
mysql> GRANT ALL ON magento2_db.* TO magento2_usr@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> quit

Step 6 – Setup Apache VirtualHost

Now create an Apache virtual host for your domain.

sudo vim /etc/httpd/conf.d/webhost.tecadmin.net.conf

<VirtualHost *:80>
    ServerAdmin admin@example.com
    ServerName webhost.tecadmin.net
    DocumentRoot /var/www/magento2
    <Directory /var/www/magento2>
        Allowoveride all
    </Directory>
</VirtualHost>

Save and close the file. Restart Apache service to reload the configuration.

sudo systemctl restart httpd.service

Step 7 – Run Web Installer

Let’s begin the installation of Magento2 using a web installer. Access your Magento 2 directory on the web browser like below. It will redirect you to the installation start page.

 http://webhost.tecadmin.net

7.1. Agree the License agreement and click on “Agree and Setup Magento”

7.2. Now click on the “Start Readiness Test”. Magento will check for system requirements here. On successful completion, you will see the screen like below then Just click Next. Fix issues if shows on this screen and click Try again.

7.3. Enter your database details here created in step 4.

7.4. The installer will show you the store address (Same as we address). It also generates a random URL for the Admin interface. You can change it as per your requirements. For security reasons, it will not take the URL as admin.

7.5. Create an Admin user with a secure password for your Magento application.

7.6. At this step, Magento is ready for installation. Click on the Install Now button to begin installation and wait for its completion.

7.7. At this step, the Magento installation is completed.

7.8. Finally, it will open the Admin Login screen. Use admin credentials created during the wizard. It will open the Admin panel after successful authentication.

Congratulation! You have successfully configured Magento2 on your Fedora system.

Step 8 – Schedule Cronjobs

Finally, schedule the background cronjobs for your magento2 installation. These cronjobs do some activities like re-indexing, Newsletters, Update currency rates, sending automatic emails and generating sitemaps, etc. To schedule, these jobs edit the crontab file

crontab -e

and add the following cronjobs at the end of the file and save it.

* * * * * php /var/www/magento2/bin/magento cron:run
* * * * * php /var/www/magento2/update/cron.php
* * * * * php /var/www/magento2/bin/magento setup:cron:run

Conclusion

This tutorial helped you with step by step installation of the Magento2 application on a Fedora Linux system.

The post How to Install Magento2 on Fedora 34/33 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-magento-on-fedora/feed/ 0
Magento 2 Codebase & Database Backup Script https://tecadmin.net/magento2-backup-script/ https://tecadmin.net/magento2-backup-script/#respond Tue, 10 Mar 2020 16:56:33 +0000 https://tecadmin.net/?p=20672 This tutorial will help you to automate the Magento2 codebase and database backup process using a shell script. The script will perform automatic backups on a scheduled interval. The script also has the ability to remove older backups as per configuration. Setup Magerun2 You need to download and configure the Magerun2 script on your system. [...]

The post Magento 2 Codebase & Database Backup Script appeared first on TecAdmin.

]]>
This tutorial will help you to automate the Magento2 codebase and database backup process using a shell script. The script will perform automatic backups on a scheduled interval. The script also has the ability to remove older backups as per configuration.

Setup Magerun2

You need to download and configure the Magerun2 script on your system.

wget https://files.magerun.net/n98-magerun2.phar
mv n98-magerun2.phar /usr/local/bin/n98-magerun2
chmod +x /usr/local/bin/n98-magerun2 

Download Shell Script

You can download Magento2 backup script from here. Alternativly, use below command to download script using wget command.

wget https://tecadmin.net/wp-content/downloads/scripts/magento2-backup.sh

You can also copy the script below and paste it in a file on your machine.

#!/bin/bash

#######################################################################################
##
##   Magento 2 database and codebase backup script
##   Written By: Rahul Kumar
##   Written on: Mar 06, 2020
##   Last Update: Mar 11, 2020
##
#######################################################################################

################## Modify below values  ###############################################


MAGENTO_DOCUMENT_ROOT="/var/www/magento2"
BACKUP_PATH="/var/www/magento2/var/backups"

BACKUP_RETAIN_DAYS=30     # Number of days to keep a local backup copy

GZIP="/bin/gzip"
RM="/bin/rm"
MKDIR="/bin/mkdir"
N98_MAGERUN2="/usr/local/bin/n98-magerun2"



#######################################################################################
##################              Do not change below values              ###############

export PATH=/bin:/usr/bin:/usr/local/bin
TODAY="$(date "+%Y-%m-%d-%H-%M")"
CURRENT_BACKUP_DIR="${BACKUP_PATH}/${TODAY}"

#######################################################################################
##################              Functions               ###############################

exit_on_error(){
        echo -e "$@"
        exit 99
}

maintenance_mode(){
        ${N98_MAGERUN2} sys:maintenance ${1} --skip-root-check --root-dir=${MAGENTO_DOCUMENT_ROOT}
}

check_cmds(){
    [ ! -x ${GZIP} ] && exit_on_error "FILENAME $GZIP does not exists. Make sure correct path is set in config section."
    [ ! -x ${RM} ] && exit_on_error "FILENAME $RM does not exists. Make sure correct path is set in config section."
    [ ! -x ${MKDIR} ] && exit_on_error "FILENAME $MKDIR does not exists. Make sure correct path is set config section."
    [ ! -x ${N98_MAGERUN2} ] && exit_on_error "FILENAME $N98_MAGERUN2 does not exists. \nDownload script from https://files.magerun.net/ and Make sure correct path is set in config section."
}

create_backup_dir(){
        [ ! -d ${CURRENT_BACKUP_DIR} ] && ${MKDIR} -p ${CURRENT_BACKUP_DIR}
}

database_backup(){

        ${N98_MAGERUN2} --skip-root-check --root-dir=${MAGENTO_DOCUMENT_ROOT} db:dump ${CURRENT_BACKUP_DIR}/database-${TODAY}.sql

        if [ $? -eq 0 ]; then
                echo "Database backup successfully completed"
        else
                maintenance_mode --off    ##### Disable mainenence even database backup failed
                exit_on_error "Database backup failed. "
        fi
}



codebase_backup(){

        cd $MAGENTO_DOCUMENT_ROOT && \
        tar -cpzf ${CURRENT_BACKUP_DIR}/codebase-${TODAY}.tar.gz --exclude=var/* .

        if [ $? -eq 0 ]; then
                echo "Codebase backup successfully completed"
        else
                maintenance_mode --off    ##### Disable mainenence even codebase backup failed
                exit_on_error "Codebase backup failed. "
        fi
}


cleanup_old_backup(){

        REMOVE_DIR_NAME=`date "+%Y-%m-%d-%H-%M" --date="${BACKUP_RETAIN_DAYS} days ago"`

        if [ ! -z ${BACKUP_PATH} ]; then
                  cd ${BACKUP_PATH}
                  if [ ! -z ${REMOVE_DIR_NAME} ] && [ -d ${REMOVE_DIR_NAME} ]; then
                                rm -rf ${REMOVE_DIR_NAME}
                  fi
        fi
}

########################################################################################
##################              Main (Calling functions)           #####################

check_cmds
create_backup_dir
maintenance_mode --on
database_backup
codebase_backup
maintenance_mode --off
cleanup_old_backup


##########################################################################################
##################                      Script Ends Here                ##################
##########################################################################################

Schedule Backup Scrpt

Schedule this script using crontab on your system to run on a daily basis. Use below command to edit crontab configuration:

crontab -e

And add below entry at the end of file.

0 0 * * * sh magento2-backup.sh

Save file and close. You have successfully scheduled cronjob to run on 12:00 AM daily basis. To learn more about using the cronjob read this tutorial.

The post Magento 2 Codebase & Database Backup Script appeared first on TecAdmin.

]]>
https://tecadmin.net/magento2-backup-script/feed/ 0
How to Install Magento2 on Ubuntu 18.04 https://tecadmin.net/install-magento-ubuntu-18-04/ https://tecadmin.net/install-magento-ubuntu-18-04/#comments Tue, 03 Mar 2020 15:21:31 +0000 https://tecadmin.net/?p=20653 Magento is the best eCommerce software and solution for online services. Magento 2 is the latest version Recently the Magento team has released its new version Magento 2.0 with lots of improvements changes and optimizations over Magento 1. This tutorial will help you to install the Magento2 application on Ubuntu 18.04 system. Recommended: Magento2 codebase [...]

The post How to Install Magento2 on Ubuntu 18.04 appeared first on TecAdmin.

]]>
Magento is the best eCommerce software and solution for online services. Magento 2 is the latest version Recently the Magento team has released its new version Magento 2.0 with lots of improvements changes and optimizations over Magento 1. This tutorial will help you to install the Magento2 application on Ubuntu 18.04 system.

Recommended: Magento2 codebase and database backup automation script

Step 1 – Install LAMP

You can use the following commands to install all requirements from default repositories.

sudo apt update
sudo apt install apache2 wget unzip 

Then install PHP and other required PHP modules.

sudo apt install php libapache2-mod-php php-mysql php-dom php-simplexml php-pear
sudo apt install php-curl php-intl php-xsl php-mbstring php-zip php-xml php-soap php-bcmath

You can use MySQL or MariaDB as the database server for the Magento application.

sudo apt install mysql-server

Once the installation finished, run the mysql_secure_installation script to create a password for the root account and secure the MySQL server.

sudo systemctl start mysql.service
sudo mysql_secure_installation

The LAMP environment is completed on your system. Move to next step:

Step 2 – Install Composer

This tutorial required PHP composer to complete the installation. To install the PHP composer on your system execute following commands:

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer    
chmod +x /usr/local/bin/composer   

Step 3 – Download Magento 2 Archive

You can download the Magento source code from the official Github repository or website. After finishing the download After downloading the archive file, extract it under the website document root. So we can access directly from the web browser.

wget https://github.com/magento/magento2/archive/2.3.zip
unzip 2.3.zip
mv magento2-2.3 /var/www/magento2

After placing Magento files to the proper location, use composer to install required libraries

cd /var/www/magento2
composer install

Then, set the proper permission on the files to run with Apache webserver.

sudo chown -R www-data.www-data /var/www/magento2
sudo chmod -R 755 /var/www/magento2
sudo chmod -R 777 /var/www/magento2/{pub,var}

Step 4 – Create Database and User

Magento uses MySQL as a backend database server. Login to your MySQL server with admin privileges and create a database and user for the new Magento 2 installation.

mysql -u root -p

mysql> CREATE DATABASE magento2_db;
mysql> CREATE USER magento2_usr@'localhost' IDENTIFIED BY 'pa$$word';
mysql> GRANT ALL ON magento2_db.* TO magento2_usr@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> quit

Step 5 – Create Apache VirtualHost

Create an Apache configuration file for your Magento website like /etc/apache2/sites-available/magento2.example.com.conf

sudo vim /etc/apache2/sites-available/webhost.tecadmin.net.conf

and add the following content.

<VirtualHost *:80>
   DocumentRoot /var/www/magento2
   ServerName webhost.tecadmin.net
   
   <Directory /var/www/magento2>
       Allowoverride all
   </Directory>
</VirtualHost>

Now enable virtual host using the following command.

sudo a2ensite webhost.tecadmin.net

Also make sure to enable the Apache rewrite module, which is recommended by Magento.

sudo a2enmod rewrite

After doing all the above changes, make sure to restart the Apache server.

sudo systemctl restart apache2.service

Step 6 – Run Web Installer

Let’s begin the installation of Magento2 using a web installer. Access your Magento 2 directory on the web browser like below. It will redirect you to the installation start page.

 http://webhost.tecadmin.net

6.1. Agree the License agreement and click on “Agree and Setup Magento”

6.2. Now click on the “Start Readiness Test”. Magento will check for system requirements here. On successful completion, you will see the screen like below then Just click Next. Fix issues if shows on this screen and click Try again.

6.3. Enter your database details here created in step 4.

6.4. The installer will show you the store address (Same as we address). It also generates a random URL for the Admin interface. You can change it as per your requirements. For security reasons, it will not take the URL as admin.

6.5. Create an Admin user with a secure password for your Magento application.

6.6. At this step, Magento is ready for installation. Click on the Install Now button to begin installation and wait for its completion.

6.7. At this step, the Magento installation is completed.

6.8. Finally, it will open the Admin Login screen. Use admin credentials created during wizard. It will open the Admin panel after successful authentication.

Congratulation! You have successfully deployed Magento2 on your system.

Step 6 – Schedule Magento2 Cronjobs

Finally, schedule the background cronjobs for your magento2 installation. These cronjobs do some activities like re-indexing, Newsletters, Update of currency rates, sending automatic emails and generating sitemaps, etc. To schedule, these jobs edit the crontab file

crontab -e

and add following cronjobs at the end of the file and save it.

* * * * * www-data php /var/www/magento2/bin/magento cron:run
* * * * * www-data php /var/www/magento2/update/cron.php
* * * * * www-data php /var/www/magento2/bin/magento setup:cron:run

Here www-data is the user under which Apache is running and /var/www/magento2/ is the location of your Magento2 applications.

Conclusion

You have successfully configured the Magento application on your system. Let’s build an awesome eCommerce website. For the production, server follow our next tutorial to Magento codebase and database backup automation script.

The post How to Install Magento2 on Ubuntu 18.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-magento-ubuntu-18-04/feed/ 2
Magento 2 Performance Optimization Tips https://tecadmin.net/magento-2-performance-optimization-tips/ https://tecadmin.net/magento-2-performance-optimization-tips/#comments Wed, 09 Aug 2017 01:59:08 +0000 https://tecadmin.net/?p=13349 With the rise in technology, people’s attention span is decreasing. Magento, owned by eBay is one of the most widely used eCommerce platforms used to grow business online these days. Although, you have a lot of options when it comes to choosing an E-commerce CMS or platform such as WooCommerce, Shopify, etc. But for me, [...]

The post Magento 2 Performance Optimization Tips appeared first on TecAdmin.

]]>
With the rise in technology, people’s attention span is decreasing. Magento, owned by eBay is one of the most widely used eCommerce platforms used to grow business online these days. Although, you have a lot of options when it comes to choosing an E-commerce CMS or platform such as WooCommerce, Shopify, etc. But for me, Magento is a robust platform with a high level of functionality and customizability.

According to several types of research, 16% of the top 100,000 eCommerce websites are using Magento, 22% if we also include Magento Enterprise. And WooCommerce comes in at a close second with 12%. Even Google trends agree with the fact that the activity around Magento is still very high, since its official release in 2008.

Magento 2 Performance Optimization - Marketplace

Now good performance is a key aspect of a successful e-commerce project. It not only plays a vital ranking factor but also is highly appreciated by end users. A fast online store often has a high conversion rate than its competitors. Thus, it is very important that you are running the latest version of Magento as updates generally contain bug fixes and performance improvements. The second version of the platform differs a lot and requires another approach when it comes to performance improvements.

Magento 2 is faster, less resource-hungry, and better optimized for high loads than 1.X. Moreover, it offers a lot of new performance features out-of-the-box. For example, you get native support for Varnish, Redis, and Nginx as well as full page caching in Magento 2. Where in previous versions, all these features were only available through customizations and extensions.

How to Optimize Magento 2 Performance?

If we take a normal eCommerce page into account, it takes more than 3s to load a product page. As a customer, do you find this annoying if you require browsing through five similar pages at your website? Of course yes! I mean nobody is sitting idle or patient enough to wait for the delay.

Magento 2 Performance Optimization Steps

Step 1 – Enable Flat Categories and Products

The speed of Magento 2 performance is the ability of database loading. Enabling flat catalog means simply offloading a number of the database once there is any request for showing the product. At the same time, MySQL query complexity will be reduced.

Go to backend, Stores > Configuration > Catalog > Catalog > Storefront (Choose Yes in Use Flat Catalog Category field.)

Step 2 – Merge CSS and JS Files

Next is to merge and minifying CSS and JavaScript files. This means making the web page as light as possible for the fast loading.

For JavaScript-

  • Go to backend, Stores -> Configuration > Advanced > Developer > JavaScript Settings
  • Set Merge JavaScript Files to Yes
  • Set Minify JavaScript Files to Yes

For CSS File-

  • Go to backend, Stores -> Configuration > Advanced > Developer > CSS Settings
  • Set Merge CSS Files to Yes
  • Set Minify CSS Files to Yes

Step 3 – Content Delivery Network

Commonly known as CDN, it is a special system that can connect all cache servers.

Go to backend, Stores > Configuration > General > Web > Base URLs (Secure)

Step 4 – Enable Caching

Magento works with the following types of cache:

  • Configuration cache
  • Layout cache
  • Block HTML output cache
  • Collections data cache
  • DDL cache
  • Entity attribute value cache
  • Page cache gathers data
  • Translations cache
  • Integration configuration cache
  • Integration API configuration cache
  • Web services configuration cache

System > Cache Management

Magento 2 Performance Optimization - Caching

Step 5 – Image Optimization

Any well-founded Magento development company would recommend Image optimization to make the most out of your Magento 2. Image size being too heavy could be one of the crucial reasons for the overload page. Henceforth, compressing should be done before submitting any image. For this, you can use the JPEG format or PNG for layout as well as the logo.

Step 6 – Reduce Server Response Time

The site’s response time gets quite good, i.e. 0.5s with Magento 2 Built-in cache functionality.

Go to backend, Stores > Configuration > Advanced > System > Full Page Cache, transfer Caching Application to Varish Cache.

On and all, With so many alternate options available nobody is willing or patient enough to bear with slow transactions. So, it’s really important that you take a few steps to improve the speed and performance of your Magento 2 site.

The post Magento 2 Performance Optimization Tips appeared first on TecAdmin.

]]>
https://tecadmin.net/magento-2-performance-optimization-tips/feed/ 2
Install Magento2 using Composer on Ubuntu & Debian https://tecadmin.net/install-magento2-using-composer-ubuntu/ https://tecadmin.net/install-magento2-using-composer-ubuntu/#comments Sun, 25 Sep 2016 09:35:45 +0000 https://tecadmin.net/?p=10859 Magento is the best eCommerce software and solution for online services. Recently Magento team has released its new version Magento2 with lots of improvements changes and optimizations over Magento1. This tutorial will help you to install Magento2 on Ubuntu, Debian, and Linux Mint systems. Below are the system requirements for the Magento installation. Apache 2.2 [...]

The post Install Magento2 using Composer on Ubuntu & Debian appeared first on TecAdmin.

]]>
Magento is the best eCommerce software and solution for online services. Recently Magento team has released its new version Magento2 with lots of improvements changes and optimizations over Magento1. This tutorial will help you to install Magento2 on Ubuntu, Debian, and Linux Mint systems.

Below are the system requirements for the Magento installation.

  • Apache 2.2 or 2.4 with mod_rewrite module (or) Nginx >= 1.8.
  • PHP 5.5 or later version. PHP 7.0 also supported.
  • Required PHP-Modules – PDO/MySQL, mbstring, mcrypt, mhash, SimpleXML, curl, xsl, gd, ImageMagick 6.3.7 (or later) or both, soap, intl, openssl.
  • Composer and Git

1. Install Requirements

You can use following commands to install all requirements from default repositories.

sudo apt install apache2 git mysql-server
sudo apt install php libapache2-mod-php php-mysql php-dom php-simplexml php-gd php-soap
sudo apt install php-curl php-intl php-xsl php-mbstring php-zip php-xml php-mcrypt

Also install PHP composer on your system.

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer    
chmod +x /usr/local/bin/composer   

2. Setup Magento2

Magento2 code is available under the Github repository. Use the following command to clone the Magento2 repository on your system using git.

git clone https://github.com/magento/magento2.git

Now install all required modules for Magento2 using composer. Wait for the installation process completed.

cd magento2/
composer install

Now set the permissions on files and directories.

sudo chmod -R 755 /var/www/magento2/
sudo chmod -R 777 /var/www/magento2/{pub,var}

3. Create Database

Now login to your MySQL server with admin privileges and create a database and user for new magento2 installation.

mysql -u root -p

mysql> CREATE DATABASE magento2_db;
mysql> GRANT ALL ON magento2_db.* TO magento2_usr@'localhost' IDENTIFIED BY 'password';
mysql> FLUSH PRIVILEGES;
mysql> quit

4. Configure Apache VirtualHost

Create Apache configuration file for your Magento website like /etc/apache2/sites-available/magento2.example.com.conf and add following content.

<VirtualHost *:80>
   DocumentRoot /var/www/magento2
   ServerName magento2.example.com
   
   <Directory /var/www/magento2>
       Allowoverride all
   </Directory>
</VirtualHost>

Now enable virtualhost using following command.

sudo a2ensite magento2.example.com

Also make sure to enable the Apache rewrite module, which is recommended by Magento.

sudo a2enmod rewrite

After doing all the above changes, make sure to restart the Apache server.

sudo systemctl restart apache2.service

5. Start Web Installer

Let’s begin the installation of Magento2 using a web installer. Access your magento2 directory on a web browser like below. It will redirect you to the installation page.

 http://magento2.example.com/

On the first step agree with the License agreement and click on “Agree and Setup Magento”.

On Step 1 click on “Start Readiness Test”. Magento will check for system requirements here. On successful completion, you will see a screen like below then Just click Next. Fix issues if shows on this screen and click Try again.

magento2-install-step-1

Now follow the wizard steps 2, 3, 4, 5, 6 and on successful installation, you will get a screen like below.

magento2-install-success

Now login to your admin panel using created admin credentials in the above steps.

magento2-admin-dashboard

Congratulation! You have successfully deployed Magento2 on your system.

6. 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. To schedule these jobs edit crontab file

crontab -e

and add following cronjobs at the end of file and save it.

*/1 * * * * www-data php /var/www/magento2/bin/magento cron:run
*/1 * * * * www-data php /var/www/magento2/update/cron.php
*/1 * * * * www-data php /var/www/magento2/bin/magento setup:cron:run

Here www-data is the user under which Apache is running and /var/www/html/magento2/ is the location of your Magento2 applications.

The post Install Magento2 using Composer on Ubuntu & Debian appeared first on TecAdmin.

]]>
https://tecadmin.net/install-magento2-using-composer-ubuntu/feed/ 2
Magento 2 Database Configuration File https://tecadmin.net/magento-2-database-configuration-file/ https://tecadmin.net/magento-2-database-configuration-file/#comments Tue, 08 Mar 2016 06:11:12 +0000 https://tecadmin.net/?p=9993 Magento 2 is latest version available of the popular eCommerce software Magento. In previous tutorial you got details about Magento2 installation on Linux. This tutorial will help you to update Magento 2 database configuration file. The previous Magento versions’ uses app/etc/local.xml database configuration file. The Magento2 keep database configuration under app/etc/env.php file. Magento 2 Database [...]

The post Magento 2 Database Configuration File appeared first on TecAdmin.

]]>
Magento 2 is latest version available of the popular eCommerce software Magento. In previous tutorial you got details about Magento2 installation on Linux.

This tutorial will help you to update Magento 2 database configuration file. The previous Magento versions’ uses app/etc/local.xml database configuration file. The Magento2 keep database configuration under app/etc/env.php file.

Magento 2 Database Configuration File

To change your Magento 2 database server hostname, database username, password or database name, you need to edit below file.

/Magento2 Install Dir/app/etc/env.php

Navigate to your Magento 2 installation directory and edit app/etc/env.php configuration file in your favorite editor and search for following settings and do necessary changes.


  'db' =>
  array (
    'table_prefix' => '',
    'connection' =>
    array (
      'default' =>
      array (
        'host' => 'localhost',
        'dbname' => 'database_name',
        'username' => 'database_username',
        'password' => 'database_password',
        'active' => '1',
      ),
    ),
  ),

Now update the orange highlighted values as following

  • localhost : MySQL server hostname.
  • database_username : MySQL user to connect database server.
  • database_password : MySQL user password .
  • database_name : MySQL database name of magento.

Conclusion

In this tutorial, you have learned to update database configuration on Magento2 application.

The post Magento 2 Database Configuration File appeared first on TecAdmin.

]]>
https://tecadmin.net/magento-2-database-configuration-file/feed/ 4