Nginx installation errors in debian 8.3 - nginx

Setting up nginx-full (1.6.2-5+deb8u1) ...
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript nginx, action "start" failed.
dpkg: error processing package nginx-full (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
nginx depends on nginx-full (>= 1.6.2-5+deb8u1) | nginx-light (>= 1.6.2-5+deb8u1) | nginx-extras (>= 1.6.2-5+deb8u1); however:
Package nginx-full is not configured yet.
Package nginx-light is not installed.
Package nginx-extras is not installed.
nginx depends on nginx-full (<< 1.6.2-5+deb8u1.1~) | nginx-light (<< 1.6.2-5+deb8u1.1~) | nginx-extras (<< 1.6.2-5+deb8u1.1~); however:
Package nginx-full is not configured yet.
Package nginx-light is not installed.
Package nginx-extras is not installed.
dpkg: error processing package nginx (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.19-18+deb8u3) ...
Processing triggers for systemd (215-17+deb8u3) ...
Errors were encountered while processing:
nginx-full
nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)
Above is the error that is given to me when running sudo apt-get install nginx. I tried removing apache and nginx both and reinstalling but it gives the same error.

I had the same problem.
I DO NOT have Apache, and nothing else was blocking my port 80.
I could NOT install nginx with
sudo apt-get install nginx
nor with
sudo apt-get install nginx-common nginx-full
After one week I stumbled over this little blog: https://etc.banana.fish/?p=75
In this blog, the solution is:
Install nginx-common: sudo apt-get install nginx-common
Remove listen [::]:80 default_server; from /etc/nginx/sites-enabled/default (I made this using the root-user)
Just to be sure, I did reboot my server.
Just to be sure twice, I did sudo apt-get update and then sudo apt-get upgrade.
Now I finally called sudo apt-get install nginx-full and it worked!
Afterwords I could see the Titlescreen of nginx, when I typed in the IP of my remote server!

You didn't post the output of systemctl status nginx.service so this might not be right, but I had this issue because I had an old install of nginx I'd forgotten about.
So, I purged nginx and reinstalled:
apt-get purge nginx-full nginx-common
apt-get install nginx-full
Then I received another error, got the details: systemctl status nginx.service
In my case
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
So I have another web server listening on port 80.
To fix, I edited the default nginx site nano /etc/nginx/sites-available/default and removed listen on port 80.
I only needed SSL, so:
server {
listen 443 ssl;
//rest of config....
}

Helped for me:
service apache2 stop
apt-get remove apache2*
apt-get autoremove

I was facing similar problems while installing nginx on ubuntu16 Amazon EC2 instance and the cause seems to be that I fiddled with the inbound ports under my security group settings
ideally they should be:
HTTP
TCP
80
0.0.0.0/0
and
HTTP
TCP
80
::/0
I had removed one of them for some reason by mistake it appears, when I fixed that everything got sorted

Related

Nginx+Passenger Error - libcurl.so.4: version `CURL_OPENSSL_3' not found

System:
Ubuntu: 18.04 LTS
Passenger: 5.3.1
nginx with libnginx-mod-http-passenger
$ sudo nginx -t
Returns:
PassengerLoggingAgent: /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by PassengerLoggingAgent)
2018/06/04 02:28:40 [alert] 10411#0: Unable to start the Phusion Passenger watchdog because it encountered the following error during startup: Unable to start the Phusion Passenger logging agent: it seems to have crashed during startup for an unknown reason, with exit code 1 (-1: Unknown error)
```
You can install the required version 3 from the bionic repository if you don't depend on other software that already uses version 4:
sudo apt install libcurl3/bionic
This will ask you to remove curl itself, libcurl4, and dependend software. Consider carefully if you need those, before removing them.
You still can roll back by installing libcurl4 and the removed software again.
This fixed my problem:
sudo apt install libcurl4-openssl-dev

NGINX failed after installing "nginx-extras"

Installed through:
apt-get install nginx-extras
After this, I tried do "service nginx restart" and "nginx -t" gets
no port in upstream "php5-fpm-sock" in /etc/nginx/sites-enabled/[file]:84
Then I uninstalled nginx-extras
apt-get remove nginx-extras
But problem has not solved, it seems during installation some config was changed.
Question is what config has changed and how to fix?
Nginx 1.13.12 on Debian 8.
During instalation nginx-extras, it will ask smth about use current version of configs. Answer N.
try and remove all nginx installed packages and install nginx-full

brew install 3rd party nginx modules on nginx to enable Headers More

I can't seem to figure out how to install the Headers More module for nginx when I've installed nginx using homebrew.
I've found I use homebrew to install nginx, and how to add 3rd modules? but this doesn't actually recompile nginx with this module. It's just downloads the module.
I've found nginx-full but event with the --with-headers-more option I can't seem this module working.
I keep getting this error:
nginx: [emerg] unknown directive "more_set_input_headers" in /usr/local/etc/nginx/sites-enabled/....
I installed successfully using the following command
brew install nginx-full --with-headers-more-module
Make sure your brew formulas are up to date
brew update

Unable to locate package http, ubuntu 12.04

I can install http just by call 'apt-get install http' But I get the following error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package http
I also tried 'sudo apt-get install http'. no luck.
My system is ubuntu 12.04.
Try this command:
sudo apt-get install apache2
The httpd package comes under the name of apache2 in Ubuntu.
The package name is httpd. so,
sudo apt-get install httpd
should work.

Nginx update on ubuntu fails

I am not nginx expert and having problems in configuring it.
Examples I found on web are slightly different so I wanted to update nginx 1.05 to 1.4.1 to see if it helps.
I have found instructions to install nginx from PPA as
apt-get install python-software-properties
add-apt-repository ppa:nginx/stable
apt-get update
apt-get install nginx
It seems as is it has installed but nginx -v is still telling me I have 1.0.5
What I missed?
Using ubuntu 11.10
Thanks
NGINX maintains is own apt repository which means you don't need to use the PPA.
Firstly remove the added ppa:
sudo add-apt-repository --remove ppa:nginx/stable
Then, if you're not running anything critical through nginx I would suggest running apt-get remove --purge nginx to completely remove nginx.
To use NGINX's repository add the following to `/etc/apt/sources.list.d/nginx.list':
deb http://nginx.org/packages/ubuntu/ oneiric nginx
deb-src http://nginx.org/packages/ubuntu/ oneiric nginx
Then run apt-get update. Then reinstall using apt-get install nginx.
Hope that works.

Resources