Kamis, 02 Februari 2017

How To Install As Well As Configure Magento Alongside Nginx Ubuntu 16.04 Lts

Magento:

Magento is the well-nigh pop content administration organisation for e-commerce websites. It is used past times small-scale businesses as well as large enterprise companies alike, as well as tin live enhanced past times thousands of extensions as well as themes. Magento uses the MySQL database system, the PHP programming language, as well as parts of the Zend Framework.


Requirement: 
We required a dedicated server atleast 2GB of Ram alongside Ubuntu 16.04 LTS installed LAMP Stack.
1- Nginx
root@Server16: # apt install nginx

2- PHP

root@Server16: # apt install php7.0-fpm

Other required PHP extensions:
root@Server16: # apt-get install php7.0-mysql php7.0-zip php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache  php7.0-pspell   php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php-gettext php7.0-soap
3- MySQL
root@Server16: # apt install mysql-server

Step 1: Download as well as extract Magento

Download Magento from below mentioned URL:
root@Server16: # wget https://github.com/OpenMage/magento-mirror/archive/magento-1.9.zip
Use ascendency below to extract zip file
root@Server16: # unzip -d /var/www/html/ magento-1.9.zip
Where  

unzip                                        This is a command
-d                                              Extract file into specific directory 
/var/www/html                       Path where Zip volition live extract 

Now rename the folder alongside a uncomplicated call using the ascendency below:
root@Server16: # mv /var/www/html/magento-mirror-magento-1.9/ /var/www/html/magento 

Change Permission using ascendency below:
root@Server16: # chown -R www-data:www-data /var/www/html/magento 

Step 2: Create Server Blocks (Virtual Host) as well as enable it.

Let's configure Nginx Server block using ascendency below:

root@Server16: # vi /etc/nginx/sites-available/magento.conf

And add together the syntax below:

# Default server configuration # server {         brain 80;         brain [::]:80;          # SSL configuration         #         # brain 443 ssl default_server;         # brain [::]:443 ssl default_server;         #         # Note: You should disable gzip for SSL traffic.         # See: https://bugs.debian.org/773332         #         # Read upwards on ssl_ciphers to ensure a secure configuration.         # See: https://bugs.debian.org/765782         #         # Self signed certs generated past times the ssl-cert parcel         # Don't purpose them inwards a production server!         #         # include snippets/snakeoil.conf;          root /var/www/html/magento;          # Add index.php to the listing if y'all are using PHP         index index.php index.html index.htm index.nginx-debian.html;          server_name magento.lan;          place / {                 # First campaign to serve asking every minute file, as well as thus                 # every minute directory, as well as thus autumn dorsum to displaying a 404.                 try_files $uri $uri/ =404;         }  place   .php/ {         rewrite ^(.*.php)/ $1 last;         }           # overstep the PHP scripts to FastCGI server listening on 127.0.0.1:9000         #         place   \.php$ {                 include snippets/fastcgi-php.conf;         #         #       # With php7.0-cgi alone:         #       fastcgi_pass 127.0.0.1:9000;         #       # With php7.0-fpm:                 fastcgi_pass unix:/run/php/php7.0-fpm.sock;         }          # deny access to .htaccess files, if Apache's document root         # concurs alongside nginx's i         #         place   /\.ht {                 deny all;         } }   

Save as well as Exit from file

Now Create a link of Server blocks using ascendency below:
root@Server16: # ln -s /etc/nginx/sites-available/magento.conf /etc/nginx/sites-enabled/magento.conf

Check Nginx configuration as well as restart service:
root@Server16: # nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf exam is successful 
Restart Nginx Using ascendency below
root@Server16: # systemctl restart nginx.service 

Step 3: Create a database as well as assign permission:

Let's Create a database as well as assign permission:
Create Database
mysql> practice database magento;
Create User
mysql> practice user magento@localhost identified past times 'magento';
Assign Perrmission
mysql> grant all privileges on magento.* to magento@'localhost' identified past times 'magento';
Reload permisson
mysql> even out privileges;

Step 4: Finish Magento Installation 

Open browser  hitting domain call as well as follow the pedagogy to complete installation process.


Accept the license agreement























Select Location, TimeZone as well as Default Currency type



















Fill Database Configuration detail, Admin spider web access URL as well as session shop options





































Fill Magento Admin login access details:






























All set, afterwards completing all the steps y'all volition larn the window similar below.

















Magento has been installed successfully, Now y'all tin get-go working alongside Admin panel using link below

http://magento.lan/index.php/admin/

And y'all Frontend volition live looking similar this 




















!!!That's ALL!!!!






Sumber https://linuxhowtoguide.blogspot.com/