Breaking News
Home / How To / How to install ExpressionEngine CMS with Nginx on FreeBSD 12

How to install ExpressionEngine CMS with Nginx on FreeBSD 12

ExpressionEngine is a mature, flexible, secure, free open source content management system (CMS) written in PHP. Its source code is hosted on Github. With ExpressionEngine, you can build websites with full functionality, create a web app or serve content to mobile applications. All without requiring complex programming skills. This guide guides you through the ExpressionEngine installation process on a recent FreeBSD 12 with PHP, MariaDB as a database and Nginx as a web server.


ExpressionEngine requires a web server running PHP and MySQL / MariaDB. The recommended software bundle and versions are:

  • PHP version 7.0 or later, run with PHP-FPM and with the following PHP extensions ( gd fileinfo intl mbstring ).
  • MySQL version 5.6 or later or Percona version 5.6 or later. This tutorial will use MariaDB.
  • A web server such as Nginx or Apache. This tutorial will use Nginx.
  • An operating system running FreeBSD 1
  • A user who does not have root with sudo privileges.

I will use the domain name in this tutorial. Replace the word with your own domain name wherever it appears in the commands and configuration files below (especially in the Nginx configuration file and let's encrypt the commands).

Initial steps

Check your FreeBSD version: 19659012] uname -ro
# FreeBSD 12.0-RELEASE

Set time zone:


Update your operating system packages (software) . This is an important first step as it ensures that you have the latest updates and security fixes for your operating system's standard software packages:

  freebsd-update fetch install 
pkg update && pkg upgrade -y

Install some important packages necessary for basic administration of the FreeBSD 12.0 operating system:

  pkg install -y sudo vim unzip wget bash socat 

Install PHP

Install PHP, as well as necessary PHP extensions:

   sudo pkg install -y php72 php72-mbstring php72-tokenizer php72-pdo php72-pdo_mysql php72-openssl php72-hash php72-json php72-phar php72-filter php72-zlib php72-dom php72-xmlp72-xmlp72 xmlreap phml -ctype php72-iconv php72-gd php72-simplexml php72-zip php72-filter php72-tokenizer php72-calendar php72-fileinfo php72-intl php72-phar php72-soap php72-900ml 19659013] To view PHP compiled in modules can you run: 

   php -m 

. . .
. . .

Check PHP version:

   php - version  # PHP 7.2.16 (cli) (built: April 30, 2019 8:37:17 PM) (NTS) 
# Copyright (c) 1997-2018 PHP Group
# Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies
# with Zend OPcache v7.3.5, Copyright (c) 1999-2018 , by Zend Technologies

Starting and activating PHP-FPM service:

   sudo sysrc php_fpm_enable = yes 
sudo service php-fpm start

Install MariaDB

Install MariaDB database server: [19659016] sudo pkg install -y mariadb102-client mariadb102 server

Check MariaDB version:

  mysql - version 
# mysql Ver 15.1 Distrib 10.2.23-MariaDB, for Linux (x86_64 ) with readline 5.1

Starting and activating MariaDB service:

   sudo sysrc mysql_enable = "yes" 
sudo service mysql server start

Run mysql_secure installation scr ipt to improve MariaDB security and set the password for MariaDB root user:

  sudo mysql_secure_installa answers [19659015:

  Do you want to set the VALIDATE PASSWORD plugin?  N 
New password: your_secure_password
Enter new password: your_secure_password
Remove anonymous users? [Y/n] Y
Remove root login remotely? [Y/n] Y
Remove the test database and access it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Connect to MariaDB shell as root user:

   sudo mysql -u root -p 
# Enter password

Create an empty MariaDB database and users for Shopware and remember references:

  mysql> CREATE DATABASE dbname; 
mysql> GRANT ALL ON dbname. * TO & # 39; username & # 39; IDENTIFIED OF & # 39; password & # 39 ;;

Exit from MariaDB :

  mysql> exit 

Replace dbname username and password with your own names.

Installing the client and obtaining Let & # 39; s Encrypt Certificate (optional)

Securing your website with HTTPS is not necessary, but it is a good practice to secure your website traffic. To get a TLS certificate from Let & # 39; s Encrypt, we will use the client. is a pure Unix shell software to obtain TLS certificates from Let & # 39; s Encrypt with zero dependency.

Download and install pkg install -y

Check version: - version 
# v2.8.2

Get RSA and ECC / ECDSA certificate for your domain / host name:

  # RSA 2048 - question - standalone -d - key length 2048
# ECDSA - query - standalone -d - key length ec-256

If you want to submit false certificates for testing to - staging flag to the above commands.

After running the above commands, your certificates and keys will be in:

  • For RSA : / home / username / directory.
  • For ECC / ECDSA : / home / username /example.com_ecc Chapter19459011] directory.

To list your issued certificates you can run: [19659012] --list

Create a directory to store your certificates. We will use a directory / etc / letsencrypt.

  mkdir -p /etc/letsecnrypt/ Chapter19659077vardsudo mkdir -p /etc/letsencrypt/example.com_eccebrit19659013????19459027??Install/ copy certificate to    / etc / letsencrypt    directory 19659079].  

  # RSA --install-cert -d - cert-file /etc/letsencrypt/ --key-file / etc / letsencrypt / --fullchain-file /etc/letsencrypt/ - -reloadcmd "sudo systemctl reload nginx.service"
# ECC / ECDSA - install-cert -d --ecc --cert-file /etc/letsencrypt/example.com_ecc/ cert.pem --key-file /etc/letsencrypt/example.com_ecc/private.key --fullchain-file /etc/letsencrypt/example.com_ecc/fullchain.pem --reloadcmd "sudo systemctl reload nginx.service" [19659013] All certificates are automatically renewed every 60 days.

After obtaining certs exit from root users and return to normal sudo users:


Install Nginx

Install NGINX web server:

  sudo pkg install - y nginx 

Check NGINX version:

  nginx -v 
# nginx version: nginx / 1.14.2

Start and enable NGINX service:

  sudo sysrc nginx_enable = yes 
sudo service nginx start

Configure Nginx for ExpressionEngine by running: [19659012] sudo vim /usr/local/etc/nginx/expressionengine.confebrit19659013achteTo fill the file with the following configuration:

  server {

listen 443 ssl; listen 80; server name; root / usr / local / www / expressionengine; # RSA
ssl_certificate /etc/letsencrypt/; Greece 19459017 vardssl_certificate_key /etc/letsencrypt/;strong19459017??# ECDSA
ssl_certificate etc / letsencrypt / example.com_ cancer;
ssl_certificate_key /etc/letsencrypt/example.com_ecc/; Chapter19459017] index index.php; location / { index index.php; try_files $ uri $ uri / @ee; } location @ee { write about ^ (. *) /index.php?$1 last; } location ~ * .php $ { fastcgi_pass; include fastcgi_params; fastcgi_index index.php5; fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name; } }

Run sudo vim /usr/local/etc/nginx/nginx.confebrit19459011] and add the line below to block http {} to include Shopware configuration.

  include expressionEngine.conf;  

Check Nginx configuration for syntax errors:

   sudo nginx -t  

Reload Nginx service:

  sudo service nginx reload 


Create a document root directory where ExpressionEngine should be located:

  sudo mkdir -p / usr / local / www / expressionengine 

Navigate to the document root directory:

  cd / usr / local / www / expressionengine [19659015DownloadthelatestversionofExpressionEngineandunzipthefilestoafolderonyourserver:

  sudo wget -O - reference & # 39; https: // ? ACT = 243 & # 39; vud19459017 ?? sudo unzip 
sudo rm

Change the ownership of / usr / local / www / expressionengine directory to www:

  sudo chown -R www: www / usr / local / www / expressionengine 

Point your web browser sare to URL to admin.php file you uploaded. For example: . Follow the on-screen instructions to install ExpressionEngine. When the installation wizard is complete, you should rename or remove the system / ee / installer / directory from your server.

Complete the ExpressionEngine installation

Complete the ExpressionEngine installation by entering the database and administrator account details:

  Administrator account settings

Then you will see the default login page:

  First login 37 This is the ExpressionEngine administration panel: </p>
<p style=  ExpressionEngine Dashboard

And here is the front page:

  Website in ExpressionEngine CMS

That's it! The ExpressionEngine installation is complete.

Source link