Install Nginx, MariaDB, PHP7 (LEMP) on Arch Linux Server

Step 1: Update Arch Linux Server

sudo pacman -Syu

Step 2: Install Nginx

older: sudo pacman -S nginx or newer: sudo pacman -S nginx-mainline

See the difference between both above.

Step 3: Install MariaDB

  • sudo pacman -S mariadb
  • follow the hint and do sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
  • follow the hint and do sudo mysql_secure_installation
  • config: cat /etc/mysql/my.cnf

Step 4: Install PHP7

  • sudo pacman -S php-fpm
  • set nginx pass php request to localport or socket

sudo nano /etc/nginx/nginx.conf

location ~ \.php$ {
    root           /usr/share/nginx/html;
    fastcgi_pass   unix:/run/php-fpm/php-fpm.sock;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi_params;
}
  • enable extensions

sudo nano /etc/php/php.ini and enable the following

extension=mysqli.so
extension=pdo_mysql.so

Hint

use systemctl start || status || restart || reload to check process;
use systemctl enable { process } to autostart when boot;

results matching ""

    No results matching ""