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

86  ServerAdmin
95  ServerName  # 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

  <h1>Hello World</h1>

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 *