Tag: nginx

How to Configure Let’s Encrypt SSL for Nginx on Ubuntu 18.04

Configuring Let’s Encrypt SSL Cert for Nginx on Ubuntu 18.04

Let’s Encrypt is a certificate authority that provides free SSL certificates that are just as secure as current paid certificates. In this guide we will configure an SSL certificate for Nginx on Ubuntu 18.04.

Prerequisites You should be using a non-root user with sudo privileges as explained in Ubuntu 18.04 Initial Server Setup. You should also have Nginx already installed and serving web pages before continuing with this guide. Please see Installing Nginx on Ubuntu 18.04. Cloudflare Users: Note that you don’t need Let’s Encrypt and can instead use Cloudflare’s own shared Universal SSL certificate and…

Continue reading Configuring Let’s Encrypt SSL Cert for Nginx on Ubuntu 18.04

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()

cURL is a PHP extension used to transfer data to or from a remote server. If the extension is not installed on your web server, you may get a fatal PHP error about an undefined function curl_init().

Shared Hosting If you are on shared hosting and do not have command line access to your web server, you may have to contact your web host to see if they support the cURL PHP extension. Many web hosts disable this extension by default for security reasons but may enable it manually for you on…

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 Cloudflare Users: Note that you don’t need Let’s Encrypt and can instead use Cloudflare’s own shared Universal SSL certificate and an Origin CA. If you…

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