Nginx

From Training Material
Revision as of 17:24, 24 November 2014 by Cesar Chew (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


title
Nginx
author
Sam Bashton (NobleProg Ltd)

What is nginx? ⌘

  • Extremely fast HTTP server
  • Easily scales to tens of thousands of requests/second
  • Event driven, asynchronous architecture

Installing ⌘

  • Nginx is not included with RHEL
  • Official nginx yum repo is available

Adding the nginx yum repo ⌘

  • Replace centos with rhel for Red Hat Enterprise
rpm -Uvh http://nginx.org/packages/centos/5/noarch/RPMS/nginx-release-centos-5-0.el5.ngx.noarch.rpm

Installing nginx ⌘

`yum -y install nginx`

Enabling nginx ⌘

Start the nginx service: `service nginx start` Enable at boot: `chkconfig nginx on`

Configuration Basics ⌘

  • nginx configuration is split into multiple files
  • All take the form of:
```
   <section> {
     <directive> <parameters>;
   }
```

Testing your configuration ⌘

  • You can syntax check your nginx config by running
`service nginx configtest`

Virtual host configuration ⌘

  • Default virtual host configuration at `/etc/nginx/conf.d/default.conf`
  • Points to web root at /usr/share/nginx/html