Tag: nginx

Installing Nginx, MySQL, PHP (LEMP) Stack on Ubuntu 18.04

Installing Nginx, MySQL, PHP (LEMP) Stack on Ubuntu 18.04

Ubuntu Server 18.04 LTS (Bionic Beaver) is finally here and is being rolled out across VPS hosts such as DigitalOcean and AWS. In this guide we will install a LEMP Stack (Nginx, MySQL, PHP) and configure a web server.

Video Tutorial

Prerequisites You should use a non-root user account with sudo privileges. Please see the Initial server setup for Ubuntu 18.04 guide for more details. 1. Install Nginx Let’s begin by updating the package lists and installing Nginx on Ubuntu 18.04. Below we have two commands separated by &&. The first command will update the package lists to ensure you…

Continue reading Installing Nginx, MySQL, PHP (LEMP) Stack on Ubuntu 18.04

Installing PHP for Nginx on Ubuntu 18.04

Installing PHP for Nginx on Ubuntu 18.04

In this guide we will install and configure PHP to work with Nginx on Ubuntu 18.04 LTS (Bionic Beaver). Unlike Apache, Nginx does not contain native PHP processing. For that we have to install PHP-FPM (FastCGI Process Manager). FPM is an alternative PHP FastCGI implementation with some additional features useful for heavy-loaded sites.

1. Install PHP-FPM Let’s begin by updating the package lists and installing PHP-FPM on Ubuntu 18.04. Below we have two commands separated by &&. The first command will update the package lists to ensure you get the latest version and dependencies for PHP-FPM. The second command will then download and install PHP-FPM. Press y and ENTER when asked to…

Continue reading Installing PHP for Nginx on Ubuntu 18.04

Installing Nginx with Multiple Domains on Ubuntu 18.04 Bionic Beaver

Installing Nginx on Ubuntu 18.04 with Multiple Domains

In this guide we will install and configure Nginx on Ubuntu 18.04 LTS (Bionic Beaver). We will also configure some server blocks so we can host multiple domains. Nginx is a free, open-source, high-performance HTTP server. It’s known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.

1. Install Nginx Let’s begin by updating the package lists and installing Nginx on Ubuntu 18.04. Below we have two commands separated by &&. The first command will update the package lists to ensure you get the latest version and dependencies for Nginx. The second command will then download and install Nginx. sudo apt update…

Continue reading Installing Nginx on Ubuntu 18.04 with Multiple Domains

PHP Fatal error: Uncaught Error: Call to undefined function curl_init()

This error indicates that the curl PHP extension is not installed. curl is a tool to transfer data from or to a server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or FILE). The command is designed to work without user interaction. To install the curl extension,…

Continue reading PHP Fatal error: Uncaught Error: Call to undefined function curl_init()

Getting a 404 After Moving WordPress to Nginx

You will need to edit the config file to instruct Nginx to direct requests to index.php. Open your config file. The default location is /etc/nginx/sites-enabled/default, however, if you followed an earlier guide setting up multiple domains in Nginx, your config may be located in /etc/nginx/sites-enabled/example.com. sudo nano /etc/nginx/sites-enabled/default Scroll down to the location / block.…

Continue reading Getting a 404 After Moving WordPress to Nginx

How to Password Protect a Directory in Nginx

In this guide we will set up password authentication for Nginx to password protect a web directory. We will first install apache2-utils, which can generate the .htpasswd file that works with both Nginx and Apache. sudo apt-get install apache2-utils Once installed, we can name generate the .htpasswd file. Simply change username to the username you…

Continue reading How to Password Protect a Directory in Nginx

How to Configure Let’s Encrypt SSL on Nginx (Ubuntu 16.04 / 17.10)

In this guide we will configure Let’s Encrypt SSL on Nginx (Ubuntu 16.04 / 17.10). Prerequisites You should already have your domain(s) configured and working on Nginx and accessible in the browser. If you haven’t configured Nginx yet, please see Guide: Installing Nginx on Ubuntu 16.04 / 17.10 If you are using CloudFlare, it is…

Continue reading How to Configure Let’s Encrypt SSL on Nginx (Ubuntu 16.04 / 17.10)

Nginx error: 413 Request Entity Too Large

If you are trying to upload large files and are seeing this error, it means the client_max_body_size value is too low. Open the nginx configuration file: sudo nano /etc/nginx/nginx.conf It may also be located in /usr/local/nginx/conf/nginx.conf or /usr/local/etc/nginx/nginx.conf. Add the following line within the http block /etc/nginx/nginx.conf http { . . . client_max_body_size 32M; .…

Continue reading Nginx error: 413 Request Entity Too Large

Guide: Installing phpMyAdmin for Nginx on Ubuntu 16.04 / 17.10

In this guide we will install and configure phpMyAdmin to work with Nginx on Ubuntu 16.04 / 17.10. Prerequisites You should be using a non-root user with sudo privileges as explained in Ubuntu 16.04 / 17.10 Initial Server Setup. You should also have your LEMP stack (Nginx, MySQL and PHP) already installed before continuing with…

Continue reading Guide: Installing phpMyAdmin for Nginx on Ubuntu 16.04 / 17.10