diff options
-rw-r--r-- | nixos/modules/services/web-servers/apache-httpd/default.nix | 12 | ||||
-rw-r--r-- | pkgs/servers/http/apache-modules/mod_perl/default.nix | 25 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
3 files changed, 39 insertions, 0 deletions
diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix index 2d71bcc0c79a..84c608ca2ab1 100644 --- a/nixos/modules/services/web-servers/apache-httpd/default.nix +++ b/nixos/modules/services/web-servers/apache-httpd/default.nix @@ -16,6 +16,8 @@ let phpMajorVersion = head (splitString "." php.version); + mod_perl = pkgs.mod_perl.override { apacheHttpd = httpd; }; + defaultListen = cfg: if cfg.enableSSL then [{ip = "*"; port = 443;}] else [{ip = "*"; port = 80;}]; @@ -76,6 +78,7 @@ let robotsEntries = ""; startupScript = ""; enablePHP = false; + enablePerl = false; phpOptions = ""; options = {}; documentRoot = null; @@ -355,6 +358,7 @@ let ++ map (name: {inherit name; path = "${httpd}/modules/mod_${name}.so";}) apacheModules ++ optional mainCfg.enableMellon { name = "auth_mellon"; path = "${pkgs.apacheHttpdPackages.mod_auth_mellon}/modules/mod_auth_mellon.so"; } ++ optional enablePHP { name = "php${phpMajorVersion}"; path = "${php}/modules/libphp${phpMajorVersion}.so"; } + ++ optional enablePerl { name = "perl"; path = "${mod_perl}/modules/mod_perl.so"; } ++ concatMap (svc: svc.extraModules) allSubservices ++ extraForeignModules; in concatMapStrings load allModules @@ -415,6 +419,8 @@ let enablePHP = mainCfg.enablePHP || any (svc: svc.enablePHP) allSubservices; + enablePerl = mainCfg.enablePerl || any (svc: svc.enablePerl) allSubservices; + # Generate the PHP configuration file. Should probably be factored # out into a separate module. @@ -579,6 +585,12 @@ in ''; }; + enablePerl = mkOption { + type = types.bool; + default = false; + description = "Whether to enable the Perl module (mod_perl)."; + }; + phpOptions = mkOption { type = types.lines; default = ""; diff --git a/pkgs/servers/http/apache-modules/mod_perl/default.nix b/pkgs/servers/http/apache-modules/mod_perl/default.nix new file mode 100644 index 000000000000..04746d678c52 --- /dev/null +++ b/pkgs/servers/http/apache-modules/mod_perl/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchurl, apacheHttpd, perl }: + +stdenv.mkDerivation rec { + name = "mod_perl-2.0.10"; + + src = fetchurl { + url = "mirror://apache/perl/${name}.tar.gz"; + sha256 = "0r1bhzwl5gr0202r6448943hjxsickzn55kdmb7dzad39vnq7kyi"; + }; + + buildInputs = [ apacheHttpd perl ]; + buildPhase = '' + perl Makefile.PL \ + MP_APXS=${apacheHttpd.dev}/bin/apxs + make + ''; + installPhase = '' + mkdir -p $out + make install DESTDIR=$out + mv $out${apacheHttpd}/* $out + mv $out${apacheHttpd.dev}/* $out + mv $out${perl}/* $out + rm $out/nix -rf + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a980ab663876..4261200ad6c7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10005,6 +10005,8 @@ in mod_evasive = callPackage ../servers/http/apache-modules/mod_evasive { }; + mod_perl = callPackage ../servers/http/apache-modules/mod_perl { }; + mod_fastcgi = callPackage ../servers/http/apache-modules/mod_fastcgi { }; mod_python = callPackage ../servers/http/apache-modules/mod_python { }; |