Apache2 Http Server



  1. Apache Server Windows
  2. Apache Http Server Version 2.4 Exploit
  3. Apache Http Server Iso

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

  1. To configure SSL, Apache HTTP must be compiled with modssl. I’ll use CentOS 7 VM from Digital Ocean to demonstrate this. Login to Linux server with root and download the latest version of Apache wget http://www-us.apache.org/dist//httpd/httpd-2.4.25.tar.gz.
  2. I am trying to create a web server on my ubuntu 18.04 so i installed Apache2 but i can't start it. Here's what appeared when i run the systemctl status apache2.service command apache2.service.

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.

First, log into your Ubuntu 20.04 system and update your system packages using the following apt. A virtual machine instance on Google Compute Engine can be controlled like any standard Linux server. Deploy a simple Apache web server to learn the basics of running a server on a virtual machine.

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.

Apache http server benchmarking tool

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:

  1. Name-based virtual host
  2. 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

Apache Server Windows

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

<VirtualHost 172.31.22.60:80>
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
</VirtualHost>

<VirtualHost 172.31.22.60:80>
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
</VirtualHost>

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.

<VirtualHost 172.31.22.60:80>
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
</VirtualHost>

<VirtualHost 172.31.27.122:80>
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
</VirtualHost>

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

The Apache HTTP Server—known as Apache web server or simply Apache—is considered the standard for general-purpose HTTP activities and services. It offers a wide range of modules to deliver optimum flexibility in support of URL rewriting, proxy servers, and granular access management and control. Apache is a popular choice among web developers because it uses CGI, embedded interpreters, and FastCGI to support server-side scripting. This allows for the rapid and effective execution and implementation of highly dynamic coding.

There are plenty of well-known Apache alternatives—nginx, XAMPP, Caddy, and Microsoft IIS, among many others—but none of them offer the same breadth of usage provided by Apache. Apache is so widely used it has more than a 50% share in the commercial web server marketplace. It’s especially popular for use with Unix-like operating systems, although it supports most platforms. This includes Windows, OS X, OS/2, and others.

A Simple Definition of Apache
How to Set Up Apache Server
How to Set Up Apache Server in Linux
How to Set Up Apache Virtual Servers
The Best Apache Server Monitoring Tool

However, Apache’s flexibility and breadth of usage come at the expense of simplicity in many cases. The configuration structure is complex, and many of the advanced functionalities are difficult to use. This Apache server tutorial will explain the basics of Apache, providing instructions for Apache web server configuration in Linux, step by step. The aim is to help you not only set up Apache server, but also monitor it. My recommended tool for this purpose is SolarWinds® Server & Application Monitor for Apache.

A Simple Definition of Apache

Apache is a process-based, modular, open-source web server application designed to establish a new thread for each connection occurring simultaneously. Apache supports a range of functionalities, covering everything from authentication mechanisms to server-side programming languages. It also supports virtual hosting, allowing you to use one Apache web server to serve multiple websites. Most Apache capabilities are delivered as individual modules, allowing you to extend and enhance Apache’s core utilities.

How to Set Up Apache Server

You may find yourself becoming overwhelmed as you start to set up Apache server. As an open source, advanced application capable of a wide range of functions, Apache web server configuration and setup is fairly complex.

You can install and set up Apache server in two ways.

  1. Vendor-based installation. As it’s an open source web application, anyone can make an installer to suit their individual environment. Vendors like Red Hat, SUSE, and Debian have used this capability to customize Apache server configuration and file location by taking the base operating system and other installed programs into account.
  2. Source code installation. The alternative to using a vendor-based installer is to set up Apache server by building and installing directly from the source code. This approach enables you to set up Apache server in platform-independent manner available for all operating systems.

With both installation options, modules can be compiled in the form of a dynamic shared object, or DSO. A DSO is an object file capable of being shared and utilized by numerous applications. DSO modules are separate from the core Apache file. The DSO approach to compiling modules is popular because it makes adding, updating, and removing modules easy.

How to Set Up Apache Server in Linux

This Apache server tutorial will now provide instructions for Apache web server configuration in Linux, step by step.

  1. Update your system repositories. This involves downloading the most recent version of a software by updating the Ubuntu repositories’ local package index. To do this, go to the terminal and enter the command “$ sudo apt update” into it.
  2. Install Apache by using the “apt” command. For this example, let’s use Apache2. Just input the following command— “$ sudo apt install apache2” —as sudo, which will install Apache2 and all necessary dependencies. At this stage, you may be asked whether you want to continue the installation process. Enter “Y” to indicate you would like to, and installation will begin.
  3. Verify Apache has been successfully installed. When the installation procedure has finished, check the version number to confirm Apache2 is now installed on your system. Enter “$ apache2 -version” to do this. The server version will appear, hopefully confirming Apache2 has been installed.

How to Set Up Apache Virtual Servers

When using virtual hosts, it’s important to undertake virtual server Apache configuration. Modifying configuration settings will ensure they reflect the domain specifics, which will allow Apache to respond to domain requests correctly and successfully. The process for completing virtual server Apache configuration is simple:

  1. First, input “$ sudo nano /etc/apache2/sites-available/example.com.conf” to open your virtual host configuration file.
  2. Replace “example.com” appropriately. Next, you’ll be able to modify the following:
    ServerName example.com
    ServerAdmin admin@example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/example.com/public_htmlAgain, be sure to replace all example components with the appropriate information. When modified, the end result should resemble the following:
    <VirtualHost *:80>
    ServerName example.com
    ServerAdmin admin@example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/example.com/public_html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>
  3. If an error occurs, reference these instructions to ensure nothing has been mistyped or inputted incorrectly.
Http

Best Apache Server Monitoring Tool

After setting up Apache web server, I highly recommend the use of a monitoring tool to help you test Apache server and monitor it effectively. There are several such tools on the market, but SolarWinds Server & Application Monitor (SAM) tops my list. This tool allows you to easily define specific performance metrics to facilitate proactive monitoring of Apache Cassandra, Apache Geronimo, and Apache Tomcat. The single application is capable of monitoring and managing your entire Apache environment, and the underlying infrastructure of the server.

With SAM, monitoring uptime and performance is easy, as is diagnosing the root of performance issues. The application facilitates proactive monitoring of all web server supporting components contributing to the Apache web server, including Linux and MySQL. Application monitoring covers the virtual layer, servers, and applications like Microsoft SQL Server, Exchange, and Active Directory. The system benefits from customizable alerts, reports, and easy-to-navigate dashboards ready to use out of the box. This means you can get up and running when SAM is installed, without having to create or modify dashboards.

The dashboards themselves have been cleverly designed, with data represented in the form of graphs and charts whenever appropriate, to give you immediate insight into key metrics and information without overloading or cluttering the interface.

Apache Http Server Version 2.4 Exploit

SAM is a scalable and highly feature-rich application, requiring zero training or experience to start using, and is suitable for extensive enterprise-grade requirements. The user-friendly interface is one of SAM’s best features, as it makes data interpretation dynamic and accurate. This program simplifies the Apache monitoring experience, allowing you to test and interrogate it in a few simple clicks. The implementation process is simple, and SolarWinds support technicians are available on a 24/7 basis.

Apache Http Server Iso

With the unified, centralized dashboard and ample support offered by SolarWinds, using this application couldn’t be easier. SolarWinds SAM also serves as a wider application and server monitoring solution, with its monitoring capabilities extending to Active Directory, agentless servers, application dependency, AWS, Azure IaaS, and much more. What’s great is you can download a no-risk 30-day free trial to try out the fully featured software before making a commitment.





Comments are closed.