I am newer to nginx and am getting this error message while
sudo apt-get install nginx
can any one help me to fix this
nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2017-08-28 15:12:09 IST; 20ms ago
Docs: man:nginx(8)
Process: 6656 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Aug 28 15:12:09 onlyoffice systemd[1]: Starting A high performance web serv.....
Aug 28 15:12:09 onlyoffice nginx[6656]: nginx: [emerg] open() "/etc/nginx/ng...)
Aug 28 15:12:09 onlyoffice nginx[6656]: nginx: configuration file /etc/nginx...d
Aug 28 15:12:09 onlyoffice systemd[1]: nginx.service: Control process exite...=1
Aug 28 15:12:09 onlyoffice systemd[1]: Failed to start A high performance w...r.
Aug 28 15:12:09 onlyoffice systemd[1]: nginx.service: Unit entered failed state.
Aug 28 15:12:09 onlyoffice systemd[1]: nginx.service: Failed with result 'e...'.
Hint: Some lines were ellipsized, use -l to show in full.
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.13.3-0+xenial1.1~) | nginx-light (<< 1.13.3-0+xenial1.1~) | nginx-extras (<< 1.13.3-0+xenial1.1~); 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.13.3-0+xenial1) | nginx-light (>= 1.13.3-0+xenial1) | nginx-extras (>= 1.13.3-0+xenial1); 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
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
nginx-full
nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)
thank you in advance
You could try to use the official nginx.repo for Ubuntu (Xenial)
Edit /etc/apt/sources.list and add these lines at the end of the file:
deb http://nginx.org/packages/ubuntu/ codename nginx
deb-src http://nginx.org/packages/ubuntu/ codename nginx
Save the file and run this commands:
sudo apt-get update
sudo apt-get install nginx
It should install the latest nginx version from the nginx official repo.
If that's not working try running this command instead:
apt-get -f install nginx
or
apt-get -f -y install nginx
Related
I want to install Rstudio after I have installed R on my ubuntu 20.4
Everything is fine till I want to execute the actual installation with
sudo gdebi rstudio-server-1.3.1073-amd64.deb
rstudio-server.service - RStudio Server
Loaded: loaded (/lib/systemd/system/rstudio-server.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Mon 2020-08-17 11:35:12 CEST; 11ms ago
Process: 128920 ExecStart=/usr/lib/rstudio-server/bin/rserver (code=exited, status=127)
Why do I get the (code=exited, status=127) and how can I solve it?
Thanks
I had the same issue and solved it by getting to the one for Ubuntu18/Bionic Beaver instead:
https://download1.rstudio.org/desktop/bionic/amd64/rstudio-1.2.5042-amd64.deb
sudo apt install gdebi
sudo gdebi rstudio-1.2.5042-amd64.deb
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
When I am installing tomcat 7 in ubuntu 16.04 I got this error
invoke-rc.d: initscript tomcat7, action "start" failed.
● tomcat7.service - LSB: Start Tomcat.
Loaded: loaded (/etc/init.d/tomcat7; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2017-05-29 00:33:24 IST; 6ms ago
Docs: man:systemd-sysv-generator(8)
Process: 972 ExecStart=/etc/init.d/tomcat7 start (code=exited, status=1/FAILURE)
May 29 00:33:24 developer-HP-Notebook systemd[1]: Starting LSB: Start Tomcat....
May 29 00:33:24 developer-HP-Notebook tomcat7[972]: * no JDK or JRE found - please set JAVA_HOME
May 29 00:33:24 developer-HP-Notebook systemd[1]: tomcat7.service: Control process exited, code=exited status=1
May 29 00:33:24 developer-HP-Notebook systemd[1]: Failed to start LSB: Start Tomcat..
dpkg: error processing package tomcat7 (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for systemd (229-4ubuntu17) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
tomcat7
E: Sub-process /usr/bin/dpkg returned an error code (1)
Either Java is not installed or you have the environment variable JAVA_HOME not pointed to it. Check for existence of java on your system, by executing following command in a terminal:
java -version
Install Java, by either downloading a jdk or jre from oracle java: https://java.com/.
Or just run:
sudo apt-get install openjdk-8-jdk
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
I'm trying to reinstall nginx, but I have this
nginx -t
nginx: [alert] could not open error log file: open()
"/var/log/nginx/error.log" failed (2: No such file or directory)
2015/01/25 16:18:01 [emerg] 1400#0: open() "/etc/nginx/nginx.conf"
failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed
How to install and start nginx if I removed all the nginx folders?
Login as root or:
sudo su -
Then uninstall nginx:
apt-get purge nginx nginx-common nginx-full
And then install it:
apt-get install nginx
The other way is to run sudo command with -H:
sudo -H apt-get purge nginx nginx-common nginx-full
sudo -H apt-get install nginx
apt-get --purge remove nginx-*
apt-get install nginx
Try:
sudo aptitude purge nginx && sudo aptitude install nginx
This code will remove and reinstall Nginx