Skip to Content.
Sympa Menu

baslinux - Re: [BL] HTTPD

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: Stephen Clement <s.clement AT sympatico.ca>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] HTTPD
  • Date: Tue, 15 Mar 2005 19:58:11 -0500

sindi keesan wrote:

IT WORKS!!!!!

:)


cp mini_httpd.tar.gz /
tar -zxvf mini*


I have no cgi files and don't need a log so I simply made
/etc/mini_http.config

consisting of
dir=/www

I made an alias httpd='mini-httpd -C /etc/mini_httpd.config'

I put an index.html in /www .

I typed lynx localhost and got my index.html

I changed the name to index.htm and it still works.

Yep, mini_httpd supports index.html, index.htm, index.cgi and I believe you can add others.


I removed index.htm and typed (as root or user)
lynx localhost

and got a list of files in /www

Yeah, it does that.


I killed mini_https (ps, kill the process number)

I then loaded it with a different switch, to ignore the config file:

mini_httpd -d /tmp

Don't forget that you set that alias!


I dialed and came online (as root, it is faster than user) to sdf

From another terminal

less /var/eznet/status.0
My IP number was listed as 204.39.226.165

lynx 204.39.226.165
gives me a list of all files in /tmp

I can arrow down to one and type d to 'download' it from my own computer to my shell account home directory, as a way to do file transfers online that does not require starting ftp, or ftpput, or kermit, or require typing out the file names.

This would be a handy way to put together a web page on my own computer and then upload it to a shell account. I could also use wget (not the busybox version) with * (get all files in a directory - does this also do subdirectories?).

If you want subdirectories, use **


If I were to notify a friend that I was going online at a certain time with httpd running, and I then emailed them my IP number, they could, I think, download files from my computer. How would that affect the speed at which I am connected to the shell account - would it seem slower?

Yes, it would be slower.


Without either a config file and -C, or -d, this does not seem to work (you cannot just type mini_httpd from any directory and have that be the localhost web directory as with the busybox httpd).

No, it wants a config file.


I am not going to get into chrooting, but when I start mini_httpd I get some message about it that I don't understand and am ignoring.

"mini_httpd: started as root without requesting chroot(), warning only"

Yeah, it's not recommended that you run a webserver as root without chrooting, but you SHOULD be fine.


This demon should even let me serve files from a DOS directory (with index.htm instead of index.html).

Yep. FYI, they're "daemons", not "demons". They're not evil. :D


I don't understand the business about switching to user nobody. I just switched terminals to do something else. Could I also just type
mini_httpd -d /tmp &
and continue to use that terminal?

You don't even need the & on the end, it daemonizes itself. You can continue using that terminal. The whole switching to user 'nobody' is for if you want a more secure environment.

Thanks,

Stephen Clement



On Mon, 14 Mar 2005, Stephen Clement wrote:

sindi keesan wrote:

On Mon, 14 Mar 2005, Stephen Clement wrote:

sindi keesan wrote:

Interesting. I just found my own assigned IP address in /var/eznet/status.0:

ppp0 204.39.226.xxx to 204.39.226.4 up since 9:12AM Mon Mar 14, 2005

(I did not type out the full IP address just in case this might cause a security problem - could it? I am not running any telnet or http demons right now and I am telnetted here as user.)

So if I were to run httpd on my computer I could from this shell account use a browser to access my own computer and transfer files from it, instead of via ftp or kermit file transfer. Might be useful. But I dialed in using BL2 not BL3 - is there a small httpd that will work in BL2, or is the BL3 one statically compiled?



The one I submitted to the list, mini_httpd is statically compiled, so it should work with BL2, and it's easier than copying over all of busybox.



I took a look at it but could not understand how to configure it. Can you explain how to set it up to work like the busybox httpd, just from the directory where it is invoked? I have not set up a web server until yesterday.


First of all, if you have the new version there's plenty of documentation on it in /usr/doc/.

I'll explain it however:
The -C option specifies a config file. Config files are explained quite nicely if you read the page in /usr/doc/, and you set the options like so:

optionname=value

-p specifies a port. The default of 80 should be what you want.

-d specifies a dir to chdir to at startup.

-dd is related to chrooting, see the manual.

-c is for specifying your cgi-bin. Specify 'cgi-bin/**' (without the quotes) for anything in cgi-bin/. '**.cgi' (yet again, without the quotes) for all files ending in .cgi. Note that this path is relative to the directory specified with -d.

-u specifies a user to switch to after initialization as root. Default is nobody. If you leave this alone in BL3, it'll somehow magically change to nobody just fine, despite the user 'nobody' not being existing.

-h and -v are related to virtual hosting. See the manual.

-l specifies a log file name. Default is no logging.

-i specifies a pidfile (a file that it writes it's PID to)

-T specifies a character set to use when sending text files. Default should be fine.

-P specifies a P3P server header. See manual for details.

-M is related to caching, see manual for details.

-S is related to SSL, which I have disabled. Useless unless you recompile with SSL support.

-E is also related to SSL. Yet again, see the manual.

-D is for debug mode. Note, however that mini_httpd does not become a daemon in this mode, so it's great for a restart script.

-V prints the version and exits.

So, now that we have that covered, here's an example configuration file:

dir=/var/www/
cgipat=cgi-bin/**
logfile=/var/log/mini_httpd.log

With this configuration file, you'd put your files in /var/www/, and your cgi files in /var/www/cgi-bin/. It would log to /var/log/mini_httpd.log.

You would invoke mini_httpd like this:

mini_httpd -C /path/to/config/file

Hope this clears things up a bit. By the way, if you have an old version that does not have the (essential) manual in /usr/doc/, e-mail me for the new package. The manual is essential.

Thanks,

Stephen Clement



Thanks,

Stephen Clement


On Sun, 13 Mar 2005, Alejandro Lieber wrote:

Today I used httpd:

1) made directory www
2) loaded a index.html file there.
3) cd to /www
4) run httpd
5) run ppp-on
6) read myip address (200.32.16.17) after loging to my IP.
7) run links
8) g 200.32.16.17
9) links got my /www/index.html page

All using only one machine.





Read net news (USENET) with Arachne: http://www.lieber.com.ar/nnews.zip
Sans Serif fonts for MS-DOS at: http://www.lieber.com.ar/novafont.zip
Configurable dialing menu for several DOS internet programs at:
http://www.lieber.com.ar/dial_ip.zip

---------------------
Ing. Alejandro Lieber
Rosario Argentina
---------------------








Archive powered by MHonArc 2.6.24.

Top of Page