Install Nginx on EC2 Ubuntu instance

Fire up an EC2 Ubuntu instance

 

Connect via SSH as user ‘ubuntu’

 

Add nginx repo

File contents:

Save & close – [Esc] [w] [q] [Enter]

 

Install dev tools

IF:

where xxxxxxxxxxxxxxxx is a 16 digit hex code like 00A6F0A3C300EE8C THEN:

 

Install build tools for compiling

 

Create sources dir

 

Download and extract zlib ( http://www.zlib.net/ )

 

Download and extract OpenSSL ( http://www.openssl.org/ )

 

Download and extract PCRE ( http://www.pcre.org/ )

 

Install dependencies

 

Download and install Nginx ( http://nginx.org/ )

Note that 2>&1 | tee ~/sources/{file}.log logs the output to a file in your user’s home directory (on EC2 likely /home/ubuntu/) while still outputting to the console.

Now we can compile the installer. Warning – this is one LOOOONG-ass make…

If make fails with:

Nginx needs patching:

This means the lines ending in libssl.a and libcrypto.a need .openssl/lib/ removed from them.
To do this:

Navigate to and edit the code. Save and close. Run make again.

And finally, we can install:

3 thoughts on “Install Nginx on EC2 Ubuntu instance”

Leave a Reply

Your e-mail address will not be published. Required fields are marked *


Warning: mysqli_query(): MySQL server has gone away in /var/sites/b/blog.absolutedisaster.co.uk/public_html/wp-includes/wp-db.php on line 2007

Warning: mysqli_query(): Error reading result set's header in /var/sites/b/blog.absolutedisaster.co.uk/public_html/wp-includes/wp-db.php on line 2007