• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL : How to install and start the Apache httpd service

by admin

Question: How to install Apache and configure Apache httpd to run as a service?

Answer:

Installing the Apache package

If you have the apache package downloaded, you can install it using rpm command as root user.

# rpm -ivh httpd

If you have yum repository configured, use the recommended way of installing Apache httpd, i.e. with “yum install” command.

# yum install httpd
NOTE: To get a specific version replace httpd with the version you would like. Example: httpd-2.2.14-1.2.6.jdk6.ep5.el5.x86_64

Installing httpd as a service

Enable the http service on startup with the below command. This will enable it for runlevels 2,3,4 & 5 :

# chkconfig httpd on

To start the httpd service :

# service httpd start

For RHEL 7

With RHEL 7 you use the systemctl command to enable the service:

# systemctl enable httpd.service

With RHEL 7 you use the systemctl command to start the service:

# systemctl start httpd.service

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. userdel Command Examples in Linux
  2. f5fpc Command Examples
  3. bat Command Examples in Linux
  4. PAM password complexity and pam_cracklib credit system in CentOS/RHEL
  5. Rsyslog : How to Send log files to remote server in CentOS/RHEL 6,7
  6. megatools-dl Command Examples in Linux
  7. How To Disable Or Extend System Logging Rate-limit on CentOS/RHEL 7
  8. How to Run DNS and FTP services in a chroot Jail
  9. xargs Command Examples in Linux
  10. gnome-software Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright