Setting up a web server on Puppy; Quisp, Monkey

Using applications, configuring, problems
Message
Author
Bruce B

Setting up a web server on Puppy; Quisp, Monkey

#1 Post by Bruce B »

I thought Puppy had a built in web server, but I can't locate it.

Any tips on how to setup a simple web server would be much appreciated.

Bruce B

Answering my own question

#2 Post by Bruce B »

Answering my own question. I found a little web server in /root/ghttpd called httpd.

It seems to work just fine although I don't know much about using it.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#3 Post by BarryK »

Quisp uses that web server, its "nullhttpd" package.
I seem to recall that nullhttpd have virtually no documentation.
I also vaguely recall GuestToo getting some other web servers going, I think reported on the old forum.

Bruce B

Thanks

#4 Post by Bruce B »

Thank you Barry. The configuration file gives a little hint about how it works. I copied the necessary files to another directory under root/.usr/ghttpd

I don't know cgi so I didn't setup a cgi directory. I just want it simple. You can run the web server on any port you want. So far it tests good. Maybe GuestToo will give his recommendation about what he things would be best to use.

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#5 Post by GuestToo »

i had a Monkey roxapp package uploaded at one time ... i could make it a dotpup

it used to be nullhttpd had a security hole, but they fixed it, so i think nullhttpd and monkey are about the same ... monkey has some security advisories, but they are just about the default cgi files, and they don't work in Puppy anyway (no Perl or PHP)

you can easily disable the cgi anyway

they say it's better to not run servers as root
you can su spot and run the server as spot ... you may need to put your config files in /root/spot though

my monkey roxapp ran as spot

it is very easy to setup and use
basically, put your web files in ghttpd/htdocs
you can put other files like zip files, mp3s, pictures in there too and they can be downloaded from your server

httpd doesn't have a convenient way to run/stop it though
i did make an xmessage script to start/stop the server ... i have it somewhere

you could make 2 scripts, and drag them to the desktop to create shortcuts, or put them in the menu, or just open the folder and click them ... these 2 scripts are about as simple as you can get:

#!/bin/sh
/root/ghttpd/httpd

#!/bin/sh
killall httpd

menno

ghttpd

#6 Post by menno »

From the CGI-BIN you can run scripts , such as Quinsp is , as Perl , Xbasic and others as Peu or Euphoria also compiled C programs .
PHP may be a problem because its run normely from the doc directory .
I didn't have the time to find out how to do it . I ame running the Lampp that is a compilation of PHP Perl Appache and some more . The only disadvantage is that it very large .

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#7 Post by GuestToo »


Bruce B

Thanks

#8 Post by Bruce B »

You're incredible. Thanks for the Monkey server! Much appreciated!

Bruce B

Monkey question for GuestToo

#9 Post by Bruce B »

GuestToo, the monkey pup package was really nice work. Thanks again.

Monkey works well at the address you assigned it: 127.0.0.1:51234

I tried to set it to run on 127.0.0.1:80 and all I've been able to get is a 'connection refused' message with the browsers.

I've set the configuration files to run it on port 80 but no go. Any ideas how to set it to run on port 80?

BTW - I tested port 80 to see if it was available by using httpd and it is and httpd works 127.0.0.1:80

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#10 Post by GuestToo »

if you read /root/monkey/conf/monkey.conf, it says:
Whatever specified number less than or equal to 1024, only will
# be able to be established as a connection door if the user posesses
# privledges of Root.
i setup Monkey to run as nobody
if you run Monkey as root, you can use port 80

Monkey will run as root if you change the line in AppRun from:
su -c $SM - nobody &
to $SM &

Bruce B

I got it.

#11 Post by Bruce B »

Thanks that was very big of you. You could have just said, "Learn to read."

Since I didn't read careful enough, I'd never have figured it out without you.

Guest

Website using quisp and shsqi

#12 Post by Guest »

Hey Bruce,

I've built a fully dynamic website using quisp and shsql that come packaged with puppy. All content from the website is stored in the shsql database and retrieved using quisp page code. I've found there are a few niggly little issues, but all can be overcome. I initially had problems with quisp not serving images, but this was resolved by using the full html url of the image in the <img src=""/>, rather than the relative path on the server.

eg "http://www.cooma.biz.tm/banner.png"

rather than "banner.png"

This is a lot slower (on my machine and connection), but it works. If you figure out a better way, please let me know :)

There is heaps of info available on how to set up a quisp website - Barry has provided some. If you go to Information Managers -> Quisp... and click on the examples link; there is enough to get you started.

I have just used Null httpd on Puppy, but I think Apache is a more secure choice for a production system.

Cheers

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#13 Post by BarryK »

It's on the to-do list to setup Quisp and nulhttpd running as a user, rather than as root.
This is what we do with didiwiki -- it runs as user "spot".
(see /root/spot).

What is your URL so I can see your Quisp pages?
...i think you posted something about this earlier, but I can't recall.
...a newsworthy item i think!

thoughtjourney
Posts: 61
Joined: Thu 05 May 2005, 01:30
Location: Sutton, NSW

#14 Post by thoughtjourney »

Hi Barry,

sorry about the delay in replying... I've been flat out with study, and haven't had much time for the fun things in life.

my website can be found at www.cooma.biz.tm

(or it will be in a few minutes... I'm testing the mono::live cd on my server machine at the moment)

I'm playing around with the styles at the moment, so it isn't very pretty, and I am in the middle of building a content management system. The skeleton is there, though. I am running the web server as a user (db). I'd be grateful for any feedback :)

cheers
in the beginning was the Logos

http://thoughtjourney.aus.cc

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

Monkey as root

#15 Post by Nathan F »

Ijust tried this:


if you run Monkey as root, you can use port 80

Monkey will run as root if you change the line in AppRun from:
su -c $SM - nobody &
to $SM &

Unfortunately, it doesn't seem to have worked for me, as port 80 is still refused. I tried it with nulllhttp and I can acces port 80. Any help would be appreciated, as I'm still somewhat new to Linux in general.

Thanlks,

Nathan

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#16 Post by GuestToo »

if you right click the Monkey icon, click Look Inside
then right click AppRun, Open As Text
you can edit the script that starts/stops Monkey

the line that starts Monkey is su -c $SM - nobody &
you are root, and normally any program you run is run as root with root's privledges
running as nobody means the server will have limited privledges to do things it shouldn't be allowed to do anyway

if you change the line su -c $SM - nobody & to $SM &, Monkey will run as root with root's privledges

also, at the top of the AppRun file, change MONKEY_URL="http://127.0.0.1:51234/" to MONKEY_URL="http://127.0.0.1:80/"

setup the port you want to use in /root/monkey/conf/monkey.conf ... if you right click the Monkey icon and click Help, there is an icon you can click to edit monkey.conf

for example, change Port 51234 to Port 80

now when you click the start button, Monkey should start using port 80

screenshot of Monkey serving on port 80: http://tinypic.com/5tvzfl

screenshot of Monkey running a perl cgi script ... note where it says SERVER_PORT=80:
http://tinypic.com/5tvzvs

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

Thank You

#17 Post by Nathan F »

Thanks for the fast reply. I thought I had tried all of that earlier, but I geuss I must have skipped something. It's workink now. My website should be up by next week, with this setup.

Nathan :D

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

firewall

#18 Post by Nathan F »

Ok, I hope I'm not asking this in the right place, but it's closely related. I've got the server up and running but not with the firewall. I had Morizot setup and it blocked port 80 quite effectively. Now I'm wondering how I could set up the firewall and open up just that port in order to run my website. Thanks again for helping with everything else.

Nathan
(really close to making this my main system) :)

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#19 Post by GuestToo »

i think the firewall is called rc.firewall or rc.firewall-morizot ... something like that ... it's in /etc/rc.d i think

i put config variables at the top of the file

right click the rc.firewall (whatever it actually is called)
click Open As Text
pupTCP_ALLOW_PORTS="" should be near the top of the file
change the line to pupTCP_ALLOW_PORTS="80"

the firewall should now allow incoming connections to port 80

either reboot or restart the firewall
(type /etc/rc.d/rc.firewall stop then type /etc/rc.d/rc.firewall
or whatever it's called)

if you have a router or hardware firewall, you need to forward port 80 too

i prefer not to use port 80, because there are bots searching for computers with port 80 open ... but i don't suppose it makes much difference

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

Puppy server: is a firewall necessary?

#20 Post by Nathan F »

Thanks. Will try that. I don't think I should have any real problems using port 80, as I'm going to reboot the computer every now and then and just re-insert monkey and the pages that I want, after deleting the pup100 file. So even if someone does compromise the server, any damage should be gone at the next bootup. This was my primary reason for wanting to do this with Puppy and Monkey. My first plan was to use DSL, but I'm way more comfortable running Puppy so far.

Thanks again,
Nathan

Post Reply