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.

httpd logs to a single file

Discussion in 'General Discussion' started by NightStorm, Sep 16, 2005.

  1. NightStorm

    NightStorm Well-Known Member

    Joined:
    Jul 28, 2003
    Messages:
    286
    Likes Received:
    4
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Got a bit of an odd request (at least it sound sliek oen right now, but I'll explain later).
    I need to set a CustomLog for Apache to log *all* http traffic from all domains on the server to a single file, which is going to be parsed in real time for httpd attack protection.
    Now, if I add a CustomLog line into /usr/local/apache/conf/httpd.conf, that works for a default, and I can manually add the CustomLog line in for existing domains... but how do I make it automated for all new domains, so that I don't have to keep going into the conf file and adding it myself?
    Is there a template file somewhere that contains all the data that is entered into the <virtual server> block that I can drop the line into?
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You would have to modify /scripts/wwwacct which modifies httpd.conf when new accounts are created. You would then need pwsowner's watch script that checks for when upcp updates the script when it runs.
     
  3. forlinuxsupport

    forlinuxsupport Well-Known Member
    PartnerNOC

    Joined:
    Dec 22, 2004
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Changing default VirtualHost entries when adding a new site.

    Hi

    Is there a template file somewhere I can llo at. I have seen you mention wwwacct script before but i'm not making alot of it.

    Its the CustomLog entry this time I would like to change.

    Thanks
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    There is indeed a template for the VirtualHost containers. In fact there are two:

    /usr/local/cpanel/etc/httptemplates/apache1/default
    /usr/local/cpanel/etc/httptemplates/apache1/ssldefault
     
  5. NightStorm

    NightStorm Well-Known Member

    Joined:
    Jul 28, 2003
    Messages:
    286
    Likes Received:
    4
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    I know this is an older topic, but since I started it, I don't feel as bad about digging it back up. ;)
    I can't find in /scripts/wwwacct where I would add the necessary line to have all the domains on the server log their httpd to a single file as well as the standard combined log that gets placed in /usr/local/apache/domlogs. I want to ahve a log placed there for each domain (like now), but also want to have a single log file in /var/log that has all httpd queries for the entire box. The file will be rotated regularly to prevent oversize, and is strictly used for a tail -f process (it's part of a DDoS protection script that someone wrote that runs in realtime).
    Anyway, I don't see where the template for the httpd.conf enteries are in the wwwacct script, and when I edit /usr/local/cpanel/etc/httptemplates/apache1/default to add the line:
    CustomLog /var/log/httpd_domains.log combined
    It does not get added to the httpd.conf file. What am I missing? Can I not have two CustomLog enteries at once? Or is there something I need to run before CPanel will recognise the change?
     
Loading...

Share This Page