Skip to Content
NGINX Unit Cookbook
book

NGINX Unit Cookbook

by Derek DeJonghe
July 2019
Intermediate to advanced
50 pages
44m
English
O'Reilly Media, Inc.
Content preview from NGINX Unit Cookbook

Chapter 6. Application Integration

Introduction

To provide examples of serving real-world applications with NGINX Unit, this chapter will demonstrate step-by-step setups of some common application frameworks. In this chapter you will learn how to serve WordPress, a common PHP content management system. You will also learn how to serve applications based in common frameworks such as Django (a Python framework) and Express (a Node.js framework). This chapter will demonstrate how to install applications onto a system and ensure that they have the correct file permissions and the configuration of NGINX Unit needed to serve them.

WordPress

Problem

You need to run WordPress with NGINX Unit.

Solution

To install WordPress, if you haven’t already done so, check prerequisites to ensure that you have the necessary requirements. Next, configure the WordPress database. Then download and extract the WordPress files:

sudo mkdir /var/app/
sudo cd /var/app/
sudo wget https://wordpress.org/latest.tar.gz
sudo tar xzvf latest.tar.gz

In this example, the WordPress files will be stored in /var/app/wordpress/.

Update the wp-config.php file with your database settings and other customizations.

Set the user file permissions for WordPress to ensure that the user that owns the PHP processes and the NGINX web server is able to access the files:

sudo chown -R wpuser:www-data /var/app/wordpress/
sudo find /var/app/wordpress/ -type d -exec chmod g+s {} \; sudo chmod g+w /var/app/wordpress/wp-content ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

NGINX Unit Cookbook

NGINX Unit Cookbook

Derek DeJonghe
Nginx Troubleshooting

Nginx Troubleshooting

Alexey Kapranov
Spring 5.0 Cookbook

Spring 5.0 Cookbook

Sherwin John C. Tragura

Publisher Resources

ISBN: 9781492054313