Magento 2




Use Redis for session storage (Magento 2)

Use Redis for session storage (Magento 2)

Magento 2
Prerequisite Before you continue, install Redis. You can use Redis for session storage in Magento versions...
Read More
Use Redis for the Magento page and default cache

Use Redis for the Magento page and default cache

Magento 2
Use Redis for the Magento page and default cache Prerequisite Before you continue, install Redis. Configure...
Read More
How to detect and clean malware from your Linux server using Maldet

How to detect and clean malware from your Linux server using Maldet

Magento 2
How to detect and clean malware from your Linux server using Maldet Click the link...
Read More
Installing Magento 2 With Composer

Installing Magento 2 With Composer

Magento 2
Click the link to go to the site: GO TO THE LINKED SITE Installing Magento 2...
Read More
How to install Magento 2

How to install Magento 2

Magento 2
When installing Magento 2 on your machine you should ask yourself: Do I need more...
Read More
How to enable/disable the demo store notice in Magento

How to enable/disable the demo store notice in Magento

Magento 2
Magento 2.x and newer: Go to Content and under Design, choose Configuration. Select the store view that you want...
Read More
Magento 2.x: Configure Sandbox Authorize.net

Magento 2.x: Configure Sandbox Authorize.net

Magento 2
Magento 2.x: Configure Sandbox Authorize.net Click the link to read the article: Read the article ===...
Read More
How to Create & Edit Email Templates in Magento 2

How to Create & Edit Email Templates in Magento 2

Magento 2
How to Create & Edit Email Templates in Magento 2 Click the link to read...
Read More
Beginner’s Guide to Installing Magento 2 using Composer

Beginner’s Guide to Installing Magento 2 using Composer

Magento 2
Beginner’s Guide to Installing Magento 2 using Composer Written by Jack Fuller - Published on August 11, 2015...
Read More
1 2 3 5
Use Redis for session storage (Magento 2)
Magento 2

Use Redis for session storage (Magento 2)

Prerequisite

Before you continue, install Redis.

You can use Redis for session storage in Magento versions 2.0.6 and later only.

Configure Magento to use Redis for session storage

Following is a sample configuration to add to <your Magento install dir>app/etc/env.php:

'session' =>
array (
  'save' => 'redis',
  'redis' =>
  array (
    'host' => '127.0.0.1',
    'port' => '6379',
    'password' => '',
    'timeout' => '2.5',
    'persistent_identifier' => '',
    'database' => '2',
    'compression_threshold' => '2048',
    'compression_library' => 'gzip',
    'log_level' => '1',
    'max_concurrency' => '6',
    'break_after_frontend' => '5',
    'break_after_adminhtml' => '30',
    'first_lifetime' => '600',
    'bot_first_lifetime' => '60',
    'bot_lifetime' => '7200',
    'disable_locking' => '0',
    'min_lifetime' => '60',
    'max_lifetime' => '2592000'
  )
),

where

Parameter Meaning Default value
host Fully qualified hostname, IP address, or absolute path if using UNIX sockets. 127.0.0.1
port Redis server listen port. 6379
password Specifies a password if your Redis server requires authentication. empty
timeout Connection timeout, in seconds. 2.5
persistent_identifier Unique string to enable persistent connections (for example, sess-db0).

Known issues with phpredis and php-fpm.

empty
database Unique Redis database number, which is recommended to protect against data loss.

Important: If you use Redis for more than one type of caching (for example, page cache and session cache), the database numbers must be different.

0
compression_threshold Set to 0 to disable compression (recommended when suhosin.session.encrypt = On).

Known issue with strings of more than 64KB.

2048
compression_library Options: gziplzflz4 or snappy. gzip
log_level Set to any of the following, listed in order from least verbose to most verbose:

  • 0 (emergency: only the most severe errors)
  • 1 (alert: immediate action required)
  • 2 (critical: application component unavailable)
  • 3 (error: runtime errors, not critical but must be monitored)
  • 4 (warning: additional information, recommended)
  • 5 (notice: normal but significant condition)
  • 6 (info: informational messages)
  • 7 (debug: the most information for development or testing only)
1
max_concurrency Maximum number of processes that can wait for a lock on one session. For large production clusters, set this to at least 10% of the number of PHP processes. 6
break_after_frontend Number of seconds to wait before trying to break the lock for frontend (that is, storefront) session. 5
break_after_adminhtml Number of seconds to wait before trying to break the lock for an adminhtml (that is, Magento Admin) session. 30
first_lifetime Lifetime, in seconds, of session for non-bots on the first write, or use 0 to disable. 600
bot_first_lifetime Lifetime, in seconds, of session for bots on the first write, or use 0 to disable. 60
bot_lifetime Lifetime, in seconds, of session for bots on subsequent writes, or use 0 to disable. 7200
disable_locking Disable session locking entirely. false
min_lifetime Minimum session lifetime, in seconds. 60
max_lifetime Maximum session lifetime, in seconds. 2592000 (720 hours)

Basic verification

To verify that Redis and Magento are working together, use the following commands:

Redis monitor command

In a command prompt on the server on which Redis is running, enter:

redis-cli monitor

Refresh your storefront page and you’ll see output similar to the following.

Session storage

If you use Redis for session storage, you’ll see output similar to the following:

1476824834.187250 [0 127.0.0.1:52353] "select" "0"
1476824834.187587 [0 127.0.0.1:52353] "hmget" "sess_sgmeh2k3t7obl2tsot3h2ss0p1" "data" "writes"
1476824834.187939 [0 127.0.0.1:52353] "expire" "sess_sgmeh2k3t7obl2tsot3h2ss0p1" "1200"
1476824834.257226 [0 127.0.0.1:52353] "select" "0"
1476824834.257239 [0 127.0.0.1:52353] "hmset" "sess_sgmeh2k3t7obl2tsot3h2ss0p1" "data" "_session_validator_data|a:4:{s:11:\"remote_addr\";s:12:\"10.235.34.14\";s:8:\"http_via\";s:0:\"\";s:20:\"http_x_forwarded_for\";s:0:\"\";s:15:\"http_user_agent\";s:115:\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36\";}_session_hosts|a:1:{s:12:\"10.235.32.10\";b:1;}admin|a:0:{}default|a:2:{s:9:\"_form_key\";s:16:\"e331ugBN7vRjGMgk\";s:12:\"visitor_data\";a:3:{s:13:\"last_visit_at\";s:19:\"2016-10-18 21:06:37\";s:10:\"session_id\";s:26:\"sgmeh2k3t7obl2tsot3h2ss0p1\";s:10:\"visitor_id\";s:1:\"9\";}}adminhtml|a:0:{}customer_base|a:1:{s:20:\"customer_segment_ids\";a:1:{i:1;a:0:{}}}checkout|a:0:{}" "lock" "0"

... more ...

Page caching

If you use Redis for page caching, you’ll see output similar to the following:

1476826133.810090 [0 127.0.0.1:52366] "select" "1"
1476826133.816293 [0 127.0.0.1:52367] "select" "0"
1476826133.817461 [0 127.0.0.1:52367] "hget" "zc:k:ea6_GLOBAL__DICONFIG" "d"
1476826133.829666 [0 127.0.0.1:52367] "hget" "zc:k:ea6_DICONFIG049005964B465901F774DB9751971818" "d"
1476826133.837854 [0 127.0.0.1:52367] "hget" "zc:k:ea6_INTERCEPTION" "d"
1476826133.868374 [0 127.0.0.1:52368] "select" "1"
1476826133.869011 [0 127.0.0.1:52369] "select" "0"
1476826133.869601 [0 127.0.0.1:52369] "hget" "zc:k:ea6_DEFAULT_CONFIG_CACHE_DEFAULT__10__235__32__1080MAGENTO2" "d"
1476826133.872317 [0 127.0.0.1:52369] "hget" "zc:k:ea6_INITIAL_CONFIG" "d"
1476826133.879267 [0 127.0.0.1:52369] "hget" "zc:k:ea6_GLOBAL_PRIMARY_PLUGIN_LIST" "d"
1476826133.883312 [0 127.0.0.1:52369] "hget" "zc:k:ea6_GLOBAL__EVENT_CONFIG_CACHE" "d"
1476826133.898431 [0 127.0.0.1:52369] "hget" "zc:k:ea6_DB_PDO_MYSQL_DDL_STAGING_UPDATE_1" "d"
1476826133.898794 [0 127.0.0.1:52369] "hget" "zc:k:ea6_RESOLVED_STORES_D1BEFA03C79CA0B84ECC488DEA96BC68" "d"
1476826133.905738 [0 127.0.0.1:52369] "hget" "zc:k:ea6_DEFAULT_CONFIG_CACHE_STORE_DEFAULT_10__235__32__1080MAGENTO2" "d"

... more ...

1476826210.634998 [0 127.0.0.1:52439] "hmset" "zc:k:ea6_MVIEW_CONFIG" "d" "a:18:{s:19:\"design_config_dummy\";a:4:{s:7:\"view_id\";s:19:\"design_config_dummy\";s:12:\"action_class\";s:39:\"Magento\\Theme\\Model\\Indexer\\Mview\\Dummy\";s:5:\"group\";s:7:\"indexer\";s:13:\"subscriptions\";a:0:{}}s:14:\"customer_dummy\";a:4:{s:7:\"view_id\";s:14:\"customer_dummy\";s:12:\"action_class\";s:42:\"Magento\\Customer\\Model\\Indexer\\Mview\\Dummy\";s:5:\"group\";s:7:\"indexer\";s:13:\"subscriptions\";a:0:{}}s:13:\"cms_page_grid\";a:4:{s:7:\"view_id\";s:13:\"cms_page_grid\";s:12:\"action_class\";s:43:\"Magento\\Catalog\\Model\\Indexer\\Category\\Flat\";s:5:\"group\";s:7:\"indexer\";s:13:\"subscriptions\";a:1:{s:8:\"cms_page\";a:3:{s:4:\"name\";s:8:\"cms_page\";s:6:\"column\";s:7:\"page_id\";s:18:\"subscription_model\";N;}}}s:21:\"catalog_category_flat\";a:4:{s:7:\"view_id\";s:21:\"catalog_category_flat\";s:12:\"action_class\";s:43:\"Magento\\Catalog\\Model\\Indexer\\Category\\Flat\";s:5:\"group\";s:7:\"indexer\";s:13:\"subscriptions\";a:6:{s:23:\"catalog_category_entity\";a:3:{s:4:\"name\";s:23:\"catalog_category_entity\";s:6:\"column\";s:9:\"entity_id\";s:18:\"subscription_model\";N;}s:31:\"catalog_category_entity_decimal\";a:3:{s:4:\"name\";s:31:\"catalog_category_entity_decimal\";s:6:\"column\";s:9:\"entity_id\";s:18:\"subscription_model\";s:71:\"Magento\\CatalogStaging\\Model\\Mview\\View\\Category\\Attribute\\Subscription\";}s:27:\"catalog_category_entity_int\";a:3:{s:4:\"name\";s:27:\"catalog_category_entity_int\";s:6:\"column\";s:9:\"entity_id\";s:18:\"subscription_model\";s:71:\"Magento\\CatalogStaging\\Model\\Mview\\View\\Category\\Attribute\\Subscription\";}s:28:\"catalog_category_entity_text\";a:3:{s:4:\"name\";s:28:\"catalog_category_entity_text\";s:6:\"column\";s:9:\"entity_id\";s:18:\"subscription_model\";s:71:\"Magento\\CatalogStaging\\Model\\Mview\\View\\Category\\Attribute\\Subscription\";}s:31:\"catalog_category_entity_varchar\";a:3:{s:4:\"name\";s:31:\"catalog_category_entity_varchar\";s:6:\"column\";s:9:\"entity_id\";s:18:\"subscription_model\";s:71:\"Magento\\CatalogStaging\\Model\\Mview\\View\\Category\\Attribute\\Subscription\";}s:32:\"catalog_category_entity_datetime\";a:3:{s:4:\"name\";s:32:\"catalog_category_entity_datetime\";s:6:\"column\";s:9:\"entity_id\";s:18:\"subscription_model\";s:71:\"Magento\\CatalogStaging\\Model\\Mview\\View\\Category\\Attribute\\Subscription\";}}}s:24:\"catalog_category_product\";a:4:{s:7:\"view_id\";s:24:\"catalog_category_product\";s:12:\"action_class\";s:46:\"Magento\\Catalog\\Model\\Indexer\\Category\\Product\";s:5:\"group\";s:7:\"indexer\";s:13:\"subscriptions\";a:2:{s:23:\"catalog_category_entity\";a:3:{s:4:\"name\";s:23:\"catalog_category_entity\";s:6:\"column\"

... more ...

Redis ping command

Enter the following command:

redis-cli ping

PONG should be the response.

If both commands succeeded, Redis is set up properly.

More information

redis-cli command reference

Use Redis for the Magento page and default cache
Magento 2

Use Redis for the Magento page and default cache

Use Redis for the Magento page and default cache

Prerequisite

Before you continue, install Redis.

Configure Magento to use Redis for default and page caching

Following is a sample configuration that causes Magento to use Redis for both the default cache (default array) and the full page cache (page_cache array). Magento’s caching is implemented by Magento\Framework\App\CacheInterface.

Add a configuration similar to the following to <your Magento install dir>app/etc/env.php:

'cache' =>
array(
   'frontend' =>
   array(
      'default' =>
      array(
         'backend' => 'Cm_Cache_Backend_Redis',
         'backend_options' =>
         array(
            'server' => '127.0.0.1',
            'database' => '0',
            'port' => '6379'
            ),
    ),
    'page_cache' =>
    array(
      'backend' => 'Cm_Cache_Backend_Redis',
      'backend_options' =>
       array(
         'server' => '127.0.0.1',
         'port' => '6379',
         'database' => '1',
         'compress_data' => '0'
       )
    )
  )
),

where

Parameter Meaning
default, page_cache Specify the segment name to use a particular segment or a default shortcut for all other caches.

The default cache segment enables you to configure all cache segments except for page_cache (the full page cache).

server Absolute URL to your Redis server, or 127.0.0.1 if Redis is installed on the Magento server, or an absolute path to a UNIX socket.
port Redis server listen port
database Required if you use Redis for both the default and full page cache. You must specify the database number of one of the caches; the other cache uses 0 by default.

Important: If you use Redis for more than one type of caching (for example, default cache and page cache), the database numbers must be different.

password Specifies a password if your Redis server requires authentication.
compress_data Required only for the full page cache. Set to 1 to compress the full page cache. Redis chooses a compression algorithm in the following order, based on availability: snappyl4z, or lzf. If none of them available, Redis uses gzip.

Basic verification

To verify that Redis and Magento are working together, use the following commands:

Redis monitor command

In a command prompt on the server on which Redis is running, enter:

redis-cli monitor

Refresh your storefront page and you’ll see output similar to the following.

Session storage

If you use Redis for session storage, you’ll see output similar to the following:

1476824834.187250 [0 127.0.0.1:52353] "select" "0"
1476824834.187587 [0 127.0.0.1:52353] "hmget" "sess_sgmeh2k3t7obl2tsot3h2ss0p1" "data" "writes"
1476824834.187939 [0 127.0.0.1:52353] "expire" "sess_sgmeh2k3t7obl2tsot3h2ss0p1" "1200"
1476824834.257226 [0 127.0.0.1:52353] "select" "0"
1476824834.257239 [0 127.0.0.1:52353] "hmset" "sess_sgmeh2k3t7obl2tsot3h2ss0p1" "data" "_session_validator_data|a:4:{s:11:\"remote_addr\";s:12:\"10.235.34.14\";s:8:\"http_via\";s:0:\"\";s:20:\"http_x_forwarded_for\";s:0:\"\";s:15:\"http_user_agent\";s:115:\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36\";}_session_hosts|a:1:{s:12:\"10.235.32.10\";b:1;}admin|a:0:{}default|a:2:{s:9:\"_form_key\";s:16:\"e331ugBN7vRjGMgk\";s:12:\"visitor_data\";a:3:{s:13:\"last_visit_at\";s:19:\"2016-10-18 21:06:37\";s:10:\"session_id\";s:26:\"sgmeh2k3t7obl2tsot3h2ss0p1\";s:10:\"visitor_id\";s:1:\"9\";}}adminhtml|a:0:{}customer_base|a:1:{s:20:\"customer_segment_ids\";a:1:{i:1;a:0:{}}}checkout|a:0:{}" "lock" "0"

... more ...

Page caching

If you use Redis for page caching, you’ll see output similar to the following:

1476826133.810090 [0 127.0.0.1:52366] "select" "1"
1476826133.816293 [0 127.0.0.1:52367] "select" "0"
1476826133.817461 [0 127.0.0.1:52367] "hget" "zc:k:ea6_GLOBAL__DICONFIG" "d"
1476826133.829666 [0 127.0.0.1:52367] "hget" "zc:k:ea6_DICONFIG049005964B465901F774DB9751971818" "d"
1476826133.837854 [0 127.0.0.1:52367] "hget" "zc:k:ea6_INTERCEPTION" "d"
1476826133.868374 [0 127.0.0.1:52368] "select" "1"
1476826133.869011 [0 127.0.0.1:52369] "select" "0"
1476826133.869601 [0 127.0.0.1:52369] "hget" "zc:k:ea6_DEFAULT_CONFIG_CACHE_DEFAULT__10__235__32__1080MAGENTO2" "d"
1476826133.872317 [0 127.0.0.1:52369] "hget" "zc:k:ea6_INITIAL_CONFIG" "d"
1476826133.879267 [0 127.0.0.1:52369] "hget" "zc:k:ea6_GLOBAL_PRIMARY_PLUGIN_LIST" "d"
1476826133.883312 [0 127.0.0.1:52369] "hget" "zc:k:ea6_GLOBAL__EVENT_CONFIG_CACHE" "d"
1476826133.898431 [0 127.0.0.1:52369] "hget" "zc:k:ea6_DB_PDO_MYSQL_DDL_STAGING_UPDATE_1" "d"
1476826133.898794 [0 127.0.0.1:52369] "hget" "zc:k:ea6_RESOLVED_STORES_D1BEFA03C79CA0B84ECC488DEA96BC68" "d"
1476826133.905738 [0 127.0.0.1:52369] "hget" "zc:k:ea6_DEFAULT_CONFIG_CACHE_STORE_DEFAULT_10__235__32__1080MAGENTO2" "d"

... more ...

1476826210.634998 [0 127.0.0.1:52439] "hmset" "zc:k:ea6_MVIEW_CONFIG" "d" "a:18:{s:19:\"design_config_dummy\";a:4:{s:7:\"view_id\";s:19:\"design_config_dummy\";s:12:\"action_class\";s:39:\"Magento\\Theme\\Model\\Indexer\\Mview\\Dummy\";s:5:\"group\";s:7:\"indexer\";s:13:\"subscriptions\";a:0:{}}s:14:\"customer_dummy\";a:4:{s:7:\"view_id\";s:14:\"customer_dummy\";s:12:\"action_class\";s:42:\"Magento\\Customer\\Model\\Indexer\\Mview\\Dummy\";s:5:\"group\";s:7:\"indexer\";s:13:\"subscriptions\";a:0:{}}s:13:\"cms_page_grid\";a:4:{s:7:\"view_id\";s:13:\"cms_page_grid\";s:12:\"action_class\";s:43:\"Magento\\Catalog\\Model\\Indexer\\Category\\Flat\";s:5:\"group\";s:7:\"indexer\";s:13:\"subscriptions\";a:1:{s:8:\"cms_page\";a:3:{s:4:\"name\";s:8:\"cms_page\";s:6:\"column\";s:7:\"page_id\";s:18:\"subscription_model\";N;}}}s:21:\"catalog_category_flat\";a:4:{s:7:\"view_id\";s:21:\"catalog_category_flat\";s:12:\"action_class\";s:43:\"Magento\\Catalog\\Model\\Indexer\\Category\\Flat\";s:5:\"group\";s:7:\"indexer\";s:13:\"subscriptions\";a:6:{s:23:\"catalog_category_entity\";a:3:{s:4:\"name\";s:23:\"catalog_category_entity\";s:6:\"column\";s:9:\"entity_id\";s:18:\"subscription_model\";N;}s:31:\"catalog_category_entity_decimal\";a:3:{s:4:\"name\";s:31:\"catalog_category_entity_decimal\";s:6:\"column\";s:9:\"entity_id\";s:18:\"subscription_model\";s:71:\"Magento\\CatalogStaging\\Model\\Mview\\View\\Category\\Attribute\\Subscription\";}s:27:\"catalog_category_entity_int\";a:3:{s:4:\"name\";s:27:\"catalog_category_entity_int\";s:6:\"column\";s:9:\"entity_id\";s:18:\"subscription_model\";s:71:\"Magento\\CatalogStaging\\Model\\Mview\\View\\Category\\Attribute\\Subscription\";}s:28:\"catalog_category_entity_text\";a:3:{s:4:\"name\";s:28:\"catalog_category_entity_text\";s:6:\"column\";s:9:\"entity_id\";s:18:\"subscription_model\";s:71:\"Magento\\CatalogStaging\\Model\\Mview\\View\\Category\\Attribute\\Subscription\";}s:31:\"catalog_category_entity_varchar\";a:3:{s:4:\"name\";s:31:\"catalog_category_entity_varchar\";s:6:\"column\";s:9:\"entity_id\";s:18:\"subscription_model\";s:71:\"Magento\\CatalogStaging\\Model\\Mview\\View\\Category\\Attribute\\Subscription\";}s:32:\"catalog_category_entity_datetime\";a:3:{s:4:\"name\";s:32:\"catalog_category_entity_datetime\";s:6:\"column\";s:9:\"entity_id\";s:18:\"subscription_model\";s:71:\"Magento\\CatalogStaging\\Model\\Mview\\View\\Category\\Attribute\\Subscription\";}}}s:24:\"catalog_category_product\";a:4:{s:7:\"view_id\";s:24:\"catalog_category_product\";s:12:\"action_class\";s:46:\"Magento\\Catalog\\Model\\Indexer\\Category\\Product\";s:5:\"group\";s:7:\"indexer\";s:13:\"subscriptions\";a:2:{s:23:\"catalog_category_entity\";a:3:{s:4:\"name\";s:23:\"catalog_category_entity\";s:6:\"column\"

... more ...

Redis ping command

Enter the following command:

redis-cli ping

PONG should be the response.

If both commands succeeded, Redis is set up properly.

More information

redis-cli command reference

How to detect and clean malware from your Linux server using Maldet
Magento 2

How to detect and clean malware from your Linux server using Maldet

How to detect and clean malware from your Linux server using Maldet

Click the link to the article page:

=============

What is Malware?

Malware is the short form of Malicious Software. Any software that is introduced into your system/server with the malicious intent of disrupting the smooth operation of your server, to collect sensitive private information or to gain access to your system is malware.

How can you recognize the presence of malware?

You may or may not recognize that there is a malware attack on your system for a long time. Sometimes, your readers may report a warning from an anti-virus software like this.

Sometimes, Google Webmasters or Bing Webmasters will report it.

Either way, when you are alerted of malware, the first step would be to secure your system. Cleaning up may be futile if your system is not secure. So, secure first. Take backups of your files and databases. Change all passwords and then go on to cleaning the system of malware.

Most importantly, you need not wait to react after a malware attack. You can set up malware scanning as a regular check proactively so as to be able to catch them as soon as possible.

Linux Malware Detect (LMD)

Linux Malware Detect (LMD), popularly known as Maldet is an open-source malware scanner for Linux released under the GNU GPLv2 license. It is designed around the threats faced in shared hosted environments. Install, configure and run this free software to detect and clean malware on your system.

Install maldet and configure

Installation

Login as root or an account with root permissions into your server.

The source code of the current stable version of LMD or maldet is available as a tar ball at this link. Download it.

    sudo wget http://www.rfxn.com/downloads/maldetect-current.tar.gz

Unpack the tar ball.

    sudo tar -xvf maldetect-current.tar.gz

After this, list the files to see the directory in which it is installed. The directory is usually of the format maldetect-x.y.z where x.y.z is the version number. Change to this directory.

    cd maldetect-1.5

Check if the install.sh script is there and run it.

    sudo ./install.sh

The installation is complete.

Configuration

For configuring maldet, the configuration file at /usr/local/maldetect/conf.maldet has to be edited.

Open it with a text editor.

The following are some of the common options that you may want to set.

If you want to be alerted of the presence of malware by mail, set the following options.

  • email_alert : If you want to get email alerts whenever a suspicious file is detected, then it should be set to 1.
  • email_addr : The email address to which alerts should be sent. This is used in conjunction with the email_alert option.
  • email_ignore_clean : When malware alerts have been automatically cleaned (check the next two options), ignore sending email alerts. This is disabled by default. Set it to 1 to enable it, if you have set up an automated daily scan that detects and cleans the hits and you do not want to be alerted of these by mail.

What action should be taken on the affected files? The following options can be set to quarantine (to move the affected files to a secure location where they cannot produce any harm) the files.

  • quarantine_hits : The default value is 0. Set this to 1 so that the affected files will be moved to quarantine.
  • quarantine_clean : The default value is 0. This is used when quarantine_hits is set to 1. Do you want the system to further clean the files? Set this to 1 if you want the system to try to clean the malware injections. Keep this as zero if you want to inspect before cleaning.

In a multi-user environment, the following options may be useful.

  • quarantine_suspend_user : By default, this is disabled and set to 0. If you set this to 1, the accounts of users who have hits will be suspended. For this to work, quarantine_hits should be 1.
  • quarantine_suspend_user_minuid : The minimum user id which can be suspended. This is set to 500 by default.
  • inotify_minuid : The minimum user id above which users need to be monitored. The default value is 500 (more details here).
  • inotify_docroot : The web directory relative to the home directory of users. By default, it is set to public_html. If this is set, only this web directory will be monitored.

Save and close the configuration file.

Scanning and its options

A basic scan

For a basic scan, run maldet with the --scan-all option with a path as an argument. It first builds a list of files in all the directories and sub-directories in that path. Then it scans through all the files and gives the number of hits. It also gives a report which you can view to inspect the files that are suspicious. Make sure that you give the full path and not the relative path.

    sudo maldet --scan-all /home/username/public_html/

A note of caution, though. The setting scan_ignore_root in the configuration file is set to 1 by default. This causes files that are owned by root to be ignored in the file list that maldet builds. The default value is more efficient, but the assumption is that your root password has not been compromised and malware are not injected into root-owned files. Change this setting to 0 if you want root-owned files also to be scanned. This might slow down the scan. So, use it judiciously.

You can view the files that are affected by opening the report file mentioned.

Quarantine affected files

When quarantine_hits is set to 1, maldet not only scans for malware, but also moves the hits to a quarantine so that your users do not have access to these files. So, your malware scan may produce results as below. In this case, quarantine_clean is set to 0.

If you view the report, you can see the affected files and their quarantine location. You can inspect the files and then decide on whether you want to clean them.

If you performed a scan with the quarantine_hits set to 0, you need not set it to 1 and redo the scan (as shown above). Instead, you could quarantine all malware results from the previous scan with

sudo maldet –quarantine SCANID

Quarantine and clean affected files

When quarantine_clean is set to 1, in addition to moving the affected files to quarantine, maldet also tries to clean them.

If you did a scan with the quarantine_hits or quarantine_clean set to 0, you can do a clean with the following option.

    sudo maldet –clean SCANID

Restore a file

If you want to restore a file which was wrongly tagged as a malicious and quarantined, or if you have manually cleaned the file and want it back in its proper location,

    sudo maldet –restore FILENAME

Alternately, give the complete path of the quarantined file.

    sudo maldet –restore /usr/local/maldetect/quarantine/FILENAME

Wildcard scan

You can also use wildcards in your scan path. ? is the wildcard character.

    sudo maldet --scan-all /home/?/public_html/

This would check all directories inside /home and if any of them had a public_html sub-directory, then that directory will be scanned completely.

Recent scan

If you want to scan the same path as a previous scan, but only those files created or modified in the recent past, you have to run maldet with the --scan-recent option and the number of days n

    sudo maldet --scan-recent /home/username/public_html/ 7

A weekly incremental check can be done by doing such a recent scan for 7 days.

Automate periodic scan

You can automate daily scans using the cronjob feature. During installation, LMD installs a cronjob at /etc/cron.daily/maldet.

This cronjob (an automated job that runs periodically) will update signatures, include new malware threats in its registry and perform a daily scan of all the home directories and recent changes on the server. Whenever, it detects some malware, it will notify you at the mail address specified in the configuration.

Monitor mode

The inotify monitor can be used to monitor users real-time for file creation, modification or movement. Monitoring can be done with one or more of the three options available,

Monitor users

The users option will take the home directories of all users in the system who have uid greater than inotify_minuid and monitor them. If inotify_docroot is set, the users’ web directory, if it exists, will only be monitored.

    sudo maldet --monitor users

Monitor paths

Alternately, you can monitor paths. Give a comma separated list of paths with the --monitor option.

    sudo maldet --monitor PATH1,PATH2,...PATHN

For example,

    sudo maldet --monitor /tmp,/home,/var

Monitor files

If you have concerns about specific files, you can monitor specific files by giving a comma-separated list of files.

    sudo maldet --monitor FILE1,FILE2,...FILEN

Exclude files or paths

Certain paths or files can be excluded from scan, by using the ignore files.

Add files or paths to be excluded (one per line) from daily scan in /usr/local/maldetect/ignore_paths

Add signatures to be excluded (one per line) from daily scan in /usr/local/maldetect/ignore_sigs

Add files or paths to be excluded from inotify monitoring (one per line) in /usr/local/maldetect/ignore_inotify.

Add the extensions of file types that you want to exclude from daily scans (one per line) in /usr/local/maldetect/ignore_file_ext. Sample entries in file could be

    .png
    .jpg

Check out more options like running maldet in the background and other finer settings by using the help option.

    sudo maldet --help

If you run a self-hosted website, at some point or the other, it is possible for malicious hackers to inject malware into your system. Before that happens, get your system secure and install maldet to keep ahead of such attacks.

(For the purpose of this tutorial, Ubuntu version 14.04 and maldet version 1.5 were used)

Installing Magento 2 With Composer
Magento 2

Installing Magento 2 With Composer

Click the link to go to the site: GO TO THE LINKED SITE

Installing Magento 2 With Composer

Thinking of installing Magento 2 with Composer, but not sure how to do it? Don’t worry, you’re at the right place!

There is official documentation on how to do it, so this is merely an alternate step-to-step guide if you want to skim and not read the entire documentation. We plan to keep this guide updated with newer Magento 2 code drops, so bookmark this page check back from time to time!

Before installing, do check these Magento 2 installation requirements.

Steps on How to Install Magento 2 with Composer

1. Install Composer

You can skip this step if you’ve already installed the Composer. (Windows users have an installer available.)

1.1 Make Composer Globally Available

If you wish, you can additionally install Composer globally so you don’t have to type php/path/to/composer.phar every time. The Windows installer will automatically set up the PATH system variable.

2. Download Magento 2

Run the following command in the root directory.

3. Set Up Permissions

After all the dependencies are retrieved, you should set the correct permissions on the entire Magento 2 installation directory. The official documentation recommends chmod’ing all directories to 700 and all files to a level of 600:

In case you are still facing problems, you are probably logged in under a different user and have to give ownership of the installation directory to the web server user.

4. Create The Database

Given that you already have a MySQL user with the correct permissions, then create an empty database to work with. If you want to, you can also use an existing database and pick a table prefix during the installation process, but that’s not something a lot of people do.

5. Install Magento 2

That’s about it! You can now follow the installation wizard or use the command line.

5.1 Installation Wizard

Just fire up the browser, navigate to the host where you installed Magento 2 and if everything went correctly, you should be redirected to the setup tool.

5.2 Command Line Installer

Magento 2 ships with a command line installer and can be invoked as followed:

The above command should be edited to your needs and executed from the Magento 2 root directory. What follows, is a bit of scrolling text and if everything went correct, you are informed that the installation has been completed.

6. Useful Tip

This tutorial covered the manual installation of Magento via composer. There are many hosting providers that provide Magento installation on a single click. Shared hosting providers use cPanel that have Softaculous which has many Magento versions available as one click.

If you are looking for an optimized, secure hosting provider then Managed hosting providers like Cloudways, Nexcess, MGT-Commerce is better suited.

Currently, Cloudways is offering $25 off on Magento hosting. You can avail this offer by using the Promo Code: MGT25.

 Final words

Hopefully, this is a clear guide on how to install Magento 2 with Composer. Most of this information is simplified and readily available with more depth in the official documentation. In case we missed anything or you’d like to know more about, you can always leave a comment below, and we’ll get back with a solution!

How to install Magento 2
Magento 2

How to install Magento 2

When installing Magento 2 on your machine you should ask yourself:

  • Do I need more problems in my life?

If the answer is Yes, continue reading.

I’ll be installing Magento 2 on my dev machine – Linux Ubuntu 16.04 with

  • Php 7.0.7
  • Mysql 5.7.12
  • Composer 1.1.2

Before continuing, make sure you have all the prerequisites, required for running Magento 2.

I set up one virtual host, to rule them all! That way all my Magento 2 installations will be found by this local link http://m2.loc/2.07/ for you to follow along.

As you may, or may not already know, there are a few ways to install it. I will go through each installation, with and without sample data.

Install from archive file

First and easiest way is to download it from Magento download page
https://www.magentocommerce.com/download

You can choose from few different archive types (zip, tar.gz, tar.bz2) , with and without sample data.
Magento was kind enough to pack with all composer dependencies in the archive, so you don’t have to run Composer.

In this installation Magento core code is stored under /vendor directory and updating is possible through Magento admin.

So next steps are easy, just visit http://m2.loc//2.07/magento-website/ (in my case) and follow Setup Wizard.

Install via Composer

Second, but not the last, is installing Magento via composer. Composer is a tool for dependency management in PHP. To learn more visit this link https://getcomposer.org/doc/00-intro.md

In this installation, Magento core code is also stored under /vendor directory and updating is possible through Magento admin.

First you need authentication keys which can be obtained here, and you will need Magento account to login.
Once logged in, go to “My Access Keys”, enter some descriptive “Name” and generate new set of keys. Magento uses this approach because, in future, extensions you buy from marketplace, will be available to you, through Magento admin interface.

Enter this command in terminal:

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition

When prompted, your public key is username, and private key is password.

After that, Magento is ready for installation. Go through Setup Wizard and install it.

This was without sample data. So to install sample data, navigate to your Magento 2 root directory through terminal, and run the following command:

php bin/magento sampledata:deploy
php bin/magento setup:upgrade

These two commands will update your composer.json file and install sample data. If you get this message, after installing sample data – “Please re-run Magento compile command”, enter the following in terminal:

php bin/magento setup:di:compile

This command will take some time to complete.

Install via GitHub

Third, and the last one, is cloning or downloading release from GitHub repository.
In this installation, I will show you how to avoid setup wizard and install Magento through terminal. But, it is important to mention that in this installation Magento core code is stored under app/code not in vendor/ like in previous two examples.
When you try to update Magento through Admin interface, you will get error that this is a GitHub version and it’s not possible to update. GitHub releases are intended to be used by contributors/developers.

First we must clone Magento repo from here: https://github.com/magento/magento2 or you can download releases on https://github.com/magento/magento2/releases

Create empty directory and run:

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

After deploying has been finished, run:

composer install

Now it’s time to install Magento 2. My setup looks like this:

php -f bin/magento setup:install –base-url=http://m2.loc/2.07/github/ --backend-frontname=admin
--db-host=localhost --db-name=m2git --db-user=root --db-password=inchoo --admin-firstname=Magento
--admin-lastname=User --admin-email=ivan.veres@inchoo.net --admin-user=admin --admin-password=magento123
--language=en_US --currency=USD --timezone=America/Chicago –use-rewrites=1

Change your base-url, db-name, db-password, admin-email, admin-password to match your local setup.
If your visit you local link through browser (http://m2.loc/2.07/github/), Magento 2 should be installed.

If you need sample data, follow along.
In your web root (not magento2) run:

git clone git@github.com:magento/magento2-sample-data.git

Navigate into cloned directory and execute:

php -f dev/tools/build-sample-data.php -- --ce-source="your Magento CE install dir"

This will create symlinks to your Magento 2 installation.
Set ownership and permissions if you are on Linux machine:

chown -R :your web server group name
find . -type d -exec chmod g+ws {} \;

Then you need to clear static files (cache).
Navigate to Magento 2 var/ folder and enter following:

rm -rf cache/* page_cache/* generation/*

In Magento 2 documentation there are no further instructions. However you need to install sample data.

php bin/magento setup:upgrade
php bin/magento setup:di:compile

After that you should have sample data installed.

If you have some problems reference at: http://devdocs.magento.com/guides/v2.0/install-gde/bk-install-guide.html

If this or anything else regarding Magento development confuses you, we will gladly check out your site and offer technical insights on what to improve based on our detailed custom report. Feel free to get in touch!

How to enable/disable the demo store notice in Magento
Magento 2

How to enable/disable the demo store notice in Magento

  • Magento 2.x and newer:

Go to Content and under Design, choose Configuration. Select the store view that you want to configure and click Edit. Under Other Settings, expand the HTML Head section. On the bottom of the page you can set the Display Demo Store Notice to your preference (Yes/No).

Select Save Configuration to save your changes.

Magento 2.x: Configure Sandbox Authorize.net
Magento 2

Magento 2.x: Configure Sandbox Authorize.net

Magento 2.x: Configure Sandbox Authorize.net

Click the link to read the article: Read the article

===

Create a Sandbox Account:

https://developer.authorize.net/hello_world/sandbox/

 

  1. First of all go to your sandbox account in https://sandbox.authorize.net/
  2. Then go to Account > Settings > Api Credentials & Keys. Generate a Transaction Key.
  3. (OPTIONAL) Once you get you API Login ID and your Transaction Key, go to Account > Settings > MD5-Hash and enter any word you want like “codealist”.
  4. Go to Account > Settings > Test Mode and set to Live Mode.

Once you get the API Login ID, Transaction Key and MD5-Hash, you are ready to set it up on Magento.

  1. Log into your Magento Backend
  2. Go to Stores > Configuration > Payment Method > Authorize.net Direct Post
  3. Change “Enabled” to “Yes”
  4. Put your API Login ID, Transaction Key and the Md5 string, in case you set it on sandbox.authorize.net
  5. Change “Test Mode” to “NO”
  6. Change the Gateway URL from https://secure.authorize.net/gateway/transact.dll to https://test.authorize.net/gateway/transact.dll
  7. Save and Clear Cache.
    Screen Shot 2016-12-19 at 15.49.14

And that’s it. Try placing an order with a test Credit Card, for example 4111 1111 1111 111, any CVV and any future expiration date.

How to Create & Edit Email Templates in Magento 2
Magento 2

How to Create & Edit Email Templates in Magento 2

How to Create & Edit Email Templates in Magento 2

Click the link to read the article: Read the article …

=============

Creating and editing email templates in Magento 2 is very similar to the equivalent process in Magento 1. The primary difference between Magento 1 and Magento 2 is that these templates have been renamed from “Transactional Emails” to “Email Templates.” You can still find and customize default Magento 2 email templates as well as add new templates to use for your store. This guide will show you how to view and edit the default templates packaged with Magento 2 as well as how to create new templates to effectively represent your store’s branding and messaging with ease!

Templates Location

You can find Email Templates in the Magento 2 dashboard under Marketing > Email Templates:
Magento 2 Email Template Location

 

In a fresh installation of Magento 2, you won’t see any Email Templates listed in the grid by default. In order to edit or create a template, click Add New Template in the upper right corner.

 

Add New Email Template Button

 

Editing a Default Email Template

In order to edit one of the default, Magento 2 templates first click into the Add New Template page. At the top of the page you will see the Load default template section:

 

The Load Default Email Template Section

 

In order to edit one of the default Magento 2 templates first click into the Add New Template page. At the top of the page you will see the Load default template section:

  • Payment Failed
  • Contact Form
  • Change Email
  • Change Email and Password
  • Forgot Password
  • New Account
  • New Account (Magento/luma)
  • New Account Confirmation Key
  • New Account Confirmed
  • New Account Without Password
  • Remind Password
  • Reset Password
  • Currency Update Warnings
  • Footer
  • Footer (Magento/luma)
  • Header
  • Subscription Confirmation
  • Subscription Success
  • Unsubscription Success
  • Cron Error Warning
  • Price Alert
  • Stock Alert
  • Credit Memo Update
  • Credit Memo Update (Magento/luma)
  • Credit Memo Update for Guest
  • Credit Memo Update for Guest (Magento/luma)
  • Invoice Update
  • Invoice Update (Magento/luma)
  • Invoice Update for Guest
  • Invoice Update for Guest (Magento/luma)
  • New Credit Memo
  • New Credit Memo (Magento/luma)
  • New Credit Memo for Guest
  • New Credit Memo for Guest (Magento/luma)
  • New Invoice
  • New Invoice (Magento/luma)
  • New Invoice for Guest
  • New Invoice for Guest (Magento/luma)
  • New Order
  • New Order (Magento/luma)
  • New Order for Guest
  • New Order for Guest (Magento/luma)
  • Order Update
  • Order Update (Magento/luma)
  • Order Update for Guest
  • Order Update for Guest (Magento/luma)
  • Shipment Update
  • Shipment Update (Magento/luma)
  • Shipment Update for Guest
  • Shipment Update for Guest (Magento/luma)
  • Send Product Link to Friend
  • Sitemap Generation Warnings
  • Forgot Admin Password
  • User Notification
  • Wish List Sharing

Depending on your store’s setup you may see additional templates in this dropdown- this is because different themes and extensions may add new templates to accommodate additional functionality. Any of these templates can be edited in the same manner as default Magento 2 templates.

Once you have selected the template you wish to edit click “Load Template” and you will see the Template Subject and Template Content fields populated with the default values:

 

New Template Subject and Content Fields

 

Give your new template a descriptive title to differentiate it from the default template. At this point you can edit any of the HTML and CSS values in the subject or content sections, as well as add any content not included in the default.

You can also add or edit variables to Email Templates from this page. Magento variables are snippets of code which pull specific pieces of information from various locations within Magento into a template to enhance the customization and tailoring of your Email Templates. The “{{var customer.name}}” variable, for example, will pull in a registered customer’s name and display it within the email to make your store’s communications more personalized.

You can add a variable to any Email Template by placing your cursor in the location you would like to add the variable and clicking “Insert Variable…”

 

Email Template Insert Variable

 

These are the variables you can add to any template with default Magento 2:

  • Base Unsecure URL | {{config path=”web/unsecure/base_url”}}
  • Base Secure URL | {{config path=”web/secure/base_url”}}
  • General Contact Name | {{config path=”trans_email/ident_general/name”}}
  • General Contact Email | {{config path=”trans_email/ident_general/email”}}
  • Sales Representative Contact Name | {{config path=”trans_email/ident_sales/name”}}
  • Sales Representative Contact Email | {{config path=”trans_email/ident_sales/email”}}
  • Custom1 Contact Name | {{config path=”trans_email/ident_custom1/name”}}
  • Custom1 Contact Email | {{config path=”trans_email/ident_custom1/email”}}
  • Custom2 Contact Name | {{config path=”trans_email/ident_custom2/name”}}
  • Custom2 Contact Email | {{config path=”trans_email/ident_custom2/email”}}
  • Store Name | {{config path=”general/store_information/name”}}
  • Store Phone Number | {{config path=”general/store_information/phone”}}
  • Store Hours | {{config path=”general/store_information/hours”}}
  • Country | {{config path=”general/store_information/country_id”}}
  • Region/State | {{config path=”general/store_information/region_id”}}
  • Zip/Postal Code | {{config path=”general/store_information/postcode”}}
  • City | {{config path=”general/store_information/city”}}
  • Street Address 1 | {{config path=”general/store_information/street_line1″}}
  • Street Address 2 | {{config path=”general/store_information/street_line2″}}

*Note that different Email Templates may display different variables depending on their purpose. The Email Template for New Account, for example, also includes these variables:

  • Customer Account URL | {{var this.getUrl($store, ‘customer/account/’)}}
  • Customer Email | {{var customer.email}}
  • Customer Name | {{var customer.name}}

In the same way that an extension or theme may add new Email Templates to your store’s arsenal, they may also add new variables which can be used to enhance your customer experience.

Click on the variable you would like to add and you will see it automatically populate in your cursor’s location.

Depending on the template you are editing and your knowledge of HTML and CSS you may want to view the email template you are editing in plain text format- you can do this by clicking “Convert to Plain Text” in the page header:

 

View Template in Plain Text

 

This action removes all HTML tags from the Template Content field which can make the content easier to read as it only leaves the template variables and plain text. This is what a template may look like with all HTML and CSS content in place:

 

Plain Text Template Content

 

And this is what the same template looks like when converted to plain text:

 

Same Template Plain Text

 

As you can see the actual content is much easier to read and understand with the tags stripped which allows you to quickly and efficiently find specific pieces of information that you’d like to edit. You can then click “Return HTML Version” to restore the stripped tags to the template.

It should be noted that changes are not saved when switching back and forth between “Convert to Plain Text” and “Return HTML Version,” so it is not recommended that you make any changes while viewing the plain text version.

Clicking “Reset” in the page header will erase any changes you have made and return you to the blank New Template page.

You can preview your changes to an email template at any point by clicking the “Preview Template” button. This opens a preview of the email in a new tab which allows you to make changes and test them before saving the template.

It is possible to add CSS styles to the email template in the Template Styles field at the bottom of the New Template page, however, we generally recommend avoiding housing your styles in this field as certain email clients will not pick up this CSS which will result in your templates displaying improperly. To make sure your email styles appear on as many different email clients as possible it is recommended that you use inline CSS as much as possible.

 

Email CSS Template Styles

 

Once all of your edits have been made to a template, you can save your changes by clicking “Save Template” in the upper right corner of the page.

*Note that any template you are editing which are not the default Header or Footer email templates will not reflect changes to those respective portions of the email unless you remove the following variables from the template:

  • {{template config_path=”design/email/header_template”}}
  • {{template config_path=”design/email/footer_template”}}

How to Use New or Edited Email Templates

Once you have created a new template or edited a default template you must navigate to Stores > Configuration to actually utilize the template. If you aren’t sure where the settings are for your particular email template, you can often find this by loading in the default Magento template on the New Template page and looking for the “Currently Used For” section which displays the configuration path to the setting you need to change:

 

EmailTemplateInformation

 

Once you navigate to the appropriate configuration tab for your template, you can swap templates by selecting yours from the drop-down by that particular setting:

 

Email Template Invoice Dropdown Options

 

The two exceptions to these settings residing in Stores > Configuration are the settings for the Header and Footer templates. These can be found under Content > Configuration > Your Theme >Transactional Emails. This tab allows you to set the Header and Footer templates to use as well as define which logo image to use in any Email Template.

Recap

 

Whether you have recently migrated to Magento 2 or you are a new Magento 2 store owner, utilizing simple edits to Magento Email Templates can have a significant impact on your store’s message. Using the tools outlined above you should be able to add or edit Magento 2’s Email Templates with ease, so start improving your brand today!

If you don’t have the HTML and CSS knowledge to build more advanced and technical designs into your Email Templates contact Customer Paradigm today and we will build beautiful templates that will help expand your store’s online presence and branding!

Beginner’s Guide to Installing Magento 2 using Composer
Magento 2

Beginner’s Guide to Installing Magento 2 using Composer

Beginner’s Guide to Installing Magento 2 using Composer

If you’re new to Composer or package managers like Node’s NPM then you’ve got a lot to take in before you start working with Magento 2. You see, Magento 2 is dependent on Composer and all of its package/dependency goodness.

It’s true that Magento and several other developers have written articles detailing what I’m about to go through, but I decided to write this for the absolute beginner with deeper explanation of what is going on throughout the steps – particularly the role of Composer.

STEP 1: SERVER ENVIRONMENT

Magento 2 has new minimum requirements of your LAMP stack. I’m not going to list them here in case they change so please check the Magento 2 documentation for those prerequisites. A Vargrant setup is preferable but MAMP Pro can also work.

STEP 2: COMPOSER

If you’re unaware of what composer is then try this analogy. Composer is exactly like…. a composer. In this case Magento 2 is a musical and the packages installed are the members of the orchestra. Once installed in your project, Composer can be used to manage packages based on its dependency system. You can’t have a live musical without the orchestra and you can’t have Magento 2 without its packages. In both cases the composer is responsible for assembling components to allow the rest to work.

Fire up your command line tool and navigate to an empty folder where you’d like to install your copy of Magento 2. We need to ensure Composer is installed globally on your system so that you don’t have to repeat this step again.

Type the following command to see if composer is installed:

composer -help

If it’s not installed you’ll see the response command not found, which means you need to install Composer. Luckily it’s as simple as running the following two commands:

mv composer.phar /usr/local/bin/composer

The first command installs Composer into your local directory, the second will move the composer.phar file to a directory where it can be accessed globally by your system.

If you run the original command again you should see that Composer is installed and ready:

Install Composer

STEP 3: CLONE MAGENTO 2

To clone Magento CE 2 into your current directory run the Git following command:

It will clone the repo into a magento2 subdirectory, and this should take about 2-3 minutes depending on your broadband speed. Once it’s done run the following command to move into the Magento 2 root directory and checkout the master branch.

cd magento2
git checkout master

In order to work with Composer a project must have a composer.json file within its root directory. If you take a look at the file you’ll see a huge list of Magento 2 package dependencies. I’ve picked out first three below:

  • require: a list of packages (and versions) required by Magento 2. Magento 2 will not install if  any of those package dependencies are not met.
  • require-dev: a list of packages required by Magento 2 for development (includes running units tests, hence why PHPUnit is in there)
  • replace: shows a list of packages that are replaced by Magento 2, which is mostly made up of the main modules that make up the Magento 2 framework – this allows developers to fork specific packages with improved or customised code

To run Composer for the first time and install your packages simply run:

composer install

When upgrades become available you can install future updates by using:

composer update

The beauty is that upgrades will only run if Composer identifies a package’s dependencies can be met meaning the stack should always run smoothly.

Vagrant users should not find this a problem, however you may encounter missing PHP extensions when you install Composer, such as:

  • The requested PHP extension ext-mcrypt * is missing from your system.
  • The requested PHP extension ext-intl * is missing from your system.

For MAMP users, you can get around this by creating a symlink of your system’s PHP version to MAMPs. Firstly find out your PHP location:

which php // returns for example: /usr/bin/php

And then create the symlink:

sudo mv /usr/bin/php /usr/bin/php.bak
sudo ln -s /Applications/MAMP/bin/php/php5.6.10/bin/php /usr/bin/php

When Composer has finished its install you’ll be ready to install Magento. You can do this via command line, with Composer or through the installer interface.

STEP 4: INSTALL MAGENTO 2

The installer interface is better looking than before and it checks your server ‘readiness’ before allowing you to proceed with the install.

Magento Install

Follow the process and once  fully installed you’re ready to go.