• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar

The Geek Diary

HowTos | Basics | Concepts

  • Solaris
    • Solaris 11
    • SVM
    • ZFS
    • Zones
    • LDOMs
    • Hardware
  • Linux
    • CentOS/RHEL 7
    • RHCSA notes
    • SuSE Linux Enterprise
    • Linux Services
  • VCS
    • VxVM
  • Interview Questions
  • oracle
    • ASM
    • mysql
    • RAC
    • oracle 12c
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Hadoop
    • Hortonworks HDP
      • HDPCA
    • Cloudera
      • CCA 131

How to Configure apache as start-up service on CentOS/RHEL 6

By admin

We want the apache service to start automatically upon reboot of the RHEL 6 server. In other words, how can we setup apache as a service and enable it to auto-start on reboot?

We can auto start apache as a service using the chkconfig utility. Below are the steps:

1. Become as root user on your Linux server.

# sudo su -

2. Create or copy your script under /etc/init.d. For example:

# vi /etc/init.d/httpd

3. Add script to start on boot using chkconfig utility using below commands.

# cd /etc/init.d
# chkconfig --add httpd
# chkconfig httpd on

4. And to Confirm script is added using chkconfig utility, run the below command :

# chkconfig --list httpd
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Disabling the service

In order to disable auto-start service then run these commands one by one:

# chkconfig httpd off  
# chkconfig –del httpd

Here,
chkconfig httpd off : This will disable auto-start service.
chkconfig –del httpd : This is to remove your script from chkconfig list.

Filed Under: CentOS/RHEL 6, Linux

Some more articles you might also be interested in …

  1. How to disable ABRT (Automatic Bug Reporting Tool) in RHEL
  2. How to create restricted korn shell in CentOS/RHEL
  3. Understanding OpenSSH Configuration Files
  4. CentOS / RHEL : Resize (extend) non-root EXT3/4 filesystem on non-LVM device (hard disk partition)
  5. lsof : Most commonly used examples
  6. CentOS / RHEL : How to configure an DHCP server
  7. Linux OS Service ‘sysstat’
  8. How to enable text colour in vi similar to vim in CentOS/RHEL
  9. Understanding The /etc/sysconfig Directory
  10. Linux OS Service ‘acpid’

You May Also Like

Primary Sidebar

Recent Posts

  • How to set the order to load certain modules in CentOS/RHEL 7 and 8
  • How to configure initrd / initramfs to including kernel modules in CentOS/RHEL
  • How to configure systemd.path to trigger an event when any changes made to a directory
  • Script to monitor RMAN Backup and Restore Operations
  • Oracle RMAN Backup Shell Script Example
  • Archives
  • Contact Us
  • Copyright

© 2019 · The Geek Diary