Fix loading PHP extensions
This commit is contained in:
parent
c3f981c6e6
commit
2b7089c881
|
@ -1,5 +1,5 @@
|
|||
{createManagedProcess, apacheHttpd, cacheDir}:
|
||||
{instanceSuffix ? "", instanceName ? "httpd${instanceSuffix}", configFile, initialize ? "", postInstall ? ""}:
|
||||
{instanceSuffix ? "", instanceName ? "httpd${instanceSuffix}", configFile, initialize ? "", environment ? {}, postInstall ? ""}:
|
||||
|
||||
let
|
||||
user = instanceName;
|
||||
|
@ -7,7 +7,7 @@ let
|
|||
in
|
||||
createManagedProcess {
|
||||
name = instanceName;
|
||||
inherit instanceName initialize postInstall;
|
||||
inherit instanceName initialize environment postInstall;
|
||||
|
||||
process = "${apacheHttpd}/bin/httpd";
|
||||
args = [ "-f" configFile ];
|
||||
|
|
|
@ -22,7 +22,7 @@ in
|
|||
|
||||
simpleWebappApache = import ./simple-webapp-apache.nix {
|
||||
inherit createManagedProcess logDir cacheDir runtimeDir forceDisableUserChange;
|
||||
inherit (pkgs) stdenv apacheHttpd php writeTextFile;
|
||||
inherit (pkgs) stdenv runCommand apacheHttpd php writeTextFile;
|
||||
};
|
||||
|
||||
mysql = import ./mysql.nix {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{createManagedProcess, stdenv, apacheHttpd, php, writeTextFile, logDir, runtimeDir, cacheDir, forceDisableUserChange}:
|
||||
{createManagedProcess, stdenv, runCommand, apacheHttpd, php, writeTextFile, logDir, runtimeDir, cacheDir, forceDisableUserChange}:
|
||||
{instanceSuffix ? "", instanceName ? "httpd${instanceSuffix}", port ? 80, modules ? [], serverName ? "localhost", serverAdmin, documentRoot ? ./webapp, enablePHP ? false, enableCGI ? false, extraConfig ? "", postInstall ? ""}:
|
||||
|
||||
let
|
||||
|
@ -32,11 +32,23 @@ let
|
|||
++ stdenv.lib.optional enableCGI "cgi";
|
||||
|
||||
apacheLogDir = "${logDir}/${instanceName}";
|
||||
|
||||
phpIni = runCommand "php.ini"
|
||||
{
|
||||
preferLocalBuild = true;
|
||||
}
|
||||
''
|
||||
cat ${php}/etc/php.ini > $out
|
||||
cat ${php.phpIni} > $out
|
||||
'';
|
||||
in
|
||||
import ./apache.nix {
|
||||
inherit createManagedProcess apacheHttpd cacheDir;
|
||||
} {
|
||||
inherit instanceName postInstall;
|
||||
environment = stdenv.lib.optionalAttrs enablePHP {
|
||||
PHPRC = phpIni;
|
||||
};
|
||||
|
||||
initialize = ''
|
||||
mkdir -m0700 -p ${apacheLogDir}
|
||||
|
|
Loading…
Reference in New Issue