• 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. Understanding System Security Services Daemon (SSSD)
  2. How to disable NFS client caching in CentOS/RHEL
  3. ‘ip’ Command cheat sheet (Command Line Reference)
  4. How to use wget to download file via proxy
  5. fgrep Command Examples in Linux
  6. CentOS / RHEL : How to add Physical Volume (PV) to a Volume group (VG) in LVM
  7. Running repairs on XFS Filesystems
  8. Bind to port 22 on 0.0.0.0 failed: address already in use – error while starting sshd service CentOS/RHEL
  9. How To Create a Local Yum Repository for MySQL Enterprise Packages
  10. Understanding the job control commands in Linux – bg, fg and CTRL+Z

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright