Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Jan 03, 2009 11:53 am 
Offline
Senior Newbie

Joined: Sun Nov 30, 2008 10:03 am
Posts: 15
How do I ensure MySQL and HTTPD are started automatically after a server reboot?

I am using CentOS, Apache, PHP, MySQL


Top
   
 Post subject:
PostPosted: Sat Jan 03, 2009 12:04 pm 
Offline
Senior Newbie

Joined: Thu Oct 09, 2008 10:21 am
Posts: 8
Plenty of material on this subject, such as

http://www.techiecorner.com/104/how-to- ... ime-linux/

Google is your friend.

But the gist of it is scripts in /etc/init.d, which sort of acts like the startup folder for 'doze. Anything in that folder will at least attempt to run at startup.

You'll probably have one script called httpd, and another mysql. The install may or may not have placed them there automagically.

HTH


Top
   
 Post subject:
PostPosted: Sat Jan 03, 2009 12:23 pm 
Offline
Senior Member
User avatar

Joined: Fri Jan 02, 2009 11:31 am
Posts: 141
Website: http://faroutscience.com
Location: Texas / Kansas
Hi Sagar,

Go to /etc/rc.d/rc3.d directory and perform an ls command.

You will get a listing of files. The files with a K prefix do not start up automatically at boot. The files that are prefixed with an S will start up automatically at boot.

If you want to start up Mysql and Http at boot:

perform the following commands as root:

mv K15httpd S15httpd

mv K36mysqld S36mysqld

That assumes that httpd and mysqld are not already enabled for start up. Just verify the K or S prefix and the sequence number for your instance.

In other words, the prefix for services that you want to start at boot should be prefixed with an S and the ones that you do not want to start at boot should be prefixed with a K.

This works for me, YMMV

Jeff


Top
   
 Post subject:
PostPosted: Sat Jan 03, 2009 1:50 pm 
Offline
Senior Newbie

Joined: Sun Nov 30, 2008 10:03 am
Posts: 15
Thanks for the replies guys thats indeed helpful :)


Top
   
 Post subject:
PostPosted: Sat Jan 03, 2009 4:00 pm 
Offline
Senior Member
User avatar

Joined: Fri Jan 02, 2009 11:31 am
Posts: 141
Website: http://faroutscience.com
Location: Texas / Kansas
/etc/iinit.d in CentOS is merely a collection of scripts to manually start, stop, and restart services. They are not started by default at boot. That is the purpose of the rc.d directories.

Jeff


Top
   
 Post subject:
PostPosted: Sat Jan 03, 2009 6:21 pm 
Offline
Senior Member

Joined: Sun Aug 31, 2008 4:29 pm
Posts: 177
Also have a look at chkconfig (man chkconfig).

e.g., to see all services set to run in runlevel 3:

[root@server:~] chkconfig --list | grep 3:on

To set apache to run in the default runlevels:

[root@server:~] chkconfig httpd on


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group