Where did logging go?
Hi. I ran into Hiawatha recently and I am doing some tests. I installed it 3 days ago and ran just a very quick 30-second test because I was busy. Now I have the time to tinker with it.
Now I am building and tweaking and surely doing something wrong. My browser keeps showing me a big "500 - Internal Server Error" and the file /var/log/hiawatha/error.log tells me nothing. Almost nothing. There was a couple of lines from 3 days ago, mentioned above. I deleted those lines. The system and access log files also have a few lines from 3 days ago. I kept those. Now I am tweaking and testing and nothing turns up in any of the logs with today's date. What is going on?
Hiawatha version: v6.15
Operating System: Linux
17 July 2009, 02:35
Delete the error logfile and make sure you start Hiawatha as root. It will recreate the error logfile with the right permissions. Does that help?
Please, post your configuration file so I can see if something is wrongly configured.
OK, I solved it. Hiawatha had ID 'www-data' and the log files belong to 'nobody'. Weird, because I don't remember ever changing that ID or ownership of the files.
I am running Hiawatha as 'nobody' now. That fixes it. Thanks.
More logging problems. This time not on my desktop, but on the remote server.
I have these lines in my httpd.conf:
Hostname = www.domain-1.net,domain-1.net
WebsiteRoot = /home/www/domain-1.net
StartFile = index.cgi
AccessLogfile = /usr/local/var/log/domain-1.net/access.log
ErrorLogfile = /usr/local/var/log/domain-1.net/error.log
Hostname = www.domain-2.net,domain-2.net
WebsiteRoot = /home/www/domain-2.net
StartFile = index.cgi
AccessLogfile = /usr/local/var/log/domain-2.net/access.log
ErrorLogfile = /usr/local/var/log/domain-2.net/error.log
If I access the IP number, I get a "forbidden message" as expected. And the access gets logged in /usr/local/var/www/hiawatha/access.log as expected. However, when I access http://domain-1.net or http://domain-2.net, the log files remain empty although the browser displays the content of the sites as expected.
I ran a test: deleted /usr/local/var/log/domain-1.net/access.log then killed Hiawatha and restarted it. The log file was recreated, and it seems to have the right permissions. But it still remains empty despite my viewing of http://domain-1.net with the browser.
What do you suggest that I do?
18 July 2009, 03:19
For performance reasons, log entries are not flushed to disk directly. It may take a few seconds before they show up in the file. Try shutting down Hiawatha. It will flush all open logfiles.
How do I shut down Hiawatha? I can only *kill* it. There is no stop|start|restart command.
At any rate, the server has been running for at least 30 minutes and the logs are still empty.
You can do "/etc/init.d/hiawatha stop" to shutdown Hiawatha. You can also use the same command with start and restart.
Thank you. I had that file in my Ubuntu box, but not in my Slackware box. For some reason, checkinstall does not create /etc/init.d/hiawatha in Slackware.
That script is poorly written though. I had to copy it over from my Debian box to my Slackware box, the paths to the executables are different, but the script won't say anything. It just fails silently. It took me quite a while to figure it out and fix the paths.
The logging seems to have been fixed. I uninstalled and reinstalled Hiawatha after recompiling it with the same --prefix that had been applied (by default???) in the other machine, so the two setups were similar and the whole experiment became simpler. But the separate logging of separate domains did not work until I created the sub directories and chown'ed/chgrp'ed them all myself. Hiawatha runs as root, why can't it do that on by itself?
Anyway, I consider this case closed. Thank you all for your kind attention.
I mostly work on Ubuntu and the compile and install works beautifully. No prefix or anything required. Just ./configure and make deb and everything gets installed perfectly. I tried installing on CentOS and didnt use prefix properly and everything got messed up. I never had to change any permissions for log creation on CentOS or Ubuntu. Never tried Slackware though.
This topic has been closed.