November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

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

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

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>