Install Nginx using StackScript - Not working?

Hi,

Quick question, my server is debian and I am trying to have nginx installed on deploy. My stackscript is as follows:

#!/bin/bash

#install it.
apt-get install -y aptitude
aptitude install -y nginx-full
/etc/init.d/nginx start

When I used to install Nginx, it would show me a "working page" on root. This is my IP: http://176.58.103.78/

As you can see I dont get this working page, so I can only assume it hasnt installed. Am I doing something wrong here?

James

9 Replies

Does the stack script produce any errors when it runs (check via LISH)? Shouldn't you be doing an apt-get update or aptitude update before installing anything? nginx should already be started after installing it.

Actually, the nginx* packages don't start the server after installing, for whatever reason.

Agreed, you probably need an aptitude update before the install.

I corrected my script so it reads as follows:

#!/bin/bash

echo "" >> /etc/apt/sources.list
echo "#dotdeb" >> /etc/apt/sources.list
echo "deb http://nginx.org/packages/debian/ squeeze nginx" >> /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/debian/ squeeze nginx" >> /etc/apt/sources.list

apt-get update

apt-get install nginx

/etc/init.d/nginx start

It works. When im in Linode console it says "nginx" couldnt be authenticated so I have to accept it ( y ). Is there a way to have this install without me having to accept it via console?

@Spadez:

It works. When im in Linode console it says "nginx" couldnt be authenticated so I have to accept it ( y ). Is there a way to have this install without me having to accept it via console?

Add the -y that you had in the first post

I cant catch a break here!

This works:

#!/bin/bash

echo "" >> /etc/apt/sources.list
echo "#dotdeb" >> /etc/apt/sources.list
echo "deb http://nginx.org/packages/debian/ squeeze nginx" >> /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/debian/ squeeze nginx" >> /etc/apt/sources.list

apt-get update

apt-get install nginx

/etc/init.d/nginx start

This does not:

#!/bin/bash

echo "" >> /etc/apt/sources.list
echo "#dotdeb" >> /etc/apt/sources.list
echo "deb http://nginx.org/packages/debian/ squeeze nginx" >> /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/debian/ squeeze nginx" >> /etc/apt/sources.list

apt-get update

apt-get install -y nginx

/etc/init.d/nginx start

All I did was add -y. When I watch in console with -y, it runs throught the code and then appears to stop and then it just says:

> Debian GNU/Linux…etc
What gives!?

Did you look at the man page for apt-get?

http://manpages.ubuntu.com/manpages/luc … get.8.html">http://manpages.ubuntu.com/manpages/lucid/man8/apt-get.8.html

You can't put an option between the command and the package name…

From what I can see (im new to this) it should be like this:

#!/bin/bash

echo "" >> /etc/apt/sources.list
echo "#dotdeb" >> /etc/apt/sources.list
echo "deb http://nginx.org/packages/debian/ squeeze nginx" >> /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/debian/ squeeze nginx" >> /etc/apt/sources.list
echo "deb http://ftp.debian.org/debian/ squeeze non-free" >> /etc/apt/sources.list

apt-get update

apt-get -y install nginx
/etc/init.d/nginx start

Again though, this doesnt work. It works fine without -y….

Adding the nginx package key will get rid of the error about nginx not being authenticated

wget -O - http://nginx.org/keys/nginx_signing.key | apt-key add -

put that before you run apt-get update

For what ever reason the -y code doesnt work (bug?), but thanks to obs for this code, which does work:

#!/bin/bash 

echo "" >> /etc/apt/sources.list 
echo "#dotdeb" >> /etc/apt/sources.list 
echo "deb http://nginx.org/packages/debian/ squeeze nginx" >> /etc/apt/sources.list 
echo "deb-src http://nginx.org/packages/debian/ squeeze nginx" >> /etc/apt/sources.list 
echo "deb http://ftp.debian.org/debian/ squeeze non-free" >> /etc/apt/sources.list 
wget -O - http://nginx.org/keys/nginx_signing.key | apt-key add -
apt-get update 

apt-get install nginx 
/etc/init.d/nginx start

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct