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 22 Sep 2018, 08:42
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Hiawatha gurus, I need your help with URLToolkit
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
jafadmin

Joined: 19 Mar 2009
Posts: 842

PostPosted: Fri 10 Aug 2018, 21:42    Post subject:  Hiawatha gurus, I need your help with URLToolkit  

I have a simple, LAN only, HTML, hiawatha site running on a puppy in /root/Web-Server with a "index.html" file.

I'm trying to make URLTool fix URL's that don't match the site. (goofy clicks in favorites, etc.) My hiawatha.conf file:
Code:

ServerId = webuser
ConnectionsTotal = 150
ConnectionsPerIP = 10
SystemLogfile = /var/log/hiawatha/system.log
GarbageLogfile = /var/log/hiawatha/garbage.log

UrlToolkit {
   ToolkitID = my_rewrite
   RequestURI exists Return
   Match .* Rewrite /index.html
}

Binding {
   Port = 80
   Interface = 172.28.226.1
}

Hostname = 127.0.0.1
WebsiteRoot = /root/Web-Server
StartFile = index.html
AccessLogfile = /var/log/hiawatha/access.log
ErrorLogfile = /var/log/hiawatha/error.log

VirtualHost {
  Hostname = localhost
  WebsiteRoot = /root/Web-Server
  StartFile = index.html
  AccessLogfile = /var/log/hiawatha/access.log
  ErrorLogfile = /var/log/hiawatha/error.log
  UseToolkit = my_rewrite
}
#add this stuff to get a perl script working (pplog)...
#QUISP has a binary executable CGI named 'quisp.bin'...
MimetypeConfig = /etc/mime.types
#CGIhandler = /usr/bin/perl:pl
CGIextension = pl,bin
ExecuteCGI = yes
#QUISP puts %0D, %0A (carriage-return, line-feed) chars in the url
#(v128), to allow chars below ascii 32 need this...
SecureURL = no

This is on Precise 5.71 .. Anyway, the "UseToolkit = my_rewrite" isn't changing the urls to the index.html ..

Any insights would be greatly appreciated. Sad
Back to top
View user's profile Send private message 
rockedge


Joined: 11 Apr 2012
Posts: 808
Location: Connecticut, United States

PostPosted: Sat 11 Aug 2018, 13:42    Post subject:  

what version of Hiawatha are you running? I assume its around version 6.17.1.

have you tried using wigwam with the -t switch? this tests URL's you can input and see what the rewrite of the tookkit will look like.

Code:
wigwam -t my_rewrite


manual -> https://www.hiawatha-webserver.org/manpages/wigwam

tests with your hiawatha.conf are below
wigwam-tests.png
 Description   
 Filesize   27.77 KB
 Viewed   76 Time(s)

wigwam-tests.png

Back to top
View user's profile Send private message Visit poster's website 
jafadmin

Joined: 19 Mar 2009
Posts: 842

PostPosted: Sat 11 Aug 2018, 14:23    Post subject:  

It gives me the following. The problem is that if I type a url in the browser window, it works fine, but if I select a saved link from favorites, it hangs and doesn't serve the content properly.

I = Stumped.

Probably has to do with that "Bad URL" message, right?
screen.png
Description 
png

 Download 
Filename  screen.png 
Filesize  21.03 KB 
Downloaded  16 Time(s) 
Back to top
View user's profile Send private message 
trapster


Joined: 28 Nov 2005
Posts: 2115
Location: Maine, USA

PostPosted: Sat 11 Aug 2018, 16:19    Post subject:  

try:

Match /(.*) Rewrite /index.html

?

_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog
Back to top
View user's profile Send private message Visit poster's website 
jafadmin

Joined: 19 Mar 2009
Posts: 842

PostPosted: Sat 11 Aug 2018, 17:33    Post subject:  

trapster wrote:
try:

Match /(.*) Rewrite /index.html

?


No Joy .. Actually made it worse ..
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 842

PostPosted: Sat 11 Aug 2018, 20:40    Post subject:  

Ok, I think it messes up when the url has "https" instead of "http"

Any ideas how to fix that?

thx
Back to top
View user's profile Send private message 
trapster


Joined: 28 Nov 2005
Posts: 2115
Location: Maine, USA

PostPosted: Sat 11 Aug 2018, 21:13    Post subject:  

From the Hiawatha web sight
UseSSL is for https
?


The complete syntax of the URL toolkit in Hiawatha is:


UrlToolkit {
ToolkitID = <toolkit_id>

Call <rewrite_id>
Header <key> [!]<value> Call|DenyAccess|Exit|Goto|Return|Skip|Use
Match [!]<url> Ban|Call|DenyAccess|Exit|Expire|Goto|Return|Rewrite|Redirect|Skip|UseFastCGI
Method [!]<request method> Call|DenyAccess|Exit|Goto|Redirect|Return|Skip|Use
RequestURI exists|isfile|isdir Return|Exit
Skip <lines>
UseSSL Call|Exit|Goto|Return|Skip
}


The format of the actions is as follows:

Ban <seconds>
Call <toolkit_id>
DenyAccess
Exit
Expire <number> (seconds|minutes|hours|days|weeks|months) [Public|Private] [Return|Exit]
Goto <toolkit_id>
Redirect <url>
Return
Rewrite <replace> [<max_loop>] [Continue|Return]
Skip <lines>
Use <url>
UseFastCGI <fastcgi_server_id>

Explanation of the commands:

Ban: Ban the client for <seconds> seconds.
Call: Execute another rule and proceed with the current rule afterwards.
DenyAccess: Denies access to the requested file (results in a 403 error) and terminate toolkit processing.
Exit: Stop URL rewriting.
Expire: Adds an Expires HTTP header with current timestamp + <time>. The default behaviour is to continue after an Expire action.
Goto: Execute another rule and terminate toolkit processing.
Match: Perform the following action if <url> matches the requested URL.
Method: Perform an action for a certain request method.
Redirect: Redirect the browser to <url> via a 301 and terminate toolkit processing.
RequestURI: Check if the requested URL is a file or a directory.
Rewrite: Rewrite the current URL for maximum <max_loop> times (default=1) and terminate toolkit processing.
Return: Return from the current rewrite rule.
Skip: Skip the following <number> of lines (ToolkitID excluded).
ToolkitID: Assign a label to the current rule set.
Use: Replace the current URL with a new one.
UseFastCGI: Use FastCGI server with id <fastcgi_server_id> and terminate toolkit processing.
UseSSL: Perform action when client is connected via HTTPS.

_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [7 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0707s ][ Queries: 13 (0.0097s) ][ GZIP on ]