Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've set up apache, mysql and php on my AWS EC2 instance, but how could it be done that these services are starting when the EC2 is starting? I've found the chkconfig -a mysql command but this just gives an error like option -a not found.

share|improve this question

closed as not a real question by Ward, Wesley, mgorven, Khaled, MDMarra Jun 14 '12 at 16:28

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

What is your distro? – Khaled Jun 9 '12 at 12:47
@Khaled Amazon Linux AMI 2012.03 – John Brunner Jun 9 '12 at 13:07
up vote 7 down vote accepted

I read the chkconfig man page for you and it says

chkconfig [--level <levels>] [--type <type>]<name> <on|off|reset|resetpriorities>


chkconfig --level 3 mysqld on

would start the mysql daemon at runlevel 3. Similarly

chkconfig --level 3 httpd on

would start Apache in runlevel 3.

share|improve this answer
@lain works really great. thank you very much!! – John Brunner Jun 9 '12 at 17:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.