Apache server - Terms Used to Describe Directives
Apache server - Terms Used to Describe Directives
Have you sometime a question what is url, url-path, file-path, regex, mime-type and more? The answer is in this article. We describe a basic terms used to describe apache webserver directives.
Directives use a great number of different argument types. A few common ones are defined below.
URL
A complete Uniform Resource Locator including a scheme, hostname, and optional pathname as in http://www.example.com/path/to/file.html/
URL-PATH
The part of a url which follows the scheme and hostname as in /path/to/file.html
. The url-path represents a web-view of a resource, as opposed to a file-system view.
file-path
The path to a file in the local file-system beginning with the root directory as in /usr/local/apache/htdocs/path/to/file.html
. Unless otherwise specified, a file-path which does not begin with a slash will be treated as relative to the ServerRoot
.
directory-path
The path to a directory in the local file-system beginning with the root directory as in /usr/local/apache/htdocs/path/to/
.
filename
The name of a file with no accompanying path information as in file.html
.
regex
A Perl-compatible regular expression – pcre . The directive definition will specify what the regex is matching against
extension
In general, this is the part of the filename which follows the last dot. However, Apache recognizes multiple filename extensions, so if a filename contains more than one dot, each dot-separated part of the filename following the first dot is an extension. For example, the filename file.html.en
contains two extensions: .html
and .en
. For Apache directives, you may specify extensions with or without the leading dot. In addition, extensions are not case sensitive.
MIME-type
A method of describing the format of a file which consists of a major format type and a minor format type, separated by a slash as in text/html
.
env-variable
The name of an environment variable defined in the Apache configuration process. Note this is not necessarily the same as an operating system environment variable. See the environment variable documentation for more details.
Configuration changes in apache2 webserver
We can make individual configuration changes for (sub)domain in two ways:
Configuration File
of (sub)domain
Changes in configuration file make directly administrator writing configuration to config file. Advatages is a better security and better performance. Disadvatage is less flexibile in configuration changes when you have a web site in hosting company.
.htaccess
config file
configuration changes is writing to file with name .htaccess
which is loaded on server in our appliacation directory or subdirectory. Working with .htaccess
is primary for users, that have a access to filesystem. Using .htacces must be enabled in configuration file
of (sub)domain.
.htaccess
file has precedence over configurationn file
with one important exeption - this is mod_rewrite
.