On Mon, Jul 28, 2003 at 11:23:21PM -0500, Alex Neuman van der Hans <[EMAIL PROTECTED]> 
wrote:
> Anybody here know a good way to incorporate anti-nimda stuff to the Apache
> server? I'd like it to show a 0-byte file in response and not log anything.
> 
> I'm familiar with doing it on a stock redhat-apache install, but how to do
> it in the templates would be good to know.

If you know how to add it into httpd.conf, adding a template is easy:

- The relevant templates are in 
  /etc/e-smith/templates/etc/httpd/conf/httpd.conf

- Work out where in the sequence you need to add the template fragment. 
  The templates are processed in lexicographical (ASCII-betical) order

- Create a file with the line(s) you need to add

- In general you should try to create a separate file which doesn't
  conflict with the existing templates. If you *must* override an
  existing template, copy it into 

    /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf

  and then perform your changes there. If you have to do this, please
  let [EMAIL PROTECTED] know - we may be able to split the relevant
  template in a future release to make this easier.

- As long as the file doesn't contain braces "{ }", you can just include
  the static text. For example 75AddType05.png is simply one line:
 
  AddType image/png .png

- If you need to include literal braces, escape them with \{ or \}
  For example, 45CustomLogs has:

  [...]
  LogFormat "%\{User-agent\}i" agent
  [...]

- If you need something more complex, enclose the contents in
  braces and write the contents in Perl. For example, 20LoadModule80PHP:

  {
    return "" unless (exists ${php}{status} and ${php}{status} eq "enabled");

    return "LoadModule php4_module /usr/lib/apache/libphp4.so";
  }

- You can mix and match static text and Perl expressions, as in 
  05ServerAdmin:

  [...]
  ServerAdmin [EMAIL PROTECTED] $DomainName }
  [...]

  Note: My _personal_ preference would be to rewrite the whole thing in 
  Perl so you can run "perl -cT" on the file rather than using the 
  max and match approach:

  { return "ServerAdmin [EMAIL PROTECTED]"; }

- I hope this helps. Maybe you could share the changes you need to make
  and even the templates you create?

Thanks,

Gordon
--
 Gordon Rowell                         [EMAIL PROTECTED]
 Director, Engineering
 Mitel Networks Corporation            http://www.mitel.com/


--
Please report bugs to [EMAIL PROTECTED]
Please mail [EMAIL PROTECTED] (only) to discuss security issues
Support for registered customers and partners to [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Searchable archive at http://www.mail-archive.com/devinfo%40lists.e-smith.org

Reply via email to