andreif
Posts: 2
Joined: Sat Jun 29, 2013 2:29 pm

Installing Nginx 1.4.x on Raspberry Pi

Sat Jun 29, 2013 2:43 pm

Hi,

Is it possible to install Nginx 1.4.x on RPi?

I have tried following these guides with no success and I see now that they are wrong:
http://virtualitblog.blogspot.se/2013/0 ... ry-pi.html
http://xn--90aexm.xn--80aahthvfydgg0a.x ... ebian.html

Should I compile Nginx from the source and how straightforward is this?

Thanks,
Andrei

andreif
Posts: 2
Joined: Sat Jun 29, 2013 2:29 pm

Re: Installing Nginx 1.4.x on Raspberry Pi

Sat Jun 29, 2013 11:39 pm

It went OK to compile 1.5.1. Took me a half day and quite a few iterations :)

Heater
Posts: 12613
Joined: Tue Jul 17, 2012 3:02 pm

Re: Installing Nginx 1.4.x on Raspberry Pi

Tue Jul 09, 2013 5:42 am

I have compiled nginx from source a few weeks back. Had to do that because I needed the new feature of proxying websockets.

I don't recall how I did it. Which is good because that means it wasn't any problem:)

If I remember correctly out of the box it will build and install itself to different locations than the Debian package does. If that is a problem for you a quick search around will find you instructions on setting options to get things installed where you want.

elmicha
Posts: 27
Joined: Tue Jul 03, 2012 4:43 pm

Re: Installing Nginx 1.4.x on Raspberry Pi

Tue Feb 04, 2014 8:18 pm

Although this thread is a bit old, I'll add how I compiled nginx-1.4.4 on Raspbian (in a chroot with qemu on my "big" PC, but that shouldn't matter here). I started with this guide and needed only minor changes:

Only add the deb-src line to the apt sources, because there are no armhf binary packages in the nginx repository:

Code: Select all

sudo nano /etc/apt/sources.list.d/nginx.list
and add

Code: Select all

deb-src http://nginx.org/packages/debian/ squeeze nginx
Get the repository's signing key and the build dependencies:

Code: Select all

wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
sudo apt-get update
sudo apt-get build-dep nginx
Go to a directory where the normal user (e.g. pi) can write, get the sources and build them:

Code: Select all

cd ~/src
apt-get source nginx
cd nginx-1.4.4/
dpkg-buildpackage -uc -b
The *.dpkg should land in the ~/src directory (one level up).
Remove the old nginx packages:

Code: Select all

sudo apt-get remove "nginx*"
Press y at the prompt here ONLY if it wants to remove only the nginx packages, otherwise use something like this:

Code: Select all

sudo apt-get remove nginx-common nginx-light
And install the new package:

Code: Select all

sudo dpkg -i nginx_1.4.4-1~squeeze_armhf.deb

tomjerry
Posts: 7
Joined: Sat Oct 05, 2013 7:33 pm

Re: Installing Nginx 1.4.x on Raspberry Pi

Sun Feb 09, 2014 6:16 pm

There is an article How to install nginx by compiling source from Nam Huy Linux Blog
http://namhuy.net/1050/how-to-install-n ... ource.html

For Ubuntu, Mint, or Debian based distributions

Code: Select all

# apt-get update && apt-get dist-upgrade
# apt-get install build-essential libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev
As the time I’m writing, the lastest stable version is 1.5.10

Code: Select all

# wget http://nginx.org/download/nginx-1.5.10.tar.gz
Extract the archive:

Code: Select all

# tar -xvzf nginx-1.5.10.tar.gz
Go to nginx directory

Code: Select all

# cd nginx-1.5.10
Lets keep thing simple here, i will use default install location with ssl module

Code: Select all

./configure --sbin-path=/usr/local/sbin --with-http_ssl_module
# make
# make install

traverso85
Posts: 2
Joined: Sun Feb 16, 2014 6:35 pm
Location: Roma

Re: Installing Nginx 1.4.x on Raspberry Pi

Sun Feb 16, 2014 6:42 pm

Hi i'm Claudio,
i have some problem with nginx, at first time i had installed the version 1.2.1 by command apt-get install nginx..
Only after, i have discover that 1.4.4 or greater was necessary for the websocket..
Following this tutorial:
http://usefulmix.com/install-upgrade-to ... om-source/
have installed the version 1.5.10
Now in ssh monitor when i check nginx -v see the right version:
nginx version: nginx/1.5.10
after reboot the Pi and restart nginx, when i receive a web page from Pi in the chrome inspector see
like response header:
Server:nginx/1.2.1
:cry:
where i do wrong? someone can help me?
Thank's Claudio ;)

limpangel
Posts: 1
Joined: Mon Feb 17, 2014 9:12 pm

Re: Installing Nginx 1.4.x on Raspberry Pi

Tue Feb 18, 2014 9:24 am

I don't think that guide is suitable for the arm architecture.
traverso85 wrote:Hi i'm Claudio,
i have some problem with nginx, at first time i had installed the version 1.2.1 by command apt-get install nginx..
Only after, i have discover that 1.4.4 or greater was necessary for the websocket..
Following this tutorial:
http://usefulmix.com/install-upgrade-to ... om-source/
have installed the version 1.5.10
Now in ssh monitor when i check nginx -v see the right version:
nginx version: nginx/1.5.10
after reboot the Pi and restart nginx, when i receive a web page from Pi in the chrome inspector see
like response header:
Server:nginx/1.2.1
:cry:
where i do wrong? someone can help me?
Thank's Claudio ;)
I followed the steps in elmicha post above and that worked fine for me. Thanks.

traverso85
Posts: 2
Joined: Sun Feb 16, 2014 6:35 pm
Location: Roma

Re: Installing Nginx 1.4.x on Raspberry Pi

Tue Feb 18, 2014 10:49 am

limpangel wrote:I don't think that guide is suitable for the arm architecture.
I followed the steps in elmicha post above and that worked fine for me. Thanks.
but if it wasn't suitable, the installation process would fail or not?
and why I see the new version is installed?

Thanks Claudio

Return to “Debian”