Using ./configure to Build Nginx
To build Nginx, run the ./configure script in the directory just created by
using this command:
Click here to view code image
matthew@seymour:~$ ./configure
This generates the makefile that is used to compile the server code.
Next, run make to compile the server code:
Click here to view code image
matthew@seymour:~$ make
When the compilation is complete, install the server. This may only be done
using admin privileges:
Click here to view code image
matthew@seymour:~$ sudo make install
TIP
It is strongly recommended that you use Ubuntu’s version of Nginx until
you really know what happens at system startup. No “uninstall” option is
available when you install Nginx from source! For the remainder of this
chapter, we assume that you have installed Nginx this way. If you install
from source, you should check the Nginx documentation as there may be
differences from what we describe here.
Configuring the Nginx Server
You can now configure the server. Nginx is most commonly run using virtual
hosts, like what most people do with Apache these days. The process is
similar, with mainly syntax differences.
If you install using the package manager, all configuration files for Nginx are
located in /etc/nginx. The primary configuration file is
/etc/nginx/nginx.conf. Here is an example of that file:
Click here to view code image
user www-data;
worker_processes 1;
# error_log /var/log/nginx/error.log;
events {
worker_connections 1024;