- Config requirements system
- Install Nginx + MySQL + PHP-FPM
- Some potentials bugs while installation
- Enable
https
in Nginx
Firstly, we must setup all software that we need. If in Windows, we have XAMPP bundle (it contains Apache, PHP and MySQL), then in Linux, we will use Nginx instead of Apache, PHP-FPM replaces PHP and MySQL doesn't change. One notice is I will use Ubuntu 14.04 to setup all.
- To install Nginx in Ubuntu, open terminal and paste these commands :
sudo apt-get update
sudo apt-get install nginx
- To install MySQl :
sudo apt-get install mysql-server
We need to tell MySQL to generate the directory structure it needs to store its databases and information. We can do this by typing :
sudo mysql_install_db
Next, you'll want to run a simple security script that will prompt you to modify some insecure defaults. Begin the script by typing:
sudo mysql_secure_installation
It is location that you setup password for root account in MySQL.
- Lastly, it is time for PHP-FPM :
sudo apt-get install php5-fpm php5-mysql
Default, Ubuntu will setup PHP 5.5.9, if you want to use PHP 5.6 or PHP 7, change above command like that :
sudo apt-get install php5.6-fpm php5.6-mysql