• Call: 1-73222-666-55

Install Magento2 in Nginx Server Using Command Line



Installing magento2 in Ubuntu 14.04 with Nginx web server.



Version 5.5.X or more

Required PHP extensions:








gd2, ImageMagick 6.3.7 (or later) or both



2.Mysql 5.6.X


 Create basic nginx configuration file for magento2.

# vim /etc/nginx/sites-available/magantositename

Add the following configuration files in nginx,



server {

listen 80;

 root /var/www/magento2; #Use you mangeto2 location

index index.php index.html index.htm;

 server_name yuor_magento.siteurl;

#location / {

#try_files $uri $uri/ /index.php?q=$uri&$args;


   location /setup {

       try_files $uri $uri/ @setuphandler;


# Rewrite Setup’s Internal Requests

   location @setuphandler {

       rewrite /setup /setup/index.php;


    location / {

       index index.php index.html;

       try_files $uri $uri/ @handler;


    # Rewrite Internal Requests

    location @handler {

       rewrite / /index.php;


     location /pub/static {

         try_files $uri $uri/ @static;


     location @static {

          rewrite ^/pub/static/(.*)$ /pub/static.php?resource=$1? last;


 error_page 404 /404.html;

 error_page 500 502 503 504 /50x.html;

location = /50x.html {

root /usr/share/nginx/www;


#pass the PHP scripts to f stcgi socket

location ~ \.php$ {

               try_files $uri =404;

               fastcgi_pass unix:/var/run/php5-fpm.sock;

               fastcgi_index index.php;

               fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

               include fastcgi_params;

               fastcgi_read_timeout 900s;

#Magento 2 Developer Mode

               fastcgi_param MAGE_MODE “developer”;






create a symlink in /etc/nginx/sites-enable/magantositename

 # ln -s /etc/nginx/sites-available/magantositename /etc/nginx/sites-enable/magantositename


Restart PHP handler php5-fpm and nginx

 #  service php5-fpm restart

 # service nginx restart 

Create database and database user for magento2

login to mysql using root user and password:

#  mysql -u root -p

## mysql> CREATE DATABASE <magentodbname>;

## mysql>  GRANT ALL ON <magentodbname>.* FROM magentodb@localhost IDENTIFIED BY <magentodbpasswd>;


Steps to install Magento2

 Change the directory where to download and install Magento2.

 # cd /var/www/

 Download the magento2 zip file from github

 # wget https://github.com/magento/magento2/archive/develop.zip

 # unzip develop.zip

# mv magento2-develop magento2

 Change the ownership to your webserver user name. Typically it is www-data

 # chown -R www-data:www-data magento2

 # cd magento2

Change the permissions as follows,

 # find . -type d -exec chmod 700 {} \;

# find . -type f -exec chmod 600 {} \;

make the file magento file executable  in the directory bin

# chmod +x bin/magento

Install magento using command line,

# ./bin/magento setup:install –base-url “http://your_site_url/” –db-name “magentodbname” –db-user “magentodb” –db-password “magentodbpasswd” –admin-firstname “yourname” –admin-lastname “yourlastname” –admin-email “your_email” –admin-user “magenoadmi” –admin-password “magentoadminpasswd” –language “en_US” –currency “USD” –timezone “America/Chicago” –use-sample-data –use-rewrites=1


Here you will get your Language, Currency and Time zone using the following magento command.


# ./bim/magento info:language:list


# ./bim/magento info:currency:list

Time Zone:

# ./bim/php magento info:timezone:list

 Once the installation is completed you will get the SUCCESS message at the end of installation.

You can access the magento admin interface using the random  generated URL while installing Magento2.

You can check the URL using magento command line.

# ./bin/magento info:adminuri

 You will get the admin URI as,

Admin URI: /admin_8mdvzn

You can  change the the Admin URI in <your Magento install dir>/app/etc/env.php.

Then you can access admin page as http://yuor_site_url/admin_8mdvzn/




You can access the magento2 home page at the installed URL as http://yuor_site_url.

It will look as below,



Same day essay is the Leading Scripting Writers You Need

So, it is time for you to create your article. Actually, it is not the most painless information to do, so you, possibly, are thinking about buying some immense dissertation online. And it is a superb solution for your problem, actually. There are millions of different Samedayessays.com today. They are of different pattern and scheme. And most of them are surely bad and occasionally even abhorrent. Some services have poor delivery system, but, genuinely immense papers, while others are quick, but, with weak quality. So, we want to give some advice about certainly satisfactory and honest Same-day-essay.com. http://samedayessays.org/ There are some judicious prices, luscious and juicy discounts, clear and strong guarantees, and, of course, big delivery system. The name for the account is Samedayessay and it is undoubtedly satisfactory. There are few main situations to critic the Same day essay. These are usability, performance, prices, and quality. Let’s find out what Same day essay is all about.

First and foremost, you should discern that there are accounts that fit your appeal and project. And this company has them all, actually. You will find here all groups of contentsfor every person of a different value. This account can deal with all types of academic writing. So, you can be sure you will get here the sorts you need.

Performance, Prices, and Quality Investigation

So, the main situation you are going to work with is the account’shomepage, actually. The prime feeling is very cool and smooth. Same Day Essays homepage is very clean and does not have any big and special factors. But, also, it does not represent anything wrong. There is no need to have any upscale tricks for the Same-day-essay.com homepage. There should be no distractions for user. And this paper producing service is easily like that. The next thing you should like in this Same-day-essay.com is its link system. http://samedayessays.org/ Here you have an opportunity to chat to extra support team that works every day. Also, there is regularly a contact for you with your special writer. It means you have definite control over the procedure of writing and whole content formation. You can give your particular instructions to the expert and to regulate the full writing technique. And what is about the scripting team? It is just prodigious, actually. It wholeheartedly subsists of the experts. To be honest, it is just one of the best. These guys will give you utterly great essay that will be delivered on time. The price policy is also very easy and nothing unusual. It is very adequate and altogether matches the quality of the dissertation. Besides that, there are lots of sweet and helpful discounts at Samedayessay. For really great price you will get the best quality thesis you could with some incredible delivery speed. These writers are experts, and they know how to help you anytime and anyplace.

So, the whole view about Same-day-essay.com is very clear. Its homepage is clear and there is nothing illegal in its job. The main subject you should know about this Same day essay is that you will get the best quality article on time for the surely reasonable cost.

Ordering Discounts and New Benefits

Same day essay is the famous crew in the scholarly document marketing. http://samedayessays.org/ In the position when you are seeking for custom-made writing firm, you will probably see various comparable websites. Even so it is irritating to see Same day essay with licensed creators and perfect support Additional key feature wich catches the hypothetical customers is cost and discount strategy. This writing service prices are a little bit costly at the first sign, at the first blush but once you obtain your writing, you recognize that quality of paper is entirely worth the cost. Their clients will make the order depending upon the characteristics, academic leveldegree of text and urgency.

The service has a individual approach to every patron. That’s why the firm applies different technics to make brand-new and regular buyers feel joyful. Ordering for the first time purchasers will use ten percent price reduction on customers direct credit site. Constant customers surely have 5 percent reduction to each brand-new term paper. The custom writing service also gives B-Day and festive reductions. Besides, pupils have an opportunity to get direct contact with your writer and editor, revisions, brain picking control timely carrying, complete secretiveness, free editors corrections, Introductory page and Page with remarks and other offers.

Supported Team and Site Convenience

Same day essay gets down to offering Efficient support to its purchasers so long as purchasers are totally glad with the order project. Twenty-four seven team of supporters can do their best to find the most corresponding creator for clients order, and take into consideration each of purchasers personal requirements as regards to writing project. That is why on service site all clients can very easily look through great number of positive testimonials that shaw the great degree of content with the high quality of work.

Concerning the site, it’s completely easy-in-use, well-designed, and accessible. There is a formatted variant for mobile tools with shortened screen format and light interface. So customers have a possibility to with ease select what they came for and confide to this company as it’s real writing service with skilled workers. To display that patrons are able to have trust in company, the writing service makes mention of not only their email, but also gives true, street address and telephone that buyers have an opportunity to see in the “About Our Bussiness” section.

cloud vendors and interoperability

It’s Phab! That makes your life easier

We have been using plenty of different tools for tracking bugs/product management/project management/to do lists/code review; such as ClearCase, ClearQuest, Bugzilla, Github, Asana, Pivotal Tracker, Google Drive etc. We found Phabricator as a “Too Good To Be True” software engineering web application platform originally developed at Facebook. It has code review, wiki, repository browsing,tickets and a lot more to make Phab more fabulous.

Phabricator is an open source collaboration of web applications which help software companies to build better software. It is a suite of applications. Following are the most important tools in phabricator :
Maniphest – Bug tracker/task management tracker
Diffusion- source code browser
Differential – code review tool that allows developers to easily submit reviews to one another via command line tool when they check in code using Git or Subversion
Phriction – wiki tool

How to setup and configure the code review and project management tool – Phabricator


Server – 4GB Digital ocean droplet
OS – Ubuntu 14.04

1. Install dependencies

apt-get install mysql-server apache2 dpkg-dev php5 php5-mysql php5-gd php5-dev php5-curl php-apc php5-cli php5-json

2. Get code

#cd /var/www/codereview

git clone https://github.com/phacility/libphutil.git

git clone https://github.com/phacility/arcanist.git

git clone https://github.com/phacility/arcanist.git

3. Configure virtual host entry

#add below lines


DocumentRoot /var/www/codereview/webroot
RewriteEngine on
RewriteRule ^/rsrc/(.*) – [L,QSA]
RewriteRule ^/favicon.ico – [L,QSA]
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]

Order allow,deny
allow from all

4. Enable the virtual host entry for phabricator.

# a2ensite phabricator.conf
# service apache2 reload

5. Configure the MySQL database configuration for phabricator

– create database
# /var/www/codereview/phabricator/bin/config set mysql.user mysql_username
# /var/www/codereview/phabricator/bin/config get mysql.pass mysql_password
# /var/www/codereview/phabricator/bin/config get mysql.host mysql_host
# /var/www/codereview/phabricator/bin/config storage upgrade
-tweak mysql

Open /etc/mysql/my.cnf and add the following line under [mysqld] section:


#service mysql restart

Set the Base URI of Phabricator install

# /var/www/codereview/phabricator/bin/config set phabricator.base-uri

(eg: phabricator.your-domain.com)

Configure Outbound Email – External SMTP (Google Apps)

Set the following configuration keys using /var/www/codereview/phabricator/bin/config set value

– metamta.mail-adapter -> PhabricatorMailImplementationPHPMailerAdapter
– phpmailer.mailer -> smtp
– phpmailer.smtp-host -> smtp.gmail.com
– phpmailer.smtp-port -> 465
– phpmailer.smtp-user -> Your Google apps mail id
– phpmailer.smtp-password -> set to your password used for authentication
– phpmailer.smtp-protocol -> ssl

Start the phabricator daemons

You can start all the phabricator deamons using the script
# /var/www/codereview/phabricator/bin/phd start
To start daemons at the boot time, add this entry to the file /etc/rc.local

/var/www/codereview/phabricator/bin/phd start

Diffusion repository hosting with git

1. Install git

#apt-get install git

2. Create a local repository directory:

#mkdir -p /data/repo

3. Edit the repository.default-local-path key to the new local repository directory.

Go to the Config -> Repositories -> repository.default-local-path

4. Configure System user accounts

Phabricator uses as many as three user accounts. These are system user accounts on the machine Phabricator runs on, not Phabricator user accounts.

* daemon-user – The user the daemons run as

We will configure the root user to run the daemons

* www-user – The user the web server run as

We will use www-data to be the web user

* vcs-user – The user that users will connect over SSH as

We will configure git user to the vcs-user

To enable SSH access to repositories, edit /etc/sudoers file using visudo to contain:

#includedir /etc/sudoers.d
git ALL=(root) SETENV: NOPASSWD: /usr/bin/git-upload-pack, /usr/bin/git-receive-pack, /usr/bin/git

Since we are going to enable SSH access to the repository, ensure the following holds good.

– Open /etc/shadow and find the line for vcs-user, git.

The second field (which is the password field) must not be set to !!. This value will prevent login. If it is set to !!, edit it and set it to NP (“no password”) instead.

– Open /etc/passwd and find the line for the vcs-user, git.
The last field (which is the login shell) must be set to a real shell. If it is set to something like /bin/false, then sshd will not be able to execute commands. Instead, you should set it to a real shell, like /bin/sh.

– Use phd.user as our daemon user;
# /var/www/phab/phabricator/bin/config phd.user root
# /var/www/phab/phabricator/bin/config set diffusion.ssh-user git

5. Configuring SSH

We will move the normal sshd daemon to another port, say 222. We will use this port to get a normal login shell. We will run highly restrictive sshd on port 22 managed by Phabricator.

Move Normal SSHD

– make a backup of sshd_config before making any changes.

#cp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup

– Update /etc/ssh/sshd_config, change the port to some othert port like 222.

Port 222

– Restart sshd and verify that you are able to connect to the new port

ssh -p 222 user@host

Configure and start Phabricator SSHD

We now configure and start a second SSHD instance which will run on port 22. This instance will use special locked down configuration that uses Phabricator to handle the authentication and command execution.

– Create a phabricator-ssh-hook.sh file

– Create a sshd_phabricator config file

– Start a copy of sshd using the new configuration

Create phabricator-ssh-hook.sh: Copy the template in phabricator/resources/sshd/ phabricator-ssh-hook.sh to somewhere like /usr/lib/phabricator-ssh-hook.sh and edit it to have the correct settings



# NOTE: Replace this with the username that you expect users to connect with.

# NOTE: Replace this with the path to your Phabricator directory.

if [ “$1” != “$VCSUSER” ];
exit 1

exec “$ROOT/bin/ssh-auth” $@

Make it owned by root and restrict editing;

#sudo chown root /usr/lib/phabricator-ssh-hook.sh
#chmod 755 /usr/lib/phabricator-ssh-hook.sh

Create sshd_config for Phabricator: Copy the template in /phabricator/sshd/sshd_config.phabricator.example to somewhere like /etc/ssh/sshd_config.phabricator

Start Phabricator SSHD

#sudo /usr/sbin/sshd -f /etc/ssh/sshd_config.phabricator

Add this entry to the /etc/rc.local to start the daemon on startup.

If you did everything correctly, you should be able to run this;

#echo {} | ssh git@phabricator.your-company.com conduit conduit.ping

and get a response like this;


You should now be able to access your instance over ssh on port 222 for normal login and administrative purposes. Phabricator SSHD runs on port 22 to handle authentication and command execution.

6. To create a git repository

Go to Diffusion -> New Repository -> Create a New Hosted Repository

Upgrade Phabricator

Since phabricator is under development, you should update frequently. To update phabricator:

– Stop the web server
– Run git pull in libphutil/, arcanist/, and phabricator.
– Run phabricator/bin/storage upgrade.
– Restart the web server.
Also you can use a script similar to this one to automate the process:

Buy Sociology Essays

Thus you should comprehend the need for choosing the best professionals, who can cause you to get possible in realizing your quality providers that are aspired for comprehending the condition of your house. In recent times, folks prefer to get advice from your professionals, as they may be the top individuals, who are able to support quality and reliable solutions to fulfill the requirements of their customers at minimum instances by utilizing their most useful information in the discipline. Therefore, you need to reveal the the reality behind the increasing requirement of some agencies in a place. Read more…

“IAM user, who can write to the S3 bucket”

Here we are to educate ourselves as to what “IAM user, who can write to the S3 bucket” is, by using cloudfront distribution and S3 objects, which are of world readable.

1.Create a bucket in s3 my-bucket

1. Log in to the AWS Management Console

2. Click on s3 tab

3. Create a new bucket

4. Create a custom/aws bucket policy to make it world readable

Read more…

Apache on the Cloud – The things you should know

    LAMP forms the base of most web applications.  As the load on an server increases, the bottlenecks in the underlying infrastructure become more apparent in the form of slow response to user requests.

     To overcome this slow response  the primary choice of most people is to add more hardware resources ( incase of AWS increasing the instance type). This will definitely  increases performance but will cost you more money.  The webserver and database eat most of the resources. Most commonly used web server is apache and database is MySQL. So if we can optimize these two we can improve the performance.

   Apache optimization techniques can often provide significant acceleration boosts  even when other acceleration techniques are in use, such as a CDN.  mod_pagespeed is a module from Google for Apache HTTP Servers that can improve the page load times of your website. you can read more on this from here.  If you want to deploy a PHP app on AWS Cloud, Its better to using some kind of caching mechanism.  Its already discussed in our blog .

      Once we came into a situation where we have to use a micro instance for a web server with less than 500 hits a day

      When the site started running live, and we feel like disappointed. when accessing website, it would sometimes pause for several seconds before serving the requested page. It took  hours to figure out what was going on. finally we run the command top and quickly discovered that when the site was accessing by certain amount of users the CPU would spike, but the spike was not the typical user or system CPU. For testing what’s happening in  server we used the apache benchmark tool ‘ab’ and run the following command on  localhost.

                                             #ab -n 100 -c 10 http://mywebserver.com/

      This will show  how fast our web server can handle 100 requests, with a maximum of 10 requests running concurrently. In the meantime we were monitoring the output of top command on web server.

     For further investigation we started with  sar – Linux command to  Collect, report, or save system activity information

  #sar 1

      According to amazon documentation “Micro instances (t1.micro) provide a small amount of consistent CPU resources and allow you to increase CPU capacity in short bursts when additional cycles are available”.

       If you use 100% CPU for more than a few minutes, Amazon will “steal” CPU time from the instance, meaning that they throttle your instance.  This last  as long as five minutes, and then you get a few seconds of 100% again, then the restrictions are back.  This will effect your website, making it slow, and even timing-out requests. basically means the physical hardware is busy and the hypervisor can’t give the VM the amount of CPU cycles it wants.

   Real tuning required on prefork. This is where we can tell apache to only generate so many processes. The defaults values  are high, and which cant be handled by micro instance. Suppose you get 10 concurrent requests for a php page and require around 64MB of RAM when requested (you have to make sure that  php memory_limit is above that value). That’s around 640MB of RAM on micro instance of 613MB RAM.  This is the case  with 10 connections – apache is configured to allow 256 clients by default,  We need to  scale these down , normally with 10-12 MaxClients. As per out case, this is still a huge number because 10-12 concurrent connections would use all our memory. If you want to be really cautious, make sure that your max memory usage is less than 613MB. Something like 64M php memory limit and 8 max clients keeps you under your limit with space to spare – this helps ensure that our MySQL process when your server is under load.

           Maxclients an important tuning parameter regarding the performance of the Apache web server. We can calculate the value of this for a t1.micro instance


MaxClients =(Total Memory – Operating System Memory – MySQL memory) / Size Per Apache process.

t1.micro have a server with 613MB of Total memory. Suppose We are using RDS instead of mysql server.

Stop apache and run

#ps aux | awk ‘{sum1 +=$4}; END {print sum1}’.

 we will get the amount of memory thats used by processes other than apache.

Suppose we get a value around 30.

from top command we can check the average memory that each apache resources use.

suppose its 60mb.

Max clients = (613 – 30 ) 60 = 9.71 ~ 10 approx …

       Micro instances are awesome, especially when cost becomes a major concern, however that they are not right for all applications. A simple website with only a few hundreds  hits a day will do just fine since it will only need CPU in short bursts.

      For Servers that serves dynamic content, better approach is to employ a reverse-proxy. This would be done this apache’s mod_proxy or Squid. The main advantages of this configurations are content caching, load balancing etc. Easy method is to use mod_proxy and the ProxyPass directive to pass content to another server. mod_proxy supports a degree of caching that can offer a significant performance boost. But another advantage is that since the proxy server and the web server are likely to have a very fast interconnect, the web server can quickly serve up large content, freeing up a apache process, why the proxy slowly feeds out the content to clients

If you are using ubuntu, you can enable module by

                                        #a2enmod proxy

                                        #a2enmod proxy_http    

and in apache2.conf

                                         ProxyPass  /

                                         ProxyPassReverse  /

         The ProxyPassreverse directive captures the responses from the web server and masks the URL as it would be directly responded by the Apache  hiding the identity/location of the web server. This is a good security practice, since the attacker won’t be able to know the ip of our web server.

      Caching with Apache2 is another important consideration.  We can configure apache  to set the Expires HTTP header, max-age directive of the Cache-Control HTTP header of static files ,such as images, CSS and JS files, to a date in the future so that these files will be cached by your visitors browsers. This saves bandwidth and makes web site appear faster if a user visits your site for a second time, static files will be fetched from the browser cache

                                      #a2enmod expires

  edit  /etc/apache2/sites-available/default

  <IfModule mod_expires.c>
               ExpiresActive On
               ExpiresByType image/gif “access plus 4 weeks”
               ExpiresByType image/jpg “access plus 4 weeks”


This would tell browsers to cache .jpg, .gif  files for four week.

       If your server requires a large amount of read / write operations, you might consider provisioned IOPS ebs volumes on your server. This is really effective if you use database server on ec2 instances.  we can use iostat on the command line to take a look at your read/sec and write/sec. You can also use CloudWatch metrics to determine read and write operations.

       Once we move to the security side of apache, our major concern is DDos attacks. If a server is under a DDoS attack, it is quite difficult to detect the attack before the damage is done.  Attack packets usually have spoofed source IP addresses. Hence, it is more difficult to trace them back to their real source. The limit on the number of simultaneous requests that will be served by Apache is decided by the MaxClients directive, and is set to safe limit, by default. Any connection attempts over this limit will normally be queued up.

     If you want to protect your apache against DOS,  DDOS attacks use mod_evasive module.  This module is designed specifically as a remedy for Apache DoS attacks. This module will allow you to specify a maximum number of requests executed by the same IP address. If the limit is reached, the IP address is blacklisted for the time period you specify.