0

I'm currently running Mongoose WebServer 5.5 on Windows 7

I have a number of virtual hosts, running on a single Mongoose server on one IP node.

The access log entries are typically

157.55.39.146 - - [09/Nov/2015:15:32:44 GMT Standard Time] "GET /robots.txt HTTP/1.1" 404 0 - "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"

i.e.

referrer's IP 
- 
- timestamp 
- http request made within the hostname 
- response code 
0 
- user agent

What domain was the request for?

When I make the requests myself, from the PC acting as the server, I usually (but not always) get a domain string between the 0 and the user-agent, e.g.

80.192.200.150 - - [09/Nov/2015:16:32:48 GMT Standard Time] "GET / HTTP/1.1" 200 0 - "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36"
80.192.200.150 - - [09/Nov/2015:16:32:48 GMT Standard Time] "GET /css/gawainWeb.css HTTP/1.1" 200 0 "http://clubknight.co.uk/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36"

Each url_rewrite is of the form: @clubknight.co.uk=clubknight,@clubknight.uk=clubknight, etc

If there is no way in Mongoose, is it possible in other webservers, especially LightTPD?

Or is this a limitation in the HTTP request format and how it is transmitted, after being given an IP address to point to by the DNS system?

Euan M
  • 101
  • 3
  • From [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html] "The Host field value MUST represent the naming authority of the origin server or gateway given by the original URL. This allows the origin server or gateway to differentiate between internally-ambiguous URLs, such as the root "/" URL of a server for multiple host names on a single IP address. ... A client MUST include a Host header field in all HTTP/1.1 request messages ." So where do I access the Host: header? – Euan M Nov 09 '15 at 17:23

1 Answers1

1

Mongoose logs accesses in so called "common log format", described at https://en.wikipedia.org/wiki/Common_Log_Format

Requested host is contained in the "Host" HTTP header, which is not present in the common log format. So there is no way to see what host has been requested.

However I am thinking about changing to the extended log format which is more flexible and allows to fetch important header values, like Host.

To answer the question about other web servers: look for one that supports extended log format.

Disclaimer: I am an author of Mongoose web server.

valenok
  • 111
  • 1
  • Thanks for the answer, and thanks for Mongoose! I look forward to a "Log Format: Common/Extended" option in the "Advanced Settings" menu. :-) – Euan M Nov 27 '15 at 00:52