SAIN3 "Magento + Nginx + Memcached + PHP" Package (HVM)

User Guide

 

We provide this product because some customers requested such a software bundle including Magento, Nginx and Memcached, and we have optimized it with MariaDB and HipHop Virtual Machine (HHVM).

 

1.Nginx

Nginx is a high performance, open source web application accelerator that helps over 37% of the world’s busiest websites deliver more content, faster, to its users. Companies deploy Nginx to manage the complexities and pitfalls associated with HTTP and to make their web applications more responsive, scalable, fast and secure. Nginx is commonly installed between the network and the application to offload concurrency processing, URL switching, HTTP load balancing, SSL termination, caching, and security policies.

 

  • memc nginx module

An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.

https://github.com/openresty/memc-nginx-module

 

  • srcache nginx module

Transparent subrequest-based caching layout for arbitrary nginx locations.

https://github.com/openresty/srcache-nginx-module

 

 

2.Memcached

Originally, this package uses memcached for magento caching and nginx web pages caching, so that you can safely use Flush Cache Storage button to fully clear the cache.

 

 

3. MariaDB

MariaDB is an enhanced, drop-in replacement for MySQL.

 

 

4. PHP & HipHop Virtual Machine (HHVM)

HipHop Virtual Machine (HHVM) is an open-source virtual machine designed for executing programs written in Hack and PHP by using a just-in-time (JIT) compilation approach to achieve superior performance. HHVM installed in this AMI supports high performance Magento. As an accelerator, it improves response times as well as the conversion rate, which is good for your business.

 

5.Webmin

Webmin is a web-based system configuration tool for Unix-like systems. With it, it is possible to configure operating system internals, such as users, disk quotas, services or configuration files, as well as modify and control open source apps. If you want to manage MariaDB through the Web page, Webmin is the right tool for you.

 

 

Usage instructions

 

**Important Info**

Before you start to access the system, please make sure the "Status Checks" of the instance in AWS Console turns to "2/2 checks passed", or the initialization process might be interrupted and fails. It takes about 5-10 mins.

 

**Default Settings**

1.Webmin / MariaDB:

Username: root

Password: <instance ID>

2. Magento:

Username: admin

Password: <instance ID>

 

** Step 1 : Initial Configuration **

1.Visit http://<public IP>.

2.Enter your instance ID and click “Continue”.

3.(Optional) Enter your password for the "admin" user of Magento.

4.Click “Submit” to save your initial configuration.

 

** Step 2 : Access the System**

1. Visit your Magento frontend.

http://<public IP>

2. Admin interface.

http://<public IP>/admin

Username: admin, password: <instance ID> or the one you chose.

3. Webmin is at http://<public IP>:10000.

Username: root, password: <instance ID>.

4. You can manage MariaDB through Webmin.

Login to webmin-> Servers-> MySQL Database Server.

Username: root, password: <instance ID>.

Please note that MariaDB Database Server has been installed and is working properly. As you can see the database version is 10.1.8 which is the current version for MariaDB.

 

Replace the <public IP> above with the actual IP address of the running EC2 instance.

 

 

**Clear Cache & Session**

1.FYI.

If you are using a small instance type, we highly recommend you to frequently clear the cache as small instances have insufficient resources. Low performance instances may lead to a webmin crash, a database crash or a Cannot Allocate Memory error. So we recommend the higher performance instance types.

 

2. Login to your magento admin panel and clear cache & session.

We highly recommend using Flush Cache Storage button if you do not configure memcached for other applications except magento.

Originally, this package uses memcached for magento caching and nginx web pages caching, so that you can safely use Flush Cache Storage button to fully clear the cache.

 

3. There is another way to clear cache & session. Open a terminal or SSH client, using your Amazon EC2 SSH public key, SSH into the instance as the ubuntu user using the public IP information for your instance.

Type the following commands:

$ telnet localhost 11211     #First command.

flush_all    # This is the second command, then you can see OK.

quit    #Leave telnet

 

 

** For your info **

By default, Nginx is installed in /usr/local/nginx.

Nginx DocumentRoot directory: "/var/www"

Nginx configuration file: "/usr/local/nginx/conf/nginx.conf"

Nginx logs directory: "/usr/local/nginx/logs"

Nginx user: www-data

Nginx bash commands: sudo /etc/init.d/nginx {start/stop/restart/status}

 

 

** How do I know Nginx is successfully processing PHP **

Please visit http://<public IP>/info.php.

If you can see that the web page successfully shows the information of PHP, it means Nginx is successfully processing PHP with HHVM. After that, please delete the info.php in /var/www for security.

 

 

** Oops, PHP web page is blank **

Please make sure the Nginx configuration file /usr/local/nginx/conf/nginx.conf includes the following code in the “ location ~ \.php$ ” part:

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

 

 

** Cannot Access to Webmin**

1. After the "Status Checks" of the instance in AWS Console turns to "2/2 checks passed" can you start to access the system, or the initialization process might be interrupted and fails.

2.Make sure port 10000 is in your security group.

Type: Custom TCP Rule

Protocol: TCP

Port range: 10000

Source: 0.0.0.0/0