Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Custom Apache Logging + Conky

  1. #1
    Join Date
    Sep 2010
    Location
    Burlington, VT
    Beans
    132
    Distro
    Ubuntu 12.04 Precise Pangolin

    Custom Apache Logging + Conky

    Hello All. I have been running a web server to practice my web design skills and to host some files to my friends.

    It is quite simple. I have the main site available to everybody then I have a directory that holds all my media that is password protected by the apache config file.

    What I would like to do is create a custom log file that shows me all the files that my friends have downloaded from this Media directory. I understand that the access.log file shows this but it is all convoluted with other stuff so I would like a separate one.

    Using this Then I would like to add an entry into my conky setup to monitor how many downloads there have been in total, daily, and monthly.

    Can somebody help me out with this? Much appreciated

  2. #2
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Custom Apache Logging + Conky

    Custom Apache log formats are easy to set up. See the section on the Apache access log

    One mod that I tended to make when I ran Apache was to make the fields of the log file tab-delimited.

  3. #3
    Join Date
    Sep 2010
    Location
    Burlington, VT
    Beans
    132
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Custom Apache Logging + Conky

    Ok so I just added this to my apache2.conf file because I believe this is what I want

    Code:
    CustomLog /var/log/apache2/files_downloaded_log "%a %h %{User-agent}i %t %f %r %B"
    The files_downloaded_log file is showing but nothing is being written to it. Do i need to enable logging somewhere as well to get it to work?

    Also is there an explicit way to only log requests where a user accesses a file(not a directory transversal)? If so was that the right way to do it?

    Thanks

  4. #4
    Join Date
    Sep 2010
    Location
    Burlington, VT
    Beans
    132
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Custom Apache Logging + Conky

    Bump!

    Anybody? This is really irritating me. I checked the permissions and they seem right... The write lines are being written to the access log but just not my custom one.

  5. #5
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    LogFormat

    Don't you need to set the log file format using "LogFormat" ?

  6. #6
    Join Date
    Sep 2010
    Location
    Burlington, VT
    Beans
    132
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: LogFormat

    Quote Originally Posted by Lars Noodén View Post
    Don't you need to set the log file format using "LogFormat" ?
    You can but what I did before was just a shortcut. I actually just tried changing it back to the long way:

    Code:
    LogFormat "%a %h %{User-agent}i %t %f %r %B" downloads
    CustomLog /var/log/apache2/files_downloaded.log downloads
    But that didn't work either

  7. #7
    Join Date
    Sep 2010
    Location
    Burlington, VT
    Beans
    132
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: LogFormat

    Anybody?

  8. #8
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Custom Apache Logging + Conky

    I set up Apache2 on a spare system and could not duplicate your error.

    What does the line for the default access log look like for your system and is that working?

  9. #9
    Join Date
    Sep 2010
    Location
    Burlington, VT
    Beans
    132
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Custom Apache Logging + Conky

    I'm not exactly sure where the format for the access log should be. I suspect it should be in the apache2.conf file but I can't find a exact point to the access log file. That log file is working perfectly however.

    I have attached my conf file.

    Thanks for helping
    Attached Files Attached Files

  10. #10
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Custom Apache Logging + Conky

    Quote Originally Posted by Hack.The.Pow. View Post
    I'm not exactly sure where the format for the access log should be.
    Shouldn't the configuration file for your vhost for Apache2 be somewhere under /etc/apache2/sites-enabled ? Putting everything in a single configuration file was the Apache 1.3 way of doing things.

    What is the result of Apache's configtest?

    I've looked at your configuration file and at first glance it looks ok if the directory /var/log/apache2/ really does exist.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •