Question

no package nginx available

  • Posted June 26, 2013

Trying to install Nginx on my new droplet and I’m getting the following error: “no package nginx available”. How can I fix this?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

…now all I have to do is learn to configure and I should be set for a little bit.

@Matteo that worked man. Thanks! <br> <br>@everyone…thank you for your help. <br> <br>

-> Gavin, you’re giving wrong tips about CentOS <- <br> <br>No, don’t remove Apache: uncorrect, you can have problems with PHP & Co in the future <br> <br>Correct: <br>$ service httpd stop <br>$ service nginx start <br> <br>If you receive following response: <br>[ok] <br> <br>Do that: <br>$ chkconfig httpd off <br>

looks like nginx isn’t even running. i’m a little confused (and slow) :) <br> <br>Last login: Wed Jun 26 16:39:57 2013 from xx.xxx.xxx.x <br>root@ny1 [~]# netstat -plutn <br>Active Internet connections (only servers) <br>Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name <br>tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 20313/exim <br>tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 20361/spamd.pid --m <br>tcp 0 0 0.0.0.0:2095 0.0.0.0:* LISTEN 1685/cpsrvd (SSL) - <br>tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 4142/httpd <br>tcp 0 0 0.0.0.0:2096 0.0.0.0:* LISTEN 1685/cpsrvd (SSL) - <br>tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 20313/exim <br>tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 1611/pure-ftpd (SER <br>tcp 0 0 xxx.xxx.xx.xxx:53 0.0.0.0:* LISTEN 1012/named <br>tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1012/named <br>tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1375/sshd <br>tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 20313/exim <br>tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1012/named <br>tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 4142/httpd <br>tcp 0 0 0.0.0.0:2077 0.0.0.0:* LISTEN 24376/cpdavd - acce <br>tcp 0 0 0.0.0.0:2078 0.0.0.0:* LISTEN 24376/cpdavd - acce <br>tcp 0 0 0.0.0.0:2082 0.0.0.0:* LISTEN 1685/cpsrvd (SSL) - <br>tcp 0 0 0.0.0.0:2083 0.0.0.0:* LISTEN 1685/cpsrvd (SSL) - <br>tcp 0 0 0.0.0.0:2086 0.0.0.0:* LISTEN 1685/cpsrvd (SSL) - <br>tcp 0 0 0.0.0.0:2087 0.0.0.0:* LISTEN 1685/cpsrvd (SSL) - <br>tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1504/mysqld <br>tcp 0 0 :::587 :::* LISTEN 20313/exim <br>tcp 0 0 :::465 :::* LISTEN 20313/exim <br>tcp 0 0 :::21 :::* LISTEN 1611/pure-ftpd (SER <br>tcp 0 0 :::22 :::* LISTEN 1375/sshd <br>tcp 0 0 :::25 :::* LISTEN 20313/exim <br>udp 0 0 xxx.xxx.xx.xxx:53 0.0.0.0:* 1012/named <br>udp 0 0 127.0.0.1:53 0.0.0.0:* 1012/named <br>root@ny1 [~]#

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. <br> <br>See: https://www.digitalocean.com/community/articles/how-to-configure-nginx-as-a-front-end-proxy-for-apache

@Nestor: you can check if nginx is running by running the following command: <br> <br>netstat -plutn <br> <br>and looking for the port nginx should listen on.

How can I check if nginx is running?

Why delete Apache? Aren’t they supposed to run together?

Thank you Gavin. I received the following, is this right? <br> <br>root@ny1 [~]# service httpd stop <br>root@ny1 [~]# service nginx start <br>Starting nginx: [ OK ] <br>root@ny1 [~]# sudo /etc/init.d/nginx start <br>root@ny1 [~]# yum remove httpd <br>Loaded plugins: fastestmirror <br>Setting up Remove Process <br>No Match for argument: httpd <br>Loading mirror speeds from cached hostfile <br> * base: centos.mirror.constant.com <br> * extras: mirror.ash.fastserv.com <br> * updates: mirror.trouble-free.net <br>No Packages marked for removal <br>root@ny1 [~]# yum remove httpd* <br>Loaded plugins: fastestmirror <br>Setting up Remove Process <br>No Match for argument: httpd* <br>Loading mirror speeds from cached hostfile <br> * base: centos.mirror.constant.com <br> * extras: mirror.ash.fastserv.com <br> * updates: mirror.trouble-free.net <br>No Packages marked for removal <br>root@ny1 [~]# <br>

You probably have Apache already installed. <br> <br>Try this <br> <br>$ service httpd sttop <br>$ service nginx start <br> <br>If that works, remove apache <br> <br>$ yum remove httpd* <br> <br>That’ll fix it.