-2

I'm working my way through the Learning Puppet guide on manifests, and I am stuck on the exercise at the bottom of the page which asks you to install the httpd package and start the httpd service.

So far my manifest looks like:

package { 'httpd':
  ensure => present,
}

service { 'httpd':
  ensure => running,
  enable => true,
}

However, upon trying puppet apply on it, I get:

enter image description here

From looking at other examples of similar manifests, I cant quite figure out what the issue is - I presume the attempt at installing the package httpd failed? Unfortunately the error message isn't particularly helpful here. Any assistance anyone can provide would be greatly appreciated.

I'm running their VMWare Learning Puppet VM (PE 2.7.0) that was provided for this tutorial.

Quetzalcoatl
  • 113
  • 1
  • 3
  • Can you please explain why you downvoted? Sure it might appear trivial except it isn't working at all, despite resembling any examples I find. – Quetzalcoatl Jun 06 '13 at 13:02
  • 2
    It plainly says that httpd didn't start. Check your logs to find out why. – Michael Hampton Jun 06 '13 at 18:46
  • Server Fault is not a site to help you through tutorials. The scope of the site is to help answer actual, practical problems you face as a professional system administrator managing your environment. Even were this happening on a production server you need to do some [basic troubleshooting](http://meta.serverfault.com/q/3608/126632) -- we can't just pull an answer out of thin air with no data. – voretaq7 Nov 11 '13 at 18:18

2 Answers2

4

The error says it all, really: apache won't start. Try to start it manually and you'll see why.

Dennis Kaarsemaker
  • 18,793
  • 2
  • 43
  • 69
  • I was under the impression that the `package` block should be getting and installing `httpd`, but it still isn't installed at all yet so there isn't anything to start manually. I've tried substituting `httpd` for `apache` and `apache2`, but still to no avail. – Quetzalcoatl Jun 06 '13 at 12:34
  • 1
    Your service doesn't depend on your package, so puppet may try to start the service before the package is installed. – Dennis Kaarsemaker Jun 06 '13 at 12:36
  • Having added `subscribe => Package [httpd],` to the `service` block, it just hangs upon `puppet apply`... any ideas? – Quetzalcoatl Jun 06 '13 at 12:55
  • You need to use `require => Package['httpd']` for `service` block, instead of `subscribe`. – golja Jun 06 '13 at 13:14
  • Tried it with require as you said, it still just hangs... Doesn't even let me SIGKILL, have to force it into the background and kill it manually. – Quetzalcoatl Jun 06 '13 at 13:19
0

Run # /sbin/service httpd start and read the output, you should be getting some error that is stopping apache from being able to start.

My particular problem was syntax errors in httpd.conf due to missing components of apache. You can either install those components somehow. Or do what I did, comment those lines out in the httpd.conf just to get it running.

#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule mem_cache_module modules/mod_mem_cache.so

Once I did that, the apache service is able to start. And I was able to navigate to http://ipaddress:80 to see the test page.

user5293
  • 101
  • 2