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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. Linux OS Service ‘yppasswdd’
  2. CentOS / RHEL 6 : How to disable Transparent Huge pages (THP)
  3. How to disable ACPI in CentOS/RHEL 7
  4. CentOS / RHEL : How to make iptable rules persist across reboots
  5. RHEL 7 – RHCSA Notes – System documentation including man, info, and files in /usr/share/doc
  6. Time goes out of sync on a node running CentOS/RHEL 7
  7. Understanding the nfsiostat command output (Examples Included)
  8. Input/Output Errors During XFS Filesystem Access In CentOS/RHEL 7
  9. CentOS / RHEL 7 : How to Change Timezone
  10. How to Configure rsyslog Server to Accept Logs via SSL/TLS

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ACPI in CentOS/RHEL 7
  • How to Use real-time query to access data on a physical standby database
  • CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  • How to Create a Physical Standby Database by Using SQL and RMAN Commands
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary