Apache UseCanonicalName Directive

The value passed to the UseCanonicalName configuration directive in Apache HTTPD Web server determines how Apache will internally create a “self-referential” URL for itself. A self-referential URL or the canonical server name is one that httpd uses to refer to itself in different cases. What cases ? For instance the SERVER_NAME and SERVER_PORT environment variables […]

What is the Apache Default Virtual Host Server ?

When there are multiple name-based virtual hosts defined in a particular Apache web server setup, the first one by appearance-order or the order in which the virtual host blocks were defined, is also known as the default server or primary server. Why is that ? Because when a client connection or incoming request is received […]

Apache IP-Based vs Name-Based Virtual Hosts

In order to understand what are IP-based and Name-based virtual hosts in Apache HTTPD web server and the differences between them, you must completely understand what virtual hosts are and how are they defined using the <VirtualHost> directive. If you’re already aware then continue reading, otherwise I’d recommend you to go through the guide to […]

A Guide to Apache Virtual Hosts

The default functionality of a brand new Apache web server (httpd) installation is driven by its main server configuration settings. What kind of functionality ? For example on booting up, which address and port should the daemon bind to or listen on for connections, which files should be served to incoming requests, what system user […]

Apache Listen: Binding to IP Addresses and Ports

When the Apache HTTPD web server starts, it must bind to a certain IP address and port on the machine so that it can start accepting (or listening) to incoming HTTP requests. How does it know which network interface and port to bind on ? This must be specified in the main server configuration using […]

Where can I find Apache Server Main Configuration and Virtual Host Configuration Files ?

I’ve already written about how to find Apache server’s main configuration (httpd.conf or apache2.conf) and virtual host configuration files by yourself in the following articles: Apache Web Server (HTTPD) Find Location Path to Main Server Configuration Find the Location of Apache Web Server Configuration Files in Unix Like Systems But I thought maybe I should […]

Apache Main Server vs Virtual Server

When working with the Apache HTTPD web server, it is essential to understand the concept of main server and virtual servers, along with the differences between them. What is the main server ? As an HTTP web server, the job of Apache is to serve incoming HTTP requests. This behaviour and functionality of the server […]

Apache Root Directory (DocumentRoot)

Apache root directory or web root directory is the folder location on the filesystem that the web server uses to serve files from, for a given request. It can be specified inside the <VirtualHost> block/container or outside it (main server config) using the DocumentRoot directive. From the documentation: This directive sets the directory from which httpd will […]

Apache Find Default or Main DocumentRoot

When using the Apache HTTPD web server, a request is served by the matching <VirtualHost> block specified in the configuration. The DocumentRoot directive inside a virtual host allows us to specify how we want a request to be served or handled. Through this directive we’re able to map the request URI to a filesystem document […]