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 23 Aug 2014, 05:34
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How I set up a Hiawatha web server with Puppy
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
CoffeaRobusta

Joined: 12 Jun 2009
Posts: 6

PostPosted: Mon 29 Mar 2010, 21:46    Post subject:  How I set up a Hiawatha web server with Puppy  

Hi All,

About a year ago, I found an old laptop in the trash. It was a Gateway Solo 9100 with PII processor and win98se. It was bloated and slow, so I reinstalled win98se, and was searching for open source apps, when I came across open source OS's. Anyway, long story short, I tried various linux os's on the laptop, and puppy ran the best. With Puppy 4.3.1, it's even better.

I now am able to use the laptop as a web-server, using Hiawatha. I even installed Puppeee to a flash card to run on our EeePC 900a. Love the tangogps app that's bundle with Puppeee. I even complied a program for the first time ever, by making gpsbabel as a pet package. I am just amazed at how relatively easy Puppy is. To be fair, playing around with other linux systems has helped me to become familiar with them in general, but there is good work here.

Thanks, and keep it up!
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11017
Location: Arizona USA

PostPosted: Mon 29 Mar 2010, 23:12    Post subject:  

Could you give us some details about how you set up the Hiawatha web server? What you use it for, what Hiawatha configuration options you chose, those sorts of things.
Back to top
View user's profile Send private message 
looseSCREWorTWO

Joined: 04 Feb 2010
Posts: 812
Location: Australia, 1999 Toshiba laptop, 512mb RAM, no HDD, 431 Retro & 421 Retro

PostPosted: Tue 30 Mar 2010, 06:41    Post subject:  

CoffeaRobusta,

Your comments about how easy it is to use Puppy Linux are exactly what I found.

When I started using Puppy last December I had absolutely no knowledge or experience of any type of Linux. I had been a DOS/Windows user in the 1980s, so I know some things like "backup up everything" because it's universal to all computer systems. I knew nothing of Linux, yet I 've been able to install Puppy Linux to 8 old computers rescued from dumpsters etc, without screwing-up any existing Windows partitions. I don't think I could have done this with any other Operating System.

What impresses me about Puppy is that it tells the user what it's doing, provides options, explains the consequences of choosing each option and where possible, gives info on how to undo changes.

Best wishes,

Steve
Back to top
View user's profile Send private message 
CoffeaRobusta

Joined: 12 Jun 2009
Posts: 6

PostPosted: Wed 31 Mar 2010, 14:24    Post subject: Hiawatha setup  

Hi Flash, I can try to fulfill your request. Keep in mind that it is still a work in progress and that I am learning this web-hosting stuff as I go. I know next to nothing about web-hosting and network administration so the learning curve is steep. Some of this stuff may bedownright wrong,so I would appreciate any comments or feedback.

I basically followed the HOWTO at http://www.hiawatha-webserver.org/. I used their example config file as a template. The config files for Hiawatha are located at /etc/hiawatha.

It's probably also a good idea to have a plan in mind before you start; list your resources and what you want to do with them, what features or special concerns do you have? For example, I want to use this old laptop as a web-server. It sits behind a wireless router and my ISP provider gives me a dynamic IP. I don't care if I have to use a IP address and not a human-readable URL, but security is important. I want to serve a blog using pplog and also serve a TiddlyWiki page. I'd like the blog to be publicly accessible and the tiddlywiki accessible only on the local private network.

Binding an interface
Hiawatha is initailly set to bind to the localhost interface. You'll need to change it to serve on the www. Open the Hiawatha main configuration file, hiawatha.conf, and find the binding section. I believe the other config file, httpd.conf, is not used anymore. I figure you have three basic choices on how to set the interface:
1. to localhost (127.0.0.1) - if you want just want a page servered on the local machine. This is a good idea for development and testing.
2. to the ip for the machine on the local network (something like 192.168.1.70) - this will serve webpages on your local network. Anybody on the local network that navigates to that IP will see your webpages.
3. remove (or comment out) the interface line all together and hiawatha will bind to all available interfaces. Do this to serve pages on the www.

You can change or add ports but 80 is standard for web sites. Also note that port 443 is used for secure (https://) websites and requires some other steps. I'm not serving any pages like that so I just comment it out.

Code:
# BINDING SETTINGS
# A binding is where a client can connect to.
#
Binding {
    Port = 80
    MaxRequestSize = 128
    TimeForRequest = 3,20
}

#Binding {
#    Port = 443
#    MaxRequestSize = 128
#    TimeForRequest = 3,20
#    SSLcertFile = hiawatha.pem
#}


Banning Settings
The next part was suggested as means of protecting against malicious users. The BanOn statments set number of seconds an ip will be denied is they exceed set levels. Hiawatha has a number of interesting security features; check out the HOWTO page. I'll be revisiting this section as I learn more about web security.

Code:
# BANNING SETTINGS
# Deny service to clients who misbehave.
#
BanOnGarbage = 300
BanOnMaxPerIP = 60
BanOnMaxReqSize = 300
KickOnBan = yes
RebanDuringBan = yes


CGI Scripts
If you want to run any cgi scripts, you can set the extensions to be interpreted as cgi, and set the paths to the handlers executing those scripts. I think, the fast cgi section can be used to pre-load a handler, for faster response. Note that permissions and the executable have to be set properly on the files.

Code:
# COMMON GATEWAY INTERFACE (CGI) SETTINGS
# These settings can be used to run CGI applications. Use the 'php-fcgi'
# tool to start PHP as a FastCGI daemon.
#
CGIextension = cgi,pl,bin
CGIhandler = /usr/bin/perl:pl
CGIhandler = /usr/bin/ssi-cgi:shtml

#FastCGIserver {
#    FastCGIid = PHP5
#    ConnectTo = 127.0.0.1:2005
#    Extension = php
#


URL Toolkit
Next is the URL Toolkit section. It can be used to perform commands based on the URL received, like denying access, redirecting, or rewriting the URL. The toolkit does this before the URL reaches hiawatha. This section will be important to folks wanting to serve cms content like joomla. See the HOWTO at hiawatha. I have it all commented out because I have no need for it yet. That and I need to learn the Regular Expressions format it uses.

Code:
# URL TOOLKIT
# These URL toolkit rules are made for the Banshee PHP framework,
# which can be downloaded from: http://banshee.leisink.org/
#
# UrlToolkit {
#    ToolkitID = banshee
#    RequestURI isfile Return
#    Match ^/(favicon.ico|robots.txt|sitemap.xml)$ Return
#    Match .*\?(.*) Rewrite /index.php?$1
#    Match .* Rewrite /index.php
#}


Default and Virtual Hosts
This part defines the hosts that the webserver will be...er....serving. The first host must not be contained in {brackets} and it beomes the default host. Hiawatha suggests setting your ip as the default host and setting that to a blank html page, as hackers tend to use the ip. The next sections define virtual hosts. Normally, the virtual host's names are the domain names of the sites you want to serve. The ExcuteCGI setting allows for cgi scripts to be interpreted or not, set to no for added security. The ShowIndex setting allows directory listings.

Since I don't own any domain names, and I don't subscribe to a dynamic domain name service, I just set the default site to the public IP address. Any web files that I want the public to see are in a directory set by WebsiteRoot =. Since I also wanted webpages served on the local network only, I then created a virtual host using the ip address of the machine acting as webserver, in this case my trusty trashtop. The web files for this virtual host are in their own directory. It also has its own log files.

Code:
# DEFAULT WEBSITE
# It is wise to use your IP address as the hostname of the default website
# and give it a blank webpage. By doing so, automated webscanners won't find
# your possible vulnerable website.
#
# Replace the x's with the IP given to you by your ISP.
Hostname = xx.xx.xx.xx
WebsiteRoot = /root/Web-Server
AccessLogfile = /var/log/hiawatha/main/access.log
ErrorLogfile = /var/log/hiawatha/main/error.log
StartFile = index.html
ExecuteCGI = yes
ShowIndex = yes


# VIRTUAL HOSTS
# Use a VirtualHost section to declare the websites you want to host.
#
VirtualHost {
    Hostname = 192.168.1.70
    WebsiteRoot = /root/LAN
    AccessLogfile = /var/log/hiawatha/LAN/access.log
    ErrorLogfile = /var/log/hiawatha/LAN/error.log
    StartFile = index.html
   ExecuteCGI = yes
   ShowIndex = yes
}


The Result
The whole upshot is anyone navigating to my external ip address (like 216.239.51.99) gets dropped onto my main pages, which has the pplog blog. But if they are within my home network, and navigate to the private address of the webserver (like 192.168.1.80), they get internal web pages. It seems to work but I am still testing it.

Next Steps
What to implement next?
* Set up a ddns account and a ddns updater client so that I have an external and internal domain name(or can I do this myself with BIND9?)
* Set up a virtual host with my new domain name and make the default page a blank dummy
* learn more about the security features, to ensure I my site is secure
* update to the latest hiawatha version
* Set up a cgi or php so I can save changes to tiddlywiki remotely
* play around with it some more!

Thanks!
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11017
Location: Arizona USA

PostPosted: Thu 01 Apr 2010, 00:30    Post subject:  

Thank you! Very Happy

I can see that I certainly know far less than you do about servers, web or otherwise. I don't see how your web server can work if your ISP reassigns it a new IP address every time it reboots.

By the way, are you aware of Puppy's ability to operate from a multisession CD or DVD? Everything, settings, installed programs, etc., is saved on the same CD or DVD that Puppy boots from. No need for a hard disk drive at all.

_________________
Puppy Help 101 - an interactive tutorial for Lupu 5.25
Back to top
View user's profile Send private message 
CoffeaRobusta

Joined: 12 Jun 2009
Posts: 6

PostPosted: Fri 02 Apr 2010, 00:47    Post subject:  

Flash wrote:

I can see that I certainly know far less than you do about servers, web or otherwise. I don't see how your web server can work if your ISP reassigns it a new IP address every time it reboots.


Yeah the key there is to understand the DHCP lease cycle. Every dynamic ip address has a lease time which can be hours or days, what ever the ISP sets. As long as I don't reset my router, it seems to retain the IP for a while. But you are right,if my IP changes my server won't work. Until I modify the config file again. Smile
Back to top
View user's profile Send private message 
trapster


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

PostPosted: Fri 02 Apr 2010, 05:38    Post subject:  

Look at DynDns.com for static IP address. Most newer router accomodate auto updates.
It's free!

_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Puppeee4.31 + 1.0, Puppy4.10 + Lupu52
Currently using Slacko AND lupu52 w/ fluxbox
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 » Beginners Help ( Start Here)
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.0815s ][ Queries: 12 (0.0059s) ][ GZIP on ]