Close

December 3, 2015

Kicking the Magento 2 EE Tires on EC2

Magento 2 was released a few weeks ago and we hadn’t had a chance to review it yet, so we decided to try it out in a sample Amazon EC2 instance. Wasn’t quite as easy as we had expected

We wanted to be able to run everything on a single contained instance just for trial purposes. Since we did not want to setup any additional caching resources (ELB/Redis/Memcache), we needed a beefier EC2 instance that would provide enough horsepower without breaking the bank. C3.large seemed to fit the bill and we would only leave the instance on while testing.

We decided to build an absolute vanilla instance, devoid of any pre-made installs. The least cumbersome instance OS is arguably Amazon’s own Linux. Setting up a LAMP environment usually is not that difficult, however since Magento requires higher levels of PHP and MySQL, this through a few wrinkles into our mix.

The LAMP installation was based on part by Amazon’s own install guide ( Here). The major important difference is that Apache uses the user “apache” and NOT “www”, which is different from the guide.

In their step 3, they showed the entire sequence of events to install the LAMP stack. We switched to using mysql56-server, instead of their 5.5 version.

Everything else went according to the Amazon guide. When the Lamp stack was setup and the fresh copy of Mage2.0 unpacked, the fun really began.

First issue were the required plugins for PHP that needed to be installed in order for Magento to run. We had to make sure that when installing them we used the “php56” name rather than just plain PHP.

For instance to install the GD plugin it was:
sudo yum install php56-gd

(Tip: The ‘int’ plugin is installed with: ‘yum install php56-intl’)

Once those plugins are resolved the next step was resolving file permission issues. Magento’s 2.0 document is very precise and useful and their Guide was very useful in getting the site up and running (Use “apache” user per the CentOS install).

Next came the actual Magento install. This was a bit tricky to figure out, but we would not recommend testing out the site with the sample data. The only way we were able to get it successfully complete was to shut off any memory limits in PHP.ini and remove the max_execution time limits. I’m sure we could have spent hours figuring out the correct configuration, but since this was a limited test instance, it was simplier to just disable them.

The next issue we had was in the webserver configuration itself. By default, Apache does not let you have any “overrides” set for subsequent folders, so none of the .htaccess files that are required by Magento where working. Once we re-configured it to allow overrides, it came right up.

Now that Magento was installed, none of the CSS/JS files were loading. We saw a ton of 404 errors for those file types. Come to find out, we had to “deploy” those files for a production set site. Once we followed this guide, our site came roaring to life.

It was surprisingly fast for not having any additional caching layers enabled. The Magento back-end is a whole new world though.