How to install apache server in CentOS 6 and 7?

What is apache web server?
The Apache HTTP Server, colloquially called Apache, is a free and open-source cross-platform web server, released under the terms of Apache License 2.0.

Apache is most common server used by companies or individuals to run their website. It is very popular and easy to install. It is very like that apache is already installed  on your server but we will still guide you in case it is not.

We will update the server before installing apache. Connect  on server and run this command.

$ yum  update -y

After updating we will install apache.

$ yum install httpd -y

It will install the apache server and now we will check if apache is running or not.

$ service httpd status
$ service httpd restart

You will now be able to open the apache default web page by opening http://IP which means your server is up and running. You  can now upload your content in /var/www/html/ and your website will be  ready to go on the  IP.

We can also host multiple websites, change the web directory, change the the port, and many other things by editing httpd.conf. We will cover that in  further tutorials.

Leave a Reply

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