• 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. How to Create a MySQL Docker Container for Testing
  2. Linux OS Service ‘setroubleshoot’
  3. CentOS / RHEL : How to log all LVM commands
  4. How to change the Default Log Directory(/var/log) in Rsyslog for CentOS/RHEL 6,7
  5. CentOS / RHEL 7 : How to disable all tty consoles and enable only 1
  6. How to use “btrfs scrub” command to manage scrubbing on Btrfs file systems
  7. CentOS / RHEL 6 : how to start the services interactively during boot (to disable/abort some services)
  8. How to Disable Docker Process and docker0 Interface on CentOS/RHEL
  9. CentOS / RHEL : How to set chroot jail for vsftp for all the users
  10. CentOS / RHEL 5,6 : How to reinstall GRUB loader from rescue mode

You May Also Like

Primary Sidebar

Recent Posts

  • What are Command Rules in oracle Database
  • Using Rule Sets in Oracle Database Vault
  • How Realms Work in Oracle Database Vault
  • How to use Privilege Analysis in Oracle Database
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary