
At some point in time, you’ll probably need to restart your server. When you do this “essential” services, such as MySQL, Apache and Bind, will be shutdown and not started back up again when the server resumes. Which is fine, because usually you’ll just SSH into your server and start the services you need back up again. However, this isn’t very convenient, and there might be times when you don’t have access to an SSH client immediately after you reboot your server.
There is a better way to do this: start these services automatically when the server is started (“booted”). We’ll start MySQL, Apache, our firewall and Bind on boot, which I consider the essential services for a web server. Let’s start with setting up MySQL to start on boot. Login to SSH, and execute these commands:
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql
chkconfig --add mysql
Now, to setup Apache, our firewall and Bind to start on boot. Start by opening up /etc/rc.local:
nano /etc/rc.local
Then add the following to the end of the file:
apachectl -k start
csf -s
/etc/init.d/lfd start
/etc/rc.d/init.d/named start
Save and close the file. There you have it, your web server essential services will now start on boot. Automation, it’s a good thing.




