2

This week I installed a simple Ubuntu 14.04 server on which I host a new website (which I built with Flask). The website works fine without any problems.

I now wanted to check out the access log, in which I expect every request which is made to be recorded. So I do a tail -f /var/log/apache2/access.log which currently shows this (x-ed away my own ip-address):

212.xx.xx.xx - - [08/Jul/2015:18:42:05 +0000] "GET / HTTP/1.1" 200 3594 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0"
212.xx.xx.xx - - [08/Jul/2015:18:42:05 +0000] "GET /icons/ubuntu-logo.png HTTP/1.1" 200 3688 "http://52.28.183.18/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0"
212.xx.xx.xx - - [08/Jul/2015:18:42:06 +0000] "GET /favicon.ico HTTP/1.1" 404 501 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0"
212.xx.xx.xx - - [08/Jul/2015:18:42:06 +0000] "GET /favicon.ico HTTP/1.1" 404 501 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0"

This seems to be the request I made two days ago (when I installed the server) which opened up the Apache Ubuntu default welcome page. The problem is that I don't see any new requests recorded. Could it be that these are recorded somewhere else because the website works through mod_wsgi?

All tips are welcome!

[EDIT]

My website config looks like this:

<VirtualHost *:80>
         WSGIDaemonProcess mywebsite
     WSGIScriptAlias / /var/www/mywebsite/app.wsgi

     <Directory /var/www/mywebsite>
            WSGIProcessGroup mywebsite
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
        Allow from all
     </Directory>
</VirtualHost>
kramer65
  • 1,394
  • 4
  • 21
  • 43
  • How is your Apache site configuration set up? Do you have a `CustomLog` directive in there? – bertieb Jul 10 '15 at 10:22
  • @bertieb - No, nothing special in that. I used the most simple setup I could find on the internet. I'll add it to the question in a second. – kramer65 Jul 10 '15 at 12:23
  • I think you might be right in your supposition about something else handling access logs, per [this mailing list message](http://librelist.com/browser/flask/2012/8/10/standard-request-logging-not-error-logging/#e83bf5398d242ea628bba3effaaa0e37). It is possible to make flask handle them though: [1](https://docstrings.wordpress.com/2014/04/19/flask-access-log-write-requests-to-file/) [2](https://docstrings.wordpress.com/2014/04/19/flask-access-log-write-requests-to-file/) – bertieb Jul 10 '15 at 15:37

1 Answers1

2

Ah, turns out I didn't have logging set up in apache. I added this to mywebsite.config:

LogLevel info
ErrorLog "/var/log/apache2/error.log"
CustomLog "/var/log/apache2/access.log" combined
kramer65
  • 1,394
  • 4
  • 21
  • 43
  • Thank you! I've been trying to track down an issue for hours and just adding "LogLevel info" to my site conf made my life a lot easier. – Splendor Oct 26 '15 at 20:25