Pergunta

So we use chef for our servers and in the process of setting up munin, the munin cookbook now requires both nginx and apache2.

We also have our own recipes for setting up sites using the web_app definition.

If the server only has nginx or apache2 it works fine but as soon as both are required in the run list the web_app definition gets called in both apache2 and nginx this of course fails because you can't have two servers running on port 80.

Without modifying the cookbooks which is bad how can I get around this or scope to only apache or nginx. Btw we need both.

Foi útil?

Solução 2

I just looked through our commit logs and turns out its my own fault :-( I ported the web_app definition from apache over to port our own cookbooks from apache to nginx.... fail

EDIT: renamed web_app in the nginx recipe to nginx_app which solves the problem

Outras dicas

There's a bit of confusion going on there... Only the apache2 cookbook has a web_app definition. The nginx cookbook uses a nginx_site definition.

That said, your issue seems to come from the fact that you have two different processes trying to listen on the same port on the same node. To fix that, you have to tell either apache or nginx to listen on a different port.

To configure apache, you have to override node[:apache][:listen_ports] to exclude 80.

For nginx, you probably have to set your virtual hosts not to listen on port 80.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top