The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Disable ServerAdmin Email in http.conf

Discussion in 'E-mail Discussions' started by Gutsmell, Dec 22, 2008.

  1. Gutsmell

    Gutsmell Member

    Joined:
    Feb 26, 2007
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Whenever an error is generated while running a Perl script, it says:
    Code:
    "For help, please send mail to the webmaster (webmaster@somedomain.com), 
    giving this error message and the time and date of the error."
    Well, this email is no longer valid because of spammers. I see the email as Server Admin for each virtual domain in http.conf. I also see it in the template at /var/cpanel/templates/apache2/vhost.default. Can I somehow comment out the:
    Code:
    webmaster@somedomain.com
    Or, is there some other way to disable it or change it. I really don't understand why this hasn't been disabled already.

    Ideas Anyone?
    Thanks!
    CentOS release 4.7 (Final)
     
  2. apscinsspl

    apscinsspl Well-Known Member

    Joined:
    Mar 15, 2008
    Messages:
    112
    Likes Received:
    0
    Trophy Points:
    16
    Hello,

    The script used for this by cpanel is:

    /usr/local/cpanel/bin/wwwacct

    but you cant edit this script as it is encrypted.

    In this case I would suggest you another solution for your existing domains.

    do as follows:

    =======================================================
    cd /etc/httpd/conf
    cat httpd.conf |grep -v "ServerAdmin webmaster@" > httpd.conf.new
    mv httpd.conf httpd.conf.orig
    mv httpd.conf.new httpd.conf
    service httpd restart
    =======================================================

    What does the above commands do:

    The above set of commands will create a exact copy of httpd.conf file by name httpd.conf.new but excluding the line starting as "ServerAdmin webmaster@".

    Then it will rename the old httpd.conf to httpd.conf.orig
    and newly created httpd.conf.new to httpd.conf
    (This will replace your httpd.conf with new)
    Then it will restart the httpd service to reflect the changes and you are done :cool:
     
  3. Gutsmell

    Gutsmell Member

    Joined:
    Feb 26, 2007
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Thank you very much for your help apscinsspl. It worked fine. Only problem is that it now displays the contact email for that account, and I always set contact email as my email when I set up an account. I don't want that one to display because I have several domain/reseller accounts. I restored the original.

    I see there is a conditional in /var/cpanel/templates/apache2/vhost.default and /var/cpanel/templates/apache2/ssl_vhost.default that appears to determine which email to display. I'm wondering if I can comment out that conditional without any consequences, since I really don't understand it anyway, and maybe it's used for other purposes with cpanel notification.

    Here is the conditional statement:

    Code:
    [% IF vhost.serveradmin -%]
        ServerAdmin [% vhost.serveradmin %]
    [% ELSE %]
        ServerAdmin webmaster@[% vhost.servername %]
    [% END -%]
    
    What do you think?
    Thanks again for your assistance.
     
Loading...

Share This Page