How to install Apache on CentOS

Apache installation on CentOS with minimum configuration
OS version: CentOS Linux release 7.2.1511 (Core)

Install Apache

# yum -y install httpd

Edit httpd.conf
/etc/httpd/conf/httpd.conf

   ...
86  ServerAdmin root@letmefix-it.com
   ...
95  ServerName www.letmefix-it.com:80  # or specify IP address and port number
   ...
151 AllowOverride All
   ...
ServerTokens Prod   # add this line to the end of file to increase security

Start Apache

# systemctl start httpd
# systemctl enable httpd

*Don’t forget to turn off firewall or open port 80.
Create test page
/var/www/html/index.html

<html>
 <body>
  <h1>Hello World</h1>
 </body>
</html>

Access http://yourservername/ and you should be able to see the test page.

Leave a Reply

Your email address will not be published. Required fields are marked *