arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Install nginx, php, mariadb - Ubuntu 14.04
#1
This is a guide how to install stack of software which will allow us to serve dynamic pages.
It includes:
  • NGINX - Web server and proxy
  • PHP FPM -  server side language processor
  • MariaDB - Database server (RDBMS)
1. Update the source lists and the software

sudo apt-get update
sudo apt-get upgrade


2. Install nginx

This will install the Webserver and proxy server nginx which is very light and uses fewer resources than apache.

sudo apt-get install nginx

3. Install PHP Processor

PHP is a server-side scripting language designed primarily for web development but also used as a general-purpose programming language.

sudo apt-get install php5-fpm php5-mysql


4. Install MariaDB
MariaDB is a community-developed fork of MySQL. They have better performance and frequent updates. 


sudo apt-get install mariadb-server mariadb-client


5. Edit nginx configuration

Open the default configuration file

sudo nano /etc/nginx/sites-available/default

Delete everything and paste the following

server {
   listen 80 default_server;
   listen [::]:80 default_server ipv6only=on;

   root /usr/share/nginx/html;
   index index.php index.html index.htm;

   server_name server_domain_name_or_IP;

   location / {
       try_files $uri $uri/ =404;
   }

   error_page 404 /404.html;
   error_page 500 502 503 504 /50x.html;
   location = /50x.html {
       root /usr/share/nginx/html;
   }

   location ~ \.php$ {
       try_files $uri =404;
       fastcgi_split_path_info ^(.+\.php)(/.+)$;
       fastcgi_pass unix:/var/run/php5-fpm.sock;
       fastcgi_index index.php;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       include fastcgi_params;
   }
}

Replace server_domain_name_or_IP with your domain name or IP and the root with root path of your website.

That would be it. Now you are ready to create your dynamic website.


Messages In This Thread
Install nginx, php, mariadb - Ubuntu 14.04 - by Neco - 12-02-2016, 02:36 PM


person_pin_circle Users browsing this thread: 2 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting