Benefits of ServerAdmin Directive in Apache2

Enrique Moreno Tent picture Enrique Moreno Tent · Feb 15, 2014 · Viewed 13.2k times · Source

How exactly can the ServerAdmin directive in Apache2 be useful?

The Apache2 documentation reads:

The ServerAdmin sets the contact address that the server includes in any error messages it returns to the client.

But whenever I get a 404 Error back, the email address set in my vhost is nowhere to be seen. Do I need some extra Directive to make it work?

vhost:

<VirtualHost *:8080>
    ServerAdmin [email protected]
    ServerName testsite.example.com
    DocumentRoot /var/www/example.com/www
</VirtualHost>

Answer

Joe T picture Joe T · Aug 4, 2014

Apparently that functionality of Apache has been deprecated. I used to see a message in the event of an error to contact the server administrator, but now can't get it to happen on the current versions.

As an answer to your question "how can it be useful"; you can get the value with PHP at least $_SERVER['SERVER_ADMIN'] and return that from your code in the event of an error.