Nginx Mariadb Php Fpm Debian8 Mariadb
Introduction to the Setup
Nginx, MariaDB, and PHP are all popular tools for web development. Nginx is a web server, MariaDB is an open-source database system, and PHP is a scripting language. The combination of these three makes for a powerful and versatile environment for web development.
The setup described in this article is for a standard Debian 8 operating system, specifically Jessie. Although other versions of Debian may be used, the instructions below focus on Debian 8.
The tools we will be using are Nginx, MariaDB, and PHP-FPM. Nginx is used for web traffic, MariaDB is used as an SQL database, and PHP-FPM handles the scripting.
Install MariaDB
The first step is to install MariaDB. Debian 8 comes with MariaDB 5.5 preinstalled. To install the latest MariaDB version on Debian 8, run this command in your terminal:
~$ su - apt-get install mariadb-server
You will be prompted to enter the MariaDB root user password. Enter a strong password and then select “y” to confirm the installation.
Once the installation is complete, start the MariaDB server using the following command:
~$ sudo service mysql start
Install Nginx
The next step is to install Nginx. To do this, run the following command in your terminal:
~$ sudo apt-get install nginx
Once the installation is complete, start the Nginx server by running the following command:
~$ sudo service nginx start
Install PHP-FPM
The next step is to install PHP-FPM. Debian 8 comes with PHP 5.6 preinstalled. To install PHP-FPM, run the following command in your terminal:
~$ sudo apt-get install php5-fpm
Once the installation is complete, start the PHP-FPM server using the following command:
~$ sudo service php5-fpm start
Configure Nginx
The next step is to configure Nginx so that it will work correctly with MariaDB and PHP-FPM. To do this, we need to edit the Nginx configuration file. This file is located in the directory “/etc/nginx/sites-enabled/default”.
Open the file using a text editor like nano or vim:
~$ sudo nano /etc/nginx/sites-enabled/default
Ensure that the following lines are present in the configuration file:
- location block for PHP files
- fastcgi_param directive for PHP
- Access log for PHP files
- Error log for PHP files
Save the changes and exit the text editor. Finally, restart the Nginx server:
~$sudo service nginx restart
Test Setup
Now that everything has been installed and configured, we can test the setup to ensure that it is working correctly. To do this, create a simple PHP file in the directory “/var/www/html/”. This directory is the root directory for your web server.
Create the file using a text editor like nano or vim:
~$ sudo nano /var/www/html/index.php
Add the following code to the file:
echo "PHP is working!";
?>
Save the file and exit the text editor. Now, open a web browser and navigate to http://localhost/index.php. You should see the message “PHP is working!”
Conclusion
In this article, we have discussed how to set up a standard Nginx, MariaDB, and PHP-FPM web stack on a Debian 8 system. We discussed the setup and configuration steps, and we tested the setup to verify that it is working properly.
FAQs
Q. What versions of Nginx, MariaDB, and PHP-FPM are supported?
A. This setup has been tested with Nginx 1.10.2, MariaDB 5.5, and PHP-FPM 5.6. It should work with other versions of each if they are compatible with each other.
Q. How can I make sure that my setup is secure?
A. It is important to ensure that any web server setup is secure. Make sure that you are using strong passwords, keep your operating system and software up-to-date, and use a security plugin such as Wordfence for your website.
Q. What other software and libraries can I use with this setup?
A. This setup should work with most software and libraries that are compatible with Nginx, MariaDB, and PHP-FPM. Examples of libraries that you may want to install include ImageMagick and libxml.
Thank you for reading this article. Please read other articles to learn more about web server setup and development.
Related Posts:
- Run Bash From Nginx Config Run Bash From Nginx Config What is Nginx? Nginx is a web server that is free and open source. It is known for its high performance on static content and…
- Docker Workspace See Log Nginx Docker Workspace See Log Nginx Overview Docker containers enable workflows to be created more efficiently, as software can be quickly and easily configured, tested and deployed. This can save valuable…
- Cannot Accept Header Api Lumen Nginx Cannot Accept Header Api Lumen Nginx What is Lumen and What Does it Do? Lumen is a lightweight micro-framework provided by Laravel, developed to provide a high speed and flexible…
- Nginx Cannot Open Php File Nginx Cannot Open Php File What Is Nginx? Nginx is an open source web server that is designed to be fast, secure and reliable web server. It is widely used…
- Can I Install Phpmyadmin In Nginx Can I Install Phpmyadmin In Nginx? PHPmyadmin is a web-based management tool for databases such as MySQL and MariaDB. It is a popular tool for web developers and database administrators…
- Setup Vhost Nginx Debian 9.3 Setup Vhost Nginx Debian 9.3 Introduction This article will provide step-by-step instructions to setup Nginx Virtual Hosts (vhosts) on a Debian 9.3 system. Nginx is a web server software used…
- Ubuntu 18.04 Nginx Hide Port Ubuntu 18.04 Nginx Hide Port Introduction to Nginx with Ubuntu Nginx is an open source web server and reverse proxy software that is commonly used in Linux servers. It is…
- Cara Install Nginx Debian 4.9 Cara Install Nginx Debian 4.9 Introduction Debian 4.9 is a major release of the Debian Linux-based operating system. It is the first major version of the operating system to be…
- Nginx Vs Lighttpd Raspberry Pi Nginx Vs Lighttpd Raspberry Pi How to Choose the Best Web Server for Your Raspberry Pi If you are trying to decide which web server to use on your Raspberry…
- Docker Nginx Load Config From Github Docker Nginx Load Config From Github Overview of Docker Nginx Docker Nginx is an open-source web server created by the Docker Inc. organization. This web server was designed to run…
- Enable Memcached Nginx Debian 9 Enable Memcached Nginx Debian 9 Memcached Basics Memcached is a distributed memory caching system that greatly enhances the performance of network-based applications. It is a great tool that allows data…
- Ubuntu Server Postgresql Nginx Php Digitalocean Laravel Ubuntu Server Postgresql Nginx Php Digitalocean Laravel Introduction To The Stack Ubuntu Server, Postgresql, Nginx, PHP, Digitalocean and Laravel are an exceptional combination of elements that, when put together, make…
- Nginx No Need For Rest Api Django Rest Nginx No Need for Rest API Django Rest Introduction to Nginx Nginx is a open source web server created by Igor Sysoev and released in 2004. Nginx is known for…
- E Unable To Locate Package Nginx E Unable To Locate Package Nginx What is Nginx? Nginx is an open-source web server and reverse proxy that is used for hosting websites, web applications, and other network services.…
- Laravel Nginx 500 Internal Server Error Laravel Nginx 500 Internal Server Error What is a 500 Internal Server Error? A 500 Internal Server Error is an error code returned by the web server when something has…
- Install Nginx And Php Scract In Docker Install Nginx And PHP Script in Docker What is Docker? Docker is a popular platform for creating, running, and managing applications in a lightweight container system. Originally released as an…
- Multi Php Nginx Debian 9 Multi Php Nginx Debian 9: Solusi Terbaik Untuk Server Web Anda Server web adalah bagian penting dari setiap bisnis online dalam hal interaksi dengan pelanggan. Ada banyak faktor yang harus…
- Linux Nginx Mysql Php Lemp Linux Nginx Mysql Php Lemp What is Linux, Nginx, MySQL, PHP (LEMP)? Linux, Nginx, MySQL, PHP (LEMP) is a software stack combination of Linux, Nginx, MySQL, and PHP, commonly referred…
- Create Subdomain Nginx Debian 9 Server Create Subdomain Nginx Debian 9 Server Understanding Subdomain A subdomain is a subsection of a domain that a user can create to host one or more websites, usually for a…
- Making Service Like Nginx Mariadb Runs On Boot Making Service Like Nginx Mariadb Runs On Boot Introduction to Services A service is a software application or package that needs to be running in order for other software applications…
- Install Nginx Phpmyadmin Ubuntu 18.04 Install Nginx Phpmyadmin Ubuntu 18.04 Introduction to Nginx, PHP, and Ubuntu Nginx is an open-source, high-performance web server written in C and used to serve static and dynamic webpages. It…
- Nginx Ssi Inside Ssi Config Nginx SSI Inside SSI Config What is Nginx SSI? Nginx SSI (Server Side Includes) is an Apache web server module that enables users to embed dynamic HTML content into a…
- Error 404 Because Server Nginx 1.14.0 Ubuntu… Error 404 Because Server Nginx 1.14.0 Ubuntu Transfer-Encoding Chunked Introduction to Error 404 Error 404 is a response code indicating that a page or file you have requested cannot be…
- Nginx-Rtmp-Module Apt-Get Nginx-Rtmp-Module Apt-Get What is Nginx-Rtmp-Module? Nginx-Rtmp-Module is an open-source media streaming server software written in C, based on the nginx web server. It provides a design for streaming of audio…
- Install Laravel 5.8 Nginx Php7.3 Install Laravel 5.8 Nginx Php7.3 Overview Installing Laravel 5.8 on a Nginx server running PHP 7.3 can be a tricky task. This tutorial explains how to install the popular open…
- Nginx Angular Config For Development Nginx Angular Config For Development Introduction To Nginx & Angular Nginx and Angular are two of the most popular open source development tools for building modern web applications. In this…
- How To Configure Nginx Debian How To Configure Nginx Debian Introduction to Nginx Debian Nginx is a web server and reverse proxy that is used to host websites and manage incoming traffic over the world…
- Vestacp Following Packages Are Already Installed… Vestacp Following Packages Are Already Installed Vesta Nginx Httpd What is VestaCP? Vesta Control Panel is an open-source hosting control panel, also referred to as VestaCP. It is mostly used…
- Php-Fpm Nginx Ubuntu 18.04 PHP-FPM & Nginx on Ubuntu 18.04 Introduction to PHP-FPM PHP-FPM (FastCGI Process Manager) is an implementation of FastCGI, which is a standard protocol for interfacing external applications with web servers.…
- Install Nginx Php Java On Centos 7 Install Nginx Php Java On Centos 7 What is Nginx? Nginx is an open source Web server created to serve Web traffic efficiently, reliably, and quickly. Nginx has become the…