Apache is a popular open-source, cross-platform web server that is, by the numbers, the most popular web server in existence. It's actively maintained by the Apache Software Foundation. Some high-profile companies using Apache include Cisco, IBM, Salesforce, General Electric, Adobe, VMware, Xerox, LinkedIn, Facebook, Hewlett-Packard, AT&T. Apache is an open-source and free web server software that powers around 40% of websites around the world. The official name is Apache HTTP Server, and it's maintained and developed by the Apache Software Foundation. It allows website owners to serve content on the web — hence the name 'web server.'. The Apache HTTP Server is the top choice of users looking for an easy-to-use yet powerful Web server on Softpedia as well as worldwide. Started back in 1995, the project has quickly escalated into.
- Apache Http Server Uninstall
- Apache Http Server Tutorial
- Failed To Start The Apache Http Server
- Apache Http Server Tutorial
- Apache Http Server Download
- Apache Http Server Tutorial
This tutorial explains about Apache HTTP Server( Apache Web Server) Installation. Let us learn about what Apache HTTP Server is and how to install and configure it on a Linux Machine.
Apache http Server
Apache is a very well known open-source Web Server. It is not only popular but also very old Web Server. Like any other Web Servers, Apache also accepts requests from the clients, search for the requested queries and then send the response back to them.
Also Read : How to install Anaconda on Linux
&& Install Redis on Linux from source
Apache HTTP Server Installation
Step 1- Update your Linux Box
$ yum update -y
Step 2- Install Apache Web Server
$ yum install httpd -y
Step 3- Start httpd service
$ service httpd start
Step 5- check the httpd service status
$ service httpd status
Step 6- Run chkconfig command to run the httpd service automatically after a system reboot
$ chkconfig httpd on
Step 7- To browse website from the Internet, open port 80 for http and 443 for https in your Server firewall , Network Firewall and Security Group (If using AWS or any other cloud service)
Now your Apache-Server is installed and ready.
Configuring Apache HTTP Server
Let us understand the ApacheHtTTPServer step by step from basic to advanced.
As soon as your installation is done and port is opened in the security group, without doing any configuration change just enter the public IP in the web browser of any computer. You will see the default page as shown below.
To access the server from your domain name, create A record for your web server in your DNS zone configuration.If you are not managing your DNS Server please take help of your DNS team/IT Team to do so.
I have created A record for my domain as follows:
devopsmyway.in ————–> IP Address of my Server.
Now I can browse the Apache Web Server from my domain name i.e devopsmyway.in. The same test page will come as I did not change any configuration yet.
Basic Configuration of Apache HTTP Server
Let's do some basic changes to open your Web Server (Web Site) as per your configuration.
Create an index.html file in '/var/www/html' directory and write some content in this to serve in the web browser. I am using echo command here to create and write content in index.html.
$ echo 'Hello , Welcome to Devopsmyway.in ' > /var/www/html/index.html
As soon as you create and write content in index.html file in Document Directory'/var/www/html' your website will start serving the content written in index.html.
Now we have done the basic configuration of Apache Web Server. Let us move ahead and learn some advanced settings.
$ chkconfig httpd on
Step 7- To browse website from the Internet, open port 80 for http and 443 for https in your Server firewall , Network Firewall and Security Group (If using AWS or any other cloud service)
Now your Apache-Server is installed and ready.
Configuring Apache HTTP Server
Let us understand the ApacheHtTTPServer step by step from basic to advanced.
As soon as your installation is done and port is opened in the security group, without doing any configuration change just enter the public IP in the web browser of any computer. You will see the default page as shown below.
To access the server from your domain name, create A record for your web server in your DNS zone configuration.If you are not managing your DNS Server please take help of your DNS team/IT Team to do so.
I have created A record for my domain as follows:
devopsmyway.in ————–> IP Address of my Server.
Now I can browse the Apache Web Server from my domain name i.e devopsmyway.in. The same test page will come as I did not change any configuration yet.
Basic Configuration of Apache HTTP Server
Let's do some basic changes to open your Web Server (Web Site) as per your configuration.
Create an index.html file in '/var/www/html' directory and write some content in this to serve in the web browser. I am using echo command here to create and write content in index.html.
$ echo 'Hello , Welcome to Devopsmyway.in ' > /var/www/html/index.html
As soon as you create and write content in index.html file in Document Directory'/var/www/html' your website will start serving the content written in index.html.
Now we have done the basic configuration of Apache Web Server. Let us move ahead and learn some advanced settings.
Virtual Host
Virtual host comes into picture when you want to host multiple Websites on a Single Server. Virtual host are of two types:
- Name-based virtual host
- IP based virtual host
Name-based Virtual Host
Name-based Virtual Host is used to configure multiple websites on a Single Server having a single IP Address. To configure Name-based Virtual hosts we need to do configuration changes in Apache Configuration file.
Apache Configuration file : /etc/httpd/conf/httpd.conf
Let us configure two websites www.devopsmyway.in and www.devopsmyway.net on the same Server with same IP address. To do so , open /etc/http/conf/httpd.conf and add the following lines at the bottom of the file.
$ vi /etc/httpd/conf/httpd.conf
ServerAdmin [email protected]
DocumentRoot /var/www/html/devopsmyway.in
ServerName www.devopsmyway.in
ErrorLog logs/www.devopsmywa.in-error_log
CustomLog logs/www.devopsmyway.in-access_log common
ServerAdmin [email protected]
DocumentRoot /var/www/html/devopsmyway.net
ServerName www.devopsmyway.net
ErrorLog logs/www.devopsmyway.net-error_log
CustomLog logs/www.devopsmyway.net-access_log common
Now Create to Directories as follows:
$ mkdir -p /var/www/html/devopmyway.net
$ mkdir -p /var/www/html/devopmyway.in
Create index.html file in each folder and add some content in it.
$ echo 'Hello , Welcome to Devopsmyway.in ' > /var/www/html/devopsmyway.in/index.html
$ echo 'Hello , Welcome to Devopsmyway.net ' > /var/www/html/devopsmyway.net/index.html
Now check the configuration and restart the httpd service
$ httpd -t
$ service httpd restart
Note: If you donot have two websites in Public DNS , you can do host entry in /etc/hosts on the same server as follows for testing
Now you will able to browse both the URL.
IP based virtual host
IP bases virtual host is used to configure multiple websites on a Single Server with multiple IP Addresses. To configure IP-based Virtual hosts we need to do the following configuration changes in the Apache configuration file.
Let us configure two websites www.devopsmyway.in and www.devopsmyway.net on the same Server on two IP addresses. To do so , open /etc/http/conf/httpd.conf and add the following lines at the bottom of the file.
ServerAdmin [email protected]
DocumentRoot /var/www/html/devopsmyway.in
ServerName www.devopsmyway.in
ErrorLog logs/www.devopsmywa.in-error_log
CustomLog logs/www.devopsmyway.in-access_log common
ServerAdmin [email protected]
DocumentRoot /var/www/html/devopsmyway.net
ServerName www.devopsmyway.net
ErrorLog logs/www.devopsmyway.net-error_log
CustomLog logs/www.devopsmyway.net-access_log common
Again check your configuration, restart the httpd service and browse both the sites using the curl command.
I hope you enjoyed this tutorial and learned to launch Apache http Server on AWS . If you think this is really helpful, please do share my website https://devopsmyway.com to others as well. I will continue for the tutorial for Apache in my next blog. Also, please give your valuable feedback in the comment box.
If you think we helped you or just want to support us, please consider these:-
Connect to us: Facebook | Twitter
This tutorial explains about Apache HTTP Server( Apache Web Server) Installation. Let us learn about what Apache HTTP Server is and how to install and configure it on a Linux Machine.
Apache http Server
Apache is a very well known open-source Web Server. It is not only popular but also very old Web Server. Like any other Web Servers, Apache also accepts requests from the clients, search for the requested queries and then send the response back to them.
Also Read : How to install Anaconda on Linux
&& Install Redis on Linux from source
Apache HTTP Server Installation
Step 1- Update your Linux Box
It targets to speed up your Mac by releasing memory. It presents both Free and Used memory information. Once clicking the Clean button at the bottom center part of the window, you will get more available memory to start your applications faster. However, you are not recommended to release it. Aside from the unnerving 'Your computer is low on memory' message, the popup additionally says, 'To free up some memory, please close a few applications'. The average Mac user's natural response to such a dialog is to take a look at the current CPU and memory. Free Up Memory on Mac. In case you do not have enough memory for better performance, here are some methods how to free up ram mac. Launch the Terminal application, which is the default app on every Mac. Enter the following command: sudo purge. The next step is to enter a password, after that your inactive memory will be cleared.
$ yum update -y
Step 2- Install Apache Web Server
$ yum install httpd -y
Step 3- Start httpd service
$ service httpd start
Step 5- check the httpd service status
18 speed truck transmission for sale. $ service httpd status
Step 6- Run chkconfig command to run the httpd service automatically after a system reboot
$ chkconfig httpd on
Step 7- To browse website from the Internet, open port 80 for http and 443 for https in your Server firewall , Network Firewall and Security Group (If using AWS or any other cloud service)
Now your Apache-Server is installed and ready.
Configuring Apache HTTP Server
Let us understand the ApacheHtTTPServer step by step from basic to advanced.
As soon as your installation is done and port is opened in the security group, without doing any configuration change just enter the public IP in the web browser of any computer. You will see the default page as shown below.
To access the server from your domain name, create A record for your web server in your DNS zone configuration.If you are not managing your DNS Server please take help of your DNS team/IT Team to do so.
I have created A record for my domain as follows:
devopsmyway.in ————–> IP Address of my Server.
Now I can browse the Apache Web Server from my domain name i.e devopsmyway.in. The same test page will come as I did not change any configuration yet.
Apache Http Server Uninstall
Basic Configuration of Apache HTTP Server
Let's do some basic changes to open your Web Server (Web Site) as per your configuration.
Create an index.html file in '/var/www/html' directory and write some content in this to serve in the web browser. I am using echo command here to create and write content in index.html.
$ echo 'Hello , Welcome to Devopsmyway.in ' > /var/www/html/index.html
As soon as you create and write content in index.html file in Document Directory'/var/www/html' your website will start serving the content written in index.html.
Now we have done the basic configuration of Apache Web Server. Let us move ahead and learn some advanced settings.
Virtual Host
Virtual host comes into picture when you want to host multiple Websites on a Single Server. Virtual host are of two types:
- Name-based virtual host
- IP based virtual host
Name-based Virtual Host
Apache Http Server Tutorial
Name-based Virtual Host is used to configure multiple websites on a Single Server having a single IP Address. To configure Name-based Virtual hosts we need to do configuration changes in Apache Configuration file.
Apache Configuration file : /etc/httpd/conf/httpd.conf
Let us configure two websites www.devopsmyway.in and www.devopsmyway.net on the same Server with same IP address. To do so , open /etc/http/conf/httpd.conf and add the following lines at the bottom of the file.
$ vi /etc/httpd/conf/httpd.conf
ServerAdmin [email protected]
DocumentRoot /var/www/html/devopsmyway.in
ServerName www.devopsmyway.in
ErrorLog logs/www.devopsmywa.in-error_log
CustomLog logs/www.devopsmyway.in-access_log common
ServerAdmin [email protected]
DocumentRoot /var/www/html/devopsmyway.net
ServerName www.devopsmyway.net
ErrorLog logs/www.devopsmyway.net-error_log
CustomLog logs/www.devopsmyway.net-access_log common
Now Create to Directories as follows:
Failed To Start The Apache Http Server
$ mkdir -p /var/www/html/devopmyway.net
$ mkdir -p /var/www/html/devopmyway.in
Create index.html file in each folder and add some content in it.
$ echo 'Hello , Welcome to Devopsmyway.in ' > /var/www/html/devopsmyway.in/index.html
$ echo 'Hello , Welcome to Devopsmyway.net ' > /var/www/html/devopsmyway.net/index.html
Apache Http Server Tutorial
Now check the configuration and restart the httpd service
$ httpd -t
$ service httpd restart
Note: If you donot have two websites in Public DNS , you can do host entry in /etc/hosts on the same server as follows for testing
Now you will able to browse both the URL.
IP based virtual host
IP bases virtual host is used to configure multiple websites on a Single Server with multiple IP Addresses. To configure IP-based Virtual hosts we need to do the following configuration changes in the Apache configuration file.
Let us configure two websites www.devopsmyway.in and www.devopsmyway.net on the same Server on two IP addresses. To do so , open /etc/http/conf/httpd.conf and add the following lines at the bottom of the file.
Apache Http Server Download
ServerAdmin [email protected]
DocumentRoot /var/www/html/devopsmyway.in
ServerName www.devopsmyway.in
ErrorLog logs/www.devopsmywa.in-error_log
CustomLog logs/www.devopsmyway.in-access_log common
ServerAdmin [email protected]
DocumentRoot /var/www/html/devopsmyway.net
ServerName www.devopsmyway.net
ErrorLog logs/www.devopsmyway.net-error_log
CustomLog logs/www.devopsmyway.net-access_log common
Again check your configuration, restart the httpd service and browse both the sites using the curl command.
I hope you enjoyed this tutorial and learned to launch Apache http Server on AWS . If you think this is really helpful, please do share my website https://devopsmyway.com to others as well. I will continue for the tutorial for Apache in my next blog. Also, please give your valuable feedback in the comment box.
If you think we helped you or just want to support us, please consider these:-
Apache Http Server Tutorial
Connect to us: Facebook | Twitter