Question

no package nginx available

Posted June 26, 2013 16.5k views
Trying to install Nginx on my new droplet and I'm getting the following error: "no package nginx available". How can I fix this?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
14 answers
Assuming this is a CentOS 5 droplet, this question may help: http://stackoverflow.com/questions/12580894/no-package-found-error-when-installing-nginx-on-centos-5
Hello. It's a CentOS6 droplet. I'm getting error this now:

root@ny1 [~]# sudo /etc/init.d/nginx start
Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[FAILED]
It looks like you already have a service listening on TCP port 80, so nginx is not able to listen on that port.
You probably have Apache already installed.

Try this

$ service httpd sttop
$ service nginx start

If that works, remove apache

$ yum remove httpd*

That'll fix it.
Thank you Gavin. I received the following, is this right?

root@ny1 [~]# service httpd stop
root@ny1 [~]# service nginx start
Starting nginx: [ OK ]
root@ny1 [~]# sudo /etc/init.d/nginx start
root@ny1 [~]# yum remove httpd
Loaded plugins: fastestmirror
Setting up Remove Process
No Match for argument: httpd
Loading mirror speeds from cached hostfile
* base: centos.mirror.constant.com
* extras: mirror.ash.fastserv.com
* updates: mirror.trouble-free.net
No Packages marked for removal
root@ny1 [~]# yum remove httpd*
Loaded plugins: fastestmirror
Setting up Remove Process
No Match for argument: httpd*
Loading mirror speeds from cached hostfile
* base: centos.mirror.constant.com
* extras: mirror.ash.fastserv.com
* updates: mirror.trouble-free.net
No Packages marked for removal
root@ny1 [~]#
Why delete Apache? Aren't they supposed to run together?
How can I check if nginx is running?
@Nestor: you can check if nginx is running by running the following command:

netstat -plutn

and looking for the port nginx should listen on.
Ah, the way I have it running is nginx only, sorry for the confusion. If you're using nginx as a cache, then yes, you need both running, but then you run apache on a different port from nginx you use nginx as the front end server, and apache to run anything scripted by passing it through nginx.

See: https://www.digitalocean.com/community/articles/how-to-configure-nginx-as-a-front-end-proxy-for-apache
Previous 1 2 Next