Hi folks,
I wonder if any of you have used or currently use Hiawatha for serving web-pages?
Hiawatha has been running here on an old PC with puppy-linux for over 6 months now and aside from a few minor problems at the start it has performed very well.
Question:
This may seem a silly question but I noticed that when I enter an incorrect URL the local server/Hiawatha returns a "404" error page. Thats OK and I never questioned it before but more recently I noticed in the hiawatha.conf file that all the lines relating to error handling seem to be commented-out by default. That is to say that error handling does not appear to be enabled yet I still get an error page when an error happens so where do these pages come from?
The reason I ask is because I have read the support information for hiawatha which explains to some degree how to implement user generated error pages using (I think) cgi scrips but is it possible to alter the existing default error messages generated by hiawatha and where do they come from in the first place?
BTW I recently installed Hiawatha on a raspberry-pi and it runs quite happily as a small, snappy wireless-server. But, it also has all the error handling lines commented-out in the hiawatha.conf file and still manages to produce an error page when required, can anyone shed any light on this please?
Regards to all,
pupnovice.
Question about Hiawatha error page.
Even if you have no ErrorHandler line in your configuration file, errors will still be handled. That line is just for using a custom error page; without it a default error page is used.Pupnovice wrote:. . . error handling does not appear to be enabled yet I still get an error page when an error happens so where do these pages come from?
These default error pages don't live anywhere, but are created internally by hiawatha when an error is encountered.
Since they are created by the hiawatha server itself, you could certainly modify hiawatha and recompile it, but it is a lot easier just to use the ErrorHandler line in the configuration file.Pupnovice wrote:. . . is it possible to alter the existing default error messages generated by hiawatha and where do they come from in the first place?
Even though the error page doesn't exist as a file anywhere, there is nothing to stop you from using your browser's Menu -> Save Page As... to save it to your /root/Web-Server/ directory (or whatever directory you are using for you WebsiteRoot). Then you can modify it to your liking.
Then add an "ErrorHandler" line to the configuration for your host and/or the appropriate virtual host in your configuration file. For instance, if your customized error page is for error 404, and you have named it "error_404.html", you would add this line:
Code: Select all
ErrorHandler = 404:/error_404.html
Hi npierce,
Just a few lines to say thanks for responding to my earlier question about Hiawatha.
I would never have thought of saving/editing the system generated error page in that way, cool!
It worked a treat. I was also pleased to learn that the user generated custom error page can be straight html. The Hiawatha help pages are not clear on that subject or perhaps its just me I had been labouring under the misconception that the error page had to be a cgi/php or some other script.
In any event, it all works fine now and much better to see a custom error page saying something other than "404 page not found" or whatever. I am thinking "DOH!" might be more appropriate
Thanks again and best wishes,
pupnovice.
Just a few lines to say thanks for responding to my earlier question about Hiawatha.
I would never have thought of saving/editing the system generated error page in that way, cool!
It worked a treat. I was also pleased to learn that the user generated custom error page can be straight html. The Hiawatha help pages are not clear on that subject or perhaps its just me I had been labouring under the misconception that the error page had to be a cgi/php or some other script.
In any event, it all works fine now and much better to see a custom error page saying something other than "404 page not found" or whatever. I am thinking "DOH!" might be more appropriate
Thanks again and best wishes,
pupnovice.