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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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. quotaoff Command Examples in Linux
  2. How to use mdadm to create a software mirror on top of multipath devices
  3. How To Disable Or Extend System Logging Rate-limit on CentOS/RHEL 7
  4. How to query and modify kernel parameters using sysctl (Immediately and persistently) in CentOS / RHEL
  5. htop (interactive process viewer) Linux Performance Monitoring tool
  6. rpcclient Command Examples in Linux
  7. Beginners Guide to Swap Space Management in Linux
  8. How to restore files under user’s home directory to default in Linux
  9. rm Command Examples in Linux
  10. Understanding /proc/meminfo file (Analyzing Memory utilization in Linux)

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright