0

I recently created an ec2 server using some user-data to install various modules. This was a standalone instance without an associated IAM role and with a bog standard security group (allow port 80), everything about this instance worked fine.

Using exactly the same instance type and user-data I created another instance that used an existing security group associated with a load balancer (though the instance wasn't added to the load balancer) and with an associated IAM role and for the life of me I could not get the httpd service to start on it. Is this expected behaviour? I can't see anything different in how these instances were configured other than the security group and the IAM role. Would it be a case that because the 2nd instance wasn't behind the LB but it had the LBs security group that Apache refused to run, and that if I added it to the LB it would then start working?

4
  • 2
    Short answer: no. IAM roles control access to AWS resources, nothing internal to the instance itself. What is the error message produced when you attempt to start httpd? Aug 6, 2014 at 0:02
  • There's isn't one. Even if I start with the debug flag.it says it starts ok then instantly stops and I cant seem to access the httpd logs on ec2
    – TommyBs
    Aug 6, 2014 at 5:36
  • Saying that, if I run killall httpd then start it says it starts ok, otherwise it just says it's starting without the ok message. Either way running it with debug does nothing
    – TommyBs
    Aug 6, 2014 at 6:12
  • edit again! sudo service httpd status actually says its='s running, service httpd status says its not. So obviously it's running under root. And it looks like this is where all my confusion has come from. It seems to be working now (though it is also in a different availability zone). Feel like such an idiot working with unix to debug things
    – TommyBs
    Aug 6, 2014 at 6:29

0

You must log in to answer this question.

Browse other questions tagged .