Index: /trunk/server/fedora/config/etc/httpd/export-scripts-certs
===================================================================
--- /trunk/server/fedora/config/etc/httpd/export-scripts-certs	(revision 2812)
+++ /trunk/server/fedora/config/etc/httpd/export-scripts-certs	(revision 2813)
@@ -26,4 +26,5 @@
 
 cert_filenames = set()
+error = False
 
 def conf(vhost):
@@ -42,4 +43,11 @@
         os.rename(cert_path + '.new', cert_path)
 
+    key_path = os.path.join('/etc/pki/tls/private', key_filename)
+    if not os.path.exists(key_path):
+        sys.stderr.write("Error: key file {} does not exist for vhost {}\n".format(key_path, name))
+        global error
+        error = True
+        return
+
     for port in 443, 444:
         yield '<VirtualHost *:{}>\n'.format(port)
@@ -52,5 +60,5 @@
             yield '\tInclude conf.d/vhosts-common-ssl-cert.conf\n'
         yield '\tSSLCertificateFile {}\n'.format(cert_path)
-        yield '\tSSLCertificateKeyFile {}\n'.format(os.path.join('/etc/pki/tls/private', key_filename))
+        yield '\tSSLCertificateKeyFile {}\n'.format(key_path)
         yield '</VirtualHost>\n'
 
@@ -63,2 +71,4 @@
     if filename.endswith('.pem') and filename not in cert_filenames:
         os.remove(os.path.join(CERTS_DIR, filename))
+
+sys.exit(1 if error else 0)
