Mediawiki, httpd.conf ServerName empty, httpd service fails

I have made a configuration for services.mediawiki but when I run nixos-rebuild switch, the httpd service fails because ServerName is listed in httpd.conf, but it doesn’t have an address to go with it. I cannot figure out how to either remove the unused ServerName.


ServerRoot /nix/store/rbkdwyxp8qwlnxs25agv027y1sbjm5l1-apache-httpd-2.4.54
DefaultRuntimeDir /run/httpd/runtime

PidFile /run/httpd/

# mod_cgid requires this.
ScriptSock /run/httpd/cgisock

<IfModule prefork.c>
    MaxClients           150
    MaxRequestsPerChild  0

Listen *:443 https
Listen *:80 http

User wwwrun
Group wwwrun



{ config, pkgs, ... }:


  services.httpd.enable = true;

  services.mediawiki.enable = true;
  services.mediawiki.passwordFile = pkgs.writeText "password" ''**********'';
  services.mediawiki.virtualHost = 
    hostName = "****";
    adminAddr = "****";
    addSSL = true;
    sslServerCert = "/run/keys/mediawiki/self-signed.cert";
    sslServerKey = "/run/keys/mediawiki/self-signed.key";


Any help would be appreciated.

1 Like

According to nixpkgs/default.nix at 170e39462b516bd1475ce9184f7bb93106d27c59 · NixOS/nixpkgs · GitHub you need to set networking.hostName in your configuration.

1 Like

That worked. Thanks very much.

1 Like