Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Benefits of ServerAdmin Directive in Apache2

Tags:

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> 
like image 563
Enrique Moreno Tent Avatar asked Feb 15 '14 13:02

Enrique Moreno Tent


People also ask

What is ServerAdmin in apache2?

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

What is directive in Apache configuration?

Apache directives are a set of rules which define how your server should run, the number of clients that can access your server, etc. you can configure them by using the apache2. conf or httpd. conf files.

Is apache2 Conf the same as httpd conf?

Apache is configured by placing configuration directives, such as Listen and ServerName , into a configuration file, which will be read by the Apache executable during the startup. The default configuration file is called " httpd. conf " (or " apache2. conf ") in the directory " <APACHE_HOME>\conf ".

Which directive controls the HTTP port for the Apache Web server?

Listen. The Listen command identifies the ports on which the Web server accepts incoming requests. By default, the Apache HTTP Server is set to listen to port 80 for non-secure Web communications and (in the /etc/httpd/conf.


1 Answers

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.

like image 95
Joe T Avatar answered Sep 17 '22 18:09

Joe T