Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am currently renting a VPS that is running CentOS 6.5. I am using it to run a basic forum site, and obviously, I need a web server and MySQL to power that. I have chosen Apache for my web server, and I am using the standard mysql-server package for CentOS.

My question is… whenever I reboot my server manually via the reboot command, I always have to manually start Apache and MySQL with the following commands:

service mysqld start
service httpd start

This can be a pain if I happen to forget to start up the individual service. Is there a way I can make it automatically start up whenever I manually reboot my server?

I have done some looking into other questions on ServerFault, and after looking at this question and installing strace, I ran strace /etc/init.d/mysqld start and had a very strange output that didn't make much sense to me. It didn't have any easily decipherable information, but I'm a novice at this type of thing, so I may have not been looking for the right thing.

I have found other pages across the Internet, but they usually seem to be for Debian-based operating systems, and I never seem to be able to use them for what I'm doing.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

The services on a CentOS operating system are managed using chkconfig.

Use chkconfig --list to review the currently managed services.

You can mark a service to automatically start at a defined runlevel by issuing:

# chkconfig someservice on

Read the chkconfig(8) manpage for the details.

share|improve this answer
    
Awesome, that did for me! chkconfig httpd on chkconfig mysqld on Thanks for the help. –  jflory7 Apr 23 at 1:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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