Build LNMP environment on raspberry pie

Build Nginx+MariaDB+PHP7.0 environment on the third generation B model of Raspberry Pie.

Nginx

First, download the source code of Nginx/PCRE/OpenSSL. The download process will not be described. PCRE needs version 1. x, OpenSSL does not need the fips version. After downloading, unzip it. I operate in the/tmp directory.

First install PCRE, enter the PCRE source directory, and execute/ Configure. If there are no errors, execute make&&sudo make install. After completion, enter the Nginx source code directory and execute the command

./configure – prefix=/etc/nginx – with pcre=/pcre source code directory – sbin path=/usr/sbin/nginx – with http_ssl_module – with openssl=/openssl source code directory
These parameters mean: – prefix is the installation directory of Nginx, – sbin path is the location of Nginx initiator, and – with http_ssl_module is used to install the SSL module.

Then execute make&&sudo make install. After installation, execute sudo nginx - v to view the Nginx version.

PHP

PHP 7.0 is installed here. Modify the source list first. Sudo vim/etc/opt/sources.list, add a line:

deb http://mirrordirector.raspbian.org/raspbian/  stretch main contrib non-free rpi
Then create a file sudo vi/etc/opt/preferences, and add the following:

Package: *
Pin: release n=jessie
Pin-Priority: 600
Execute sudo apt get update to update the source. The installation is ready to begin

sudo apt-get install -t stretch php7.0 php7.0-curl php7.0-gd php7.0-fpm php7.0-cli php7.0-opcache php7.0-mbstring php7.0-xml php7.0-zip

After installation, execute php - v to view the version.

MySQL/MariaDB

Here, I install MariaDB in the same way as MySQL, using the apt get command. You can execute the following command to find the version that can be installed

sudo apt-cache search mariadb
After finding the required version, directly use the sudo apt get install command to install it.

So far, the Web running environment has been configured.

course

How can Linux prevent the automatic upgrade of the system kernel Kernel to avoid unnecessary troubles

2018-5-26 8:27:39

course

Raspberry pie as web server (nginx, Apache)

2018-5-26 8:41:12

0 replies A Author M administrators
    There is no discussion yet. Tell me your opinion
search