Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 18:54
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Question about Hiawatha error page.
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
Pupnovice

Joined: 19 Apr 2008
Posts: 11

PostPosted: Sun 31 Mar 2013, 05:03    Post_subject:  Question about Hiawatha error page.
Sub_title: Where do the error message pages come from in Hiawatha.
 

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.
Back to top
View user's profile Send_private_message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Mon 01 Apr 2013, 15:54    Post_subject:  

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?

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.

These default error pages don't live anywhere, but are created internally by hiawatha when an error is encountered.

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?

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.

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:
ErrorHandler = 404:/error_404.html

(You will, of course, need to restart hiawatha for that line to take effect.)
Back to top
View user's profile Send_private_message 
Pupnovice

Joined: 19 Apr 2008
Posts: 11

PostPosted: Tue 02 Apr 2013, 09:31    Post_subject:  

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 Wink 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 Smile

Thanks again and best wishes,

pupnovice.
Back to top
View user's profile Send_private_message 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Tue 02 Apr 2013, 10:30    Post_subject:  

You're welcome.

Glad it worked.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0510s ][ Queries: 11 (0.0050s) ][ GZIP on ]