12-02-2016, 02:36 PM
This is a guide how to install stack of software which will allow us to serve dynamic pages.
It includes:
2. Install nginx
This will install the Webserver and proxy server nginx which is very light and uses fewer resources than apache.
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.
4. Install MariaDB
MariaDB is a community-developed fork of MySQL. They have better performance and frequent updates.
5. Edit nginx configuration
Open the default configuration file
Delete everything and paste the following
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.
It includes:
- NGINX - Web server and proxy
- PHP FPM - server side language processor
- MariaDB - Database server (RDBMS)
Code: (Select All)
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.
Code: (Select All)
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.
Code: (Select All)
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.
Code: (Select All)
sudo apt-get install mariadb-server mariadb-client
5. Edit nginx configuration
Open the default configuration file
Code: (Select All)
sudo nano /etc/nginx/sites-available/default
Delete everything and paste the following
Code: (Select All)
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.