I tried using the nginx recipe of this cookbook today on an ubuntu 14.04 machine and it all installed beautifully. BUT...
When I tried to run Wordpress nothing happened. This turned out to be an easy fix - nginx wasn't running, so I had to type:
This started nginx, even though there was no output from the console.
The second problem I ran into was that on accessing the main web page, I got the error: "Error Establishing Database Connection"
Took me a while to figure out - and after some googling, I came across the cause. Turns out that Wordpress doesn't like the database host being referred to as 'localhost'. Instead, you have to use '127.0.0.1'.
Changing this is quite easy. You have to do this from within your cookbook:
If you are using your own cookbook, you can set the host in recipes/default.rb like this:
node.default['wordpress']['db']['host'] = "127.0.0.1"
or alternatively, you can set it in attributes/default.rb like this (useful if you follow the wrapper cookbook pattern):
default['wordpress']['db']['host'] = "127.0.0.1"
This allows everything to work as expected. But I'm curious - does anyone know why using 'localhost' doesn't work?
I tried using the nginx recipe of this cookbook today on an ubuntu 14.04 machine and it all installed beautifully. BUT...
When I tried to run Wordpress nothing happened. This turned out to be an easy fix - nginx wasn't running, so I had to type:
This started nginx, even though there was no output from the console.
The second problem I ran into was that on accessing the main web page, I got the error: "Error Establishing Database Connection"
Took me a while to figure out - and after some googling, I came across the cause. Turns out that Wordpress doesn't like the database host being referred to as 'localhost'. Instead, you have to use '127.0.0.1'.
Changing this is quite easy. You have to do this from within your cookbook:
If you are using your own cookbook, you can set the host in recipes/default.rb like this:
or alternatively, you can set it in attributes/default.rb like this (useful if you follow the wrapper cookbook pattern):
This allows everything to work as expected. But I'm curious - does anyone know why using 'localhost' doesn't work?