If you do not already have Apache installed, you can do so now by issuing the following commands:
sudo apt-get update
sudo apt-get install apache2
This is all that is necessary to have a working web server. If you visit your VPS's IP
address in a web browser, you will get the default Apache index page:
This is the default web page for this server.
The web server software is running but no content has been added, yet.
The Apache File Hierarchy in Ubuntu and Debian
On Ubuntu and Debian, Apache keeps its main configuration files within the "/etc/apache2" folder:
apache2.conf envvars magic mods-enabled/ sites-available/
conf.d/ httpd.conf mods-available/ ports.conf sites-enabled/
Looking at the Apache2.conf File
The main configuration details for your Apache server are held in the "/etc/apache2/apache2.conf" file.
This file is divided into three main sections: configuration for the global Apache server process, configuration for the default server, and configuration of Virtual Hosts.
In Ubuntu and Debian, the majority of the file is for global definitions, and the configuration of the default server and virtual hosts is handled at the end, by using the "Include ..." directive.
The "Include" directive allows Apache to read other configuration files into the current file at the location that the statement appears. The result is that Apache dynamically generates an overarching configuration file on startup.
If you scroll to the bottom of the file, there are a number of different "Include" statements. These load module definitions, the ports.conf document, the specific configuration files in the "conf.d/" directory, and finally, the Virtual Host definitions in the "sites-enabled/" directory.
We will focus on the first part of the file to learn how Apache defines its global settings.
I hope it works for you