Become a member!

Apache httpd.conf define syntax

What I strongly suggest to DelphiMVCFramework users is to develop your application server as console application (or VCL application if you like it) and then deploy it as Apache module (available since Delphi XE6).

Here’s some useful tips about the httpd.conf configuration

Within httpd.conf, declare your variable(s) with: Define (Preferably at the very first line)
Syntax: Define variable-name variable-value

In this manner:

# The line below creates [static_path]
Define static_path C:/codebase/snp_static

You can later use this variable like so:

ServerRoot = ${static_path}
...
DocumentRoot = ${static_path}
...
<Directory ${static_path}>
...etc.

You can even combine them:

Define server_space c:/
Define static_path codebase/snp_static
...
ServerRoot = ${server_space}${static_path}
...
DocumentRoot = ${server_space}${static_path}
...
<Directory ${server_space}${static_path}>
...etc.

Documentation: http://httpd.apache.org/docs/2.4/mod/core.html#define

Comments

comments powered by Disqus