1

One of my sites has a URL that is currently giving a 500 error, and I happened to notice that it says to contact the server administrator at a wacky email address. I am using WHM and cPanel to run several different virtual hosts on a single machine, and I'd like to set it in a way so that it won't be overwritten when some other change is made via those. And, preferably, for all virtual hosts in a single place, rather than individually for each (I want to use the same admin email address for all of them).

I went to update it to something meaningful, but I've thus far been unable to even find how it's being set. I believe I've found where it's being set: There's a cp_errordocument.shtml thing which is sourced into various error pages, and it seems to be using $SERVER_ADMIN -- presumably an environment variable? -- to populate the displayed email address.

When I log in at the command line, $SERVER_ADMIN is unset (or maybe empty).

In WHM, under "Home" / "Server Configuration" / "Basic WebHost Manager Setup" / "Contact Information", I have set both "one or more email addresses to contact in case a problem arises with this server" and "one or more cellular phone or pager email addresses to message via email in case a problem arises with this server" to the appropriate email address. This did not help.

Also did so under "Home" / "Server Contacts" / "Contact Manager" / "Email". Also did not help.

"Home" / "Service Configuration" / "Apache Configuration" / "Include Editor": I put a ServerAdmin directive into each of the three files pre_main_global.conf, pre_virtualhost_global.conf, and post_virtualhost_global.conf. Did not help.

Also in those three files, I tried putting SetEnv directives for SERVER_ADMIN. WHM errored out on this attempt.

I've tried a bunch of other things that I forget, and have spent considerable time poking around all sorts of settings in both WHM and cPanel, plus searching online, all to no avail.

I've done things like restarting Apache.

I should note that I do not absolutely know that the message is coming from cp_errordocument.shtml, but the contents of that file sure look like they'd produce the output.

Anybody know how I can resolve this?

1 Answer 1

1

Answering my own question:

(1) Set up custom *.local template(s) in /var/cpanel/templates/apache2_4. Details here.

(2) Rebuild httpd.conf and restart Apache. Details.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.