Convert "httpd" and "apache-httpd"
svn path=/nixos/branches/fix-style/; revision=14382
This commit is contained in:
parent
e95773a38f
commit
e7b7d62777
@ -479,202 +479,6 @@ in
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
httpd = {
|
|
||||||
|
|
||||||
enable = mkOption {
|
|
||||||
default = false;
|
|
||||||
description = "
|
|
||||||
Whether to enable the Apache httpd server.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
experimental = mkOption {
|
|
||||||
default = false;
|
|
||||||
description = "
|
|
||||||
Whether to use the new-style Apache configuration.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
extraConfig = mkOption {
|
|
||||||
default = "";
|
|
||||||
description = "
|
|
||||||
These configuration lines will be passed verbatim to the apache config
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
extraModules = mkOption {
|
|
||||||
default = [];
|
|
||||||
example = [ "proxy_connect" { name = "php5_module"; path = "${pkgs.php}/modules/libphp5.so"; } ];
|
|
||||||
description = ''
|
|
||||||
Specifies additional Apache modules. These can be specified
|
|
||||||
as a string in the case of modules distributed with Apache,
|
|
||||||
or as an attribute set specifying the
|
|
||||||
<varname>name</varname> and <varname>path</varname> of the
|
|
||||||
module.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
logPerVirtualHost = mkOption {
|
|
||||||
default = false;
|
|
||||||
description = "
|
|
||||||
If enabled, each virtual host gets its own
|
|
||||||
<filename>access_log</filename> and
|
|
||||||
<filename>error_log</filename>, namely suffixed by the
|
|
||||||
<option>hostName</option> of the virtual host.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
user = mkOption {
|
|
||||||
default = "wwwrun";
|
|
||||||
description = "
|
|
||||||
User account under which httpd runs. The account is created
|
|
||||||
automatically if it doesn't exist.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
group = mkOption {
|
|
||||||
default = "wwwrun";
|
|
||||||
description = "
|
|
||||||
Group under which httpd runs. The account is created
|
|
||||||
automatically if it doesn't exist.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
logDir = mkOption {
|
|
||||||
default = "/var/log/httpd";
|
|
||||||
description = "
|
|
||||||
Directory for Apache's log files. It is created automatically.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
stateDir = mkOption {
|
|
||||||
default = "/var/run/httpd";
|
|
||||||
description = "
|
|
||||||
Directory for Apache's transient runtime state (such as PID
|
|
||||||
files). It is created automatically. Note that the default,
|
|
||||||
<filename>/var/run/httpd</filename>, is deleted at boot time.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
mod_php = mkOption {
|
|
||||||
default = false;
|
|
||||||
description = "Whether to enable the PHP module.";
|
|
||||||
};
|
|
||||||
|
|
||||||
mod_jk = {
|
|
||||||
enable = mkOption {
|
|
||||||
default = false;
|
|
||||||
description = "Whether to enable the Apache Tomcat connector.";
|
|
||||||
};
|
|
||||||
|
|
||||||
applicationMappings = mkOption {
|
|
||||||
default = [];
|
|
||||||
description = "List of Java webapplications that should be mapped to the servlet container (Tomcat/JBoss)";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualHosts = mkOption {
|
|
||||||
default = [];
|
|
||||||
example = [
|
|
||||||
{ hostName = "foo";
|
|
||||||
documentRoot = "/data/webroot-foo";
|
|
||||||
}
|
|
||||||
{ hostName = "bar";
|
|
||||||
documentRoot = "/data/webroot-bar";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
description = ''
|
|
||||||
Specification of the virtual hosts served by Apache. Each
|
|
||||||
element should be an attribute set specifying the
|
|
||||||
configuration of the virtual host. The available options
|
|
||||||
are the non-global options permissible for the main host.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
subservices = {
|
|
||||||
|
|
||||||
# !!! remove this
|
|
||||||
subversion = {
|
|
||||||
|
|
||||||
enable = mkOption {
|
|
||||||
default = false;
|
|
||||||
description = "
|
|
||||||
Whether to enable the Subversion subservice in the webserver.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
notificationSender = mkOption {
|
|
||||||
default = "svn-server@example.org";
|
|
||||||
example = "svn-server@example.org";
|
|
||||||
description = "
|
|
||||||
The email address used in the Sender field of commit
|
|
||||||
notification messages sent by the Subversion subservice.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
userCreationDomain = mkOption {
|
|
||||||
default = "example.org";
|
|
||||||
example = "example.org";
|
|
||||||
description = "
|
|
||||||
The domain from which user creation is allowed. A client can
|
|
||||||
only create a new user account if its IP address resolves to
|
|
||||||
this domain.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
autoVersioning = mkOption {
|
|
||||||
default = false;
|
|
||||||
description = "
|
|
||||||
Whether you want the Subversion subservice to support
|
|
||||||
auto-versioning, which enables Subversion repositories to be
|
|
||||||
mounted as read/writable file systems on operating systems that
|
|
||||||
support WebDAV.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
dataDir = mkOption {
|
|
||||||
default = "/no/such/path/exists";
|
|
||||||
description = "
|
|
||||||
Place to put SVN repository.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
organization = {
|
|
||||||
|
|
||||||
name = mkOption {
|
|
||||||
default = null;
|
|
||||||
description = "
|
|
||||||
Name of the organization hosting the Subversion service.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
url = mkOption {
|
|
||||||
default = null;
|
|
||||||
description = "
|
|
||||||
URL of the website of the organization hosting the Subversion service.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
logo = mkOption {
|
|
||||||
default = null;
|
|
||||||
description = "
|
|
||||||
Logo the organization hosting the Subversion service.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // # Include the options shared between the main server and virtual hosts.
|
|
||||||
(import ../upstart-jobs/apache-httpd/per-server-options.nix {
|
|
||||||
inherit mkOption;
|
|
||||||
forMainServer = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
vsftpd = {
|
vsftpd = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
@ -1256,6 +1060,8 @@ in
|
|||||||
(import ../upstart-jobs/ejabberd.nix) # untested, dosen't compile on x86_64-linux
|
(import ../upstart-jobs/ejabberd.nix) # untested, dosen't compile on x86_64-linux
|
||||||
(import ../upstart-jobs/jboss.nix)
|
(import ../upstart-jobs/jboss.nix)
|
||||||
(import ../upstart-jobs/tomcat.nix) # untested, too lazy to get that jdk
|
(import ../upstart-jobs/tomcat.nix) # untested, too lazy to get that jdk
|
||||||
|
(import ../upstart-jobs/httpd.nix) # Apache httpd (probably this can be removed ?)
|
||||||
|
(import ../upstart-jobs/apache-httpd) # Apache httpd (new style).
|
||||||
|
|
||||||
# nix
|
# nix
|
||||||
(import ../upstart-jobs/nix.nix) # nix options and daemon
|
(import ../upstart-jobs/nix.nix) # nix options and daemon
|
||||||
|
@ -1,6 +1,209 @@
|
|||||||
{config, pkgs}:
|
{pkgs, config, ...}:
|
||||||
|
|
||||||
|
###### interface
|
||||||
let
|
let
|
||||||
|
inherit (pkgs.lib) mkOption mkIf;
|
||||||
|
|
||||||
|
options = {
|
||||||
|
services = {
|
||||||
|
httpd = {
|
||||||
|
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = "
|
||||||
|
Whether to enable the Apache httpd server.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
experimental = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = "
|
||||||
|
Whether to use the new-style Apache configuration.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = mkOption {
|
||||||
|
default = "";
|
||||||
|
description = "
|
||||||
|
These configuration lines will be passed verbatim to the apache config
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraModules = mkOption {
|
||||||
|
default = [];
|
||||||
|
example = [ "proxy_connect" { name = "php5_module"; path = "${pkgs.php}/modules/libphp5.so"; } ];
|
||||||
|
description = ''
|
||||||
|
Specifies additional Apache modules. These can be specified
|
||||||
|
as a string in the case of modules distributed with Apache,
|
||||||
|
or as an attribute set specifying the
|
||||||
|
<varname>name</varname> and <varname>path</varname> of the
|
||||||
|
module.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
logPerVirtualHost = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = "
|
||||||
|
If enabled, each virtual host gets its own
|
||||||
|
<filename>access_log</filename> and
|
||||||
|
<filename>error_log</filename>, namely suffixed by the
|
||||||
|
<option>hostName</option> of the virtual host.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
user = mkOption {
|
||||||
|
default = "wwwrun";
|
||||||
|
description = "
|
||||||
|
User account under which httpd runs. The account is created
|
||||||
|
automatically if it doesn't exist.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
group = mkOption {
|
||||||
|
default = "wwwrun";
|
||||||
|
description = "
|
||||||
|
Group under which httpd runs. The account is created
|
||||||
|
automatically if it doesn't exist.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
logDir = mkOption {
|
||||||
|
default = "/var/log/httpd";
|
||||||
|
description = "
|
||||||
|
Directory for Apache's log files. It is created automatically.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
stateDir = mkOption {
|
||||||
|
default = "/var/run/httpd";
|
||||||
|
description = "
|
||||||
|
Directory for Apache's transient runtime state (such as PID
|
||||||
|
files). It is created automatically. Note that the default,
|
||||||
|
<filename>/var/run/httpd</filename>, is deleted at boot time.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
mod_php = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = "Whether to enable the PHP module.";
|
||||||
|
};
|
||||||
|
|
||||||
|
mod_jk = {
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = "Whether to enable the Apache Tomcat connector.";
|
||||||
|
};
|
||||||
|
|
||||||
|
applicationMappings = mkOption {
|
||||||
|
default = [];
|
||||||
|
description = "List of Java webapplications that should be mapped to the servlet container (Tomcat/JBoss)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
virtualHosts = mkOption {
|
||||||
|
default = [];
|
||||||
|
example = [
|
||||||
|
{ hostName = "foo";
|
||||||
|
documentRoot = "/data/webroot-foo";
|
||||||
|
}
|
||||||
|
{ hostName = "bar";
|
||||||
|
documentRoot = "/data/webroot-bar";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
description = ''
|
||||||
|
Specification of the virtual hosts served by Apache. Each
|
||||||
|
element should be an attribute set specifying the
|
||||||
|
configuration of the virtual host. The available options
|
||||||
|
are the non-global options permissible for the main host.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
subservices = {
|
||||||
|
|
||||||
|
# !!! remove this
|
||||||
|
subversion = {
|
||||||
|
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = "
|
||||||
|
Whether to enable the Subversion subservice in the webserver.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
notificationSender = mkOption {
|
||||||
|
default = "svn-server@example.org";
|
||||||
|
example = "svn-server@example.org";
|
||||||
|
description = "
|
||||||
|
The email address used in the Sender field of commit
|
||||||
|
notification messages sent by the Subversion subservice.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
userCreationDomain = mkOption {
|
||||||
|
default = "example.org";
|
||||||
|
example = "example.org";
|
||||||
|
description = "
|
||||||
|
The domain from which user creation is allowed. A client can
|
||||||
|
only create a new user account if its IP address resolves to
|
||||||
|
this domain.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
autoVersioning = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = "
|
||||||
|
Whether you want the Subversion subservice to support
|
||||||
|
auto-versioning, which enables Subversion repositories to be
|
||||||
|
mounted as read/writable file systems on operating systems that
|
||||||
|
support WebDAV.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
dataDir = mkOption {
|
||||||
|
default = "/no/such/path/exists";
|
||||||
|
description = "
|
||||||
|
Place to put SVN repository.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
organization = {
|
||||||
|
|
||||||
|
name = mkOption {
|
||||||
|
default = null;
|
||||||
|
description = "
|
||||||
|
Name of the organization hosting the Subversion service.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
url = mkOption {
|
||||||
|
default = null;
|
||||||
|
description = "
|
||||||
|
URL of the website of the organization hosting the Subversion service.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
logo = mkOption {
|
||||||
|
default = null;
|
||||||
|
description = "
|
||||||
|
Logo the organization hosting the Subversion service.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
} // # Include the options shared between the main server and virtual hosts.
|
||||||
|
(import ../../upstart-jobs/apache-httpd/per-server-options.nix {
|
||||||
|
inherit mkOption;
|
||||||
|
forMainServer = true;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
mainCfg = config.services.httpd;
|
mainCfg = config.services.httpd;
|
||||||
|
|
||||||
@ -361,65 +564,75 @@ let
|
|||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
name = "httpd";
|
mkIf (config.services.httpd.enable && config.services.httpd.experimental) {
|
||||||
|
require = [
|
||||||
users = [
|
options
|
||||||
{ name = mainCfg.user;
|
|
||||||
description = "Apache httpd user";
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
groups = [
|
users = {
|
||||||
{ name = mainCfg.group;
|
extraUsers = [
|
||||||
}
|
{ name = mainCfg.user;
|
||||||
];
|
description = "Apache httpd user";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
extraGroups = [
|
||||||
|
{ name = mainCfg.group;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
extraPath = [httpd] ++ concatMap (svc: svc.extraPath) allSubservices;
|
services = {
|
||||||
|
extraJobs = [{
|
||||||
|
name = "httpd";
|
||||||
|
|
||||||
# Statically verify the syntactic correctness of the generated
|
extraPath = [httpd] ++ concatMap (svc: svc.extraPath) allSubservices;
|
||||||
# httpd.conf. !!! this is impure! It doesn't just check for
|
|
||||||
# syntax, but also whether the Apache user/group exist, whether SSL
|
|
||||||
# keys exist, etc.
|
|
||||||
buildHook = ''
|
|
||||||
echo
|
|
||||||
echo '=== Checking the generated Apache configuration file ==='
|
|
||||||
${httpd}/bin/httpd -f ${httpdConf} -t || true
|
|
||||||
'';
|
|
||||||
|
|
||||||
job = ''
|
# Statically verify the syntactic correctness of the generated
|
||||||
description "Apache HTTPD"
|
# httpd.conf. !!! this is impure! It doesn't just check for
|
||||||
|
# syntax, but also whether the Apache user/group exist, whether SSL
|
||||||
|
# keys exist, etc.
|
||||||
|
buildHook = ''
|
||||||
|
echo
|
||||||
|
echo '=== Checking the generated Apache configuration file ==='
|
||||||
|
${httpd}/bin/httpd -f ${httpdConf} -t || true
|
||||||
|
'';
|
||||||
|
|
||||||
start on ${startingDependency}/started
|
job = ''
|
||||||
stop on shutdown
|
description "Apache HTTPD"
|
||||||
|
|
||||||
start script
|
start on ${startingDependency}/started
|
||||||
mkdir -m 0700 -p ${mainCfg.stateDir}
|
stop on shutdown
|
||||||
mkdir -m 0700 -p ${mainCfg.logDir}
|
|
||||||
|
|
||||||
# Get rid of old semaphores. These tend to accumulate across
|
start script
|
||||||
# server restarts, eventually preventing it from restarting
|
mkdir -m 0700 -p ${mainCfg.stateDir}
|
||||||
# succesfully.
|
mkdir -m 0700 -p ${mainCfg.logDir}
|
||||||
for i in $(${pkgs.utillinux}/bin/ipcs -s | grep ' ${mainCfg.user} ' | cut -f2 -d ' '); do
|
|
||||||
${pkgs.utillinux}/bin/ipcrm -s $i
|
|
||||||
done
|
|
||||||
|
|
||||||
# Run the startup hooks for the subservices.
|
# Get rid of old semaphores. These tend to accumulate across
|
||||||
for i in ${toString (map (svn: svn.startupScript) allSubservices)}; do
|
# server restarts, eventually preventing it from restarting
|
||||||
echo Running Apache startup hook $i...
|
# succesfully.
|
||||||
$i
|
for i in $(${pkgs.utillinux}/bin/ipcs -s | grep ' ${mainCfg.user} ' | cut -f2 -d ' '); do
|
||||||
done
|
${pkgs.utillinux}/bin/ipcrm -s $i
|
||||||
end script
|
done
|
||||||
|
|
||||||
${
|
# Run the startup hooks for the subservices.
|
||||||
let f = {name, value}: "env ${name}=${value}\n";
|
for i in ${toString (map (svn: svn.startupScript) allSubservices)}; do
|
||||||
in concatMapStrings f (pkgs.lib.concatMap (svc: svc.globalEnvVars) allSubservices)
|
echo Running Apache startup hook $i...
|
||||||
}
|
$i
|
||||||
|
done
|
||||||
|
end script
|
||||||
|
|
||||||
env PATH=${pkgs.coreutils}/bin:${pkgs.gnugrep}/bin:${pkgs.lib.concatStringsSep ":" (pkgs.lib.concatMap (svc: svc.extraServerPath) allSubservices)}
|
${
|
||||||
|
let f = {name, value}: "env ${name}=${value}\n";
|
||||||
|
in concatMapStrings f (pkgs.lib.concatMap (svc: svc.globalEnvVars) allSubservices)
|
||||||
|
}
|
||||||
|
|
||||||
respawn ${httpd}/bin/httpd -f ${httpdConf} -DNO_DETACH
|
env PATH=${pkgs.coreutils}/bin:${pkgs.gnugrep}/bin:${pkgs.lib.concatStringsSep ":" (pkgs.lib.concatMap (svc: svc.extraServerPath) allSubservices)}
|
||||||
'';
|
|
||||||
|
|
||||||
|
respawn ${httpd}/bin/httpd -f ${httpdConf} -DNO_DETACH
|
||||||
|
'';
|
||||||
|
|
||||||
|
}];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,21 +141,6 @@ let
|
|||||||
inherit config;
|
inherit config;
|
||||||
})
|
})
|
||||||
|
|
||||||
# Apache httpd.
|
|
||||||
++ optional (config.services.httpd.enable && !config.services.httpd.experimental)
|
|
||||||
(import ../upstart-jobs/httpd.nix {
|
|
||||||
inherit config pkgs;
|
|
||||||
inherit (pkgs) glibc;
|
|
||||||
extraConfig = pkgs.lib.concatStringsSep "\n"
|
|
||||||
(map (job: job.extraHttpdConfig) jobs);
|
|
||||||
})
|
|
||||||
|
|
||||||
# Apache httpd (new style).
|
|
||||||
++ optional (config.services.httpd.enable && config.services.httpd.experimental)
|
|
||||||
(import ../upstart-jobs/apache-httpd {
|
|
||||||
inherit config pkgs;
|
|
||||||
})
|
|
||||||
|
|
||||||
# MySQL server
|
# MySQL server
|
||||||
++ optional config.services.mysql.enable
|
++ optional config.services.mysql.enable
|
||||||
(import ../upstart-jobs/mysql.nix {
|
(import ../upstart-jobs/mysql.nix {
|
||||||
|
@ -1,4 +1,14 @@
|
|||||||
{config, pkgs, glibc, extraConfig}:
|
{pkgs, config, ...}:
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
let
|
||||||
|
inherit (pkgs.lib) mkOption mkIf;
|
||||||
|
|
||||||
|
# options have been moved to the apache-httpd/default.nix file
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -21,6 +31,11 @@ let
|
|||||||
applicationMappings = cfg.mod_jk.applicationMappings;
|
applicationMappings = cfg.mod_jk.applicationMappings;
|
||||||
|
|
||||||
startingDependency = if config.services.gw6c.enable && config.services.gw6c.autorun then "gw6c" else "network-interfaces";
|
startingDependency = if config.services.gw6c.enable && config.services.gw6c.autorun then "gw6c" else "network-interfaces";
|
||||||
|
|
||||||
|
|
||||||
|
extraConfig = pkgs.lib.concatStringsSep "\n"
|
||||||
|
(pkgs.lib.catAttrs "extraHttpdConfig" config.services.extraJobs);
|
||||||
|
|
||||||
|
|
||||||
webServer = import ../../services/apache-httpd {
|
webServer = import ../../services/apache-httpd {
|
||||||
inherit (pkgs) apacheHttpd coreutils;
|
inherit (pkgs) apacheHttpd coreutils;
|
||||||
@ -32,6 +47,7 @@ let
|
|||||||
user group adminAddr logDir stateDir
|
user group adminAddr logDir stateDir
|
||||||
applicationMappings;
|
applicationMappings;
|
||||||
noUserDir = !cfg.enableUserDir;
|
noUserDir = !cfg.enableUserDir;
|
||||||
|
|
||||||
extraDirectories = extraConfig + "\n" + cfg.extraConfig;
|
extraDirectories = extraConfig + "\n" + cfg.extraConfig;
|
||||||
|
|
||||||
subServices =
|
subServices =
|
||||||
@ -72,41 +88,47 @@ let
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
/* ++
|
|
||||||
|
|
||||||
(optional cfg.extraSubservices.enable
|
|
||||||
(map (service : service webServer pkgs) cfg.extraSubservices.services)
|
|
||||||
) */;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
mkIf (config.services.httpd.enable && !config.services.httpd.experimental) {
|
||||||
name = "httpd";
|
|
||||||
|
require = [
|
||||||
users = [
|
# options have been moved to the apache-httpd/default.nix file
|
||||||
{ name = user;
|
|
||||||
description = "Apache httpd user";
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
groups = [
|
users = {
|
||||||
{ name = group;
|
extraUsers = [
|
||||||
}
|
{ name = user;
|
||||||
];
|
description = "Apache httpd user";
|
||||||
|
}
|
||||||
job = "
|
];
|
||||||
description \"Apache HTTPD\"
|
|
||||||
|
extraGroups = [
|
||||||
start on ${startingDependency}/started
|
{ name = group;
|
||||||
stop on ${startingDependency}/stop
|
}
|
||||||
|
];
|
||||||
start script
|
};
|
||||||
${webServer}/bin/control prepare
|
|
||||||
end script
|
services = {
|
||||||
|
extraJobs = [{
|
||||||
respawn ${webServer}/bin/control run
|
name = "httpd";
|
||||||
";
|
|
||||||
|
job = ''
|
||||||
|
description \"Apache HTTPD\"
|
||||||
|
|
||||||
|
start on ${startingDependency}/started
|
||||||
|
stop on ${startingDependency}/stop
|
||||||
|
|
||||||
|
start script
|
||||||
|
${webServer}/bin/control prepare
|
||||||
|
end script
|
||||||
|
|
||||||
|
respawn ${webServer}/bin/control run
|
||||||
|
'';
|
||||||
|
|
||||||
|
}];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user