Skip to Content
NGINX Unit Cookbook
book

NGINX Unit Cookbook

by Derek DeJonghe
September 2020
Intermediate to advanced
68 pages
1h 12m
English
O'Reilly Media, Inc.
Content preview from NGINX Unit Cookbook

Chapter 6. Application Integration

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, Flask (Python frameworks), and Express (a Node.js framework). A Ruby example is also provided, making use of the common framework Ruby on Rails. 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.

6.1 WordPress

Problem

You need to run WordPress with NGINX Unit.

Solution

To install WordPress, if you haven’t already done so, check the 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 user running the Unit server are able to access the files:

 sudo chown -R wpuser:www-data /var/app/wordpress/ sudo find ...
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 Troubleshooting

Nginx Troubleshooting

Alexey Kapranov
DB2® SQL PL: Essential Guide for DB2® UDB on Linux™, UNIX®, Windows®, i5/OS™, and z/OS®, Second Edition

DB2® SQL PL: Essential Guide for DB2® UDB on Linux™, UNIX®, Windows®, i5/OS™, and z/OS®, Second Edition

Zamil Janmohamed, Clara Liu, Drew Bradstock, Raul Chong, Michael Gao, Fraser McArthur, Paul Yip
Web Site Cookbook

Web Site Cookbook

Doug Addison

Publisher Resources

ISBN: 9781492078555Errata Page