lightweight httpd needed

I have a few servers so lots of log files. (These are application logs not /var/logs). I would like to fire up the browser and read my log files in the browser. I don't want to log on and trawl through all the servers.

I notice apache uses quite a bit of memory.

So I was interested if anyone can recommend a nice lightweight web server. It must have CGI though, I do a lot of perl CGI stuff. I am particularly interested in www/nginx and www/lighttpd.
 
Those two work fine, are not memory hogs, work fine with cgi and fastcgi. There's also www/varnish. From what I can tell (and I may be completely wrong) nginx is making quite a bit of headway lately and has jumped a little ahead of the rest of the pack.
 
You might be better off having a cron-job ship the logs to another machine. Needn't be more difficult than running a scp-job.
 
Shuffling logs about is a pain. Tried all that, it frazzles your brain. Plus it's network traffic, I probably will not always look at them, only when I have a query.

I already got cron-job-itis.
 
AFAIK, hiawatha is a fork of apache (so shares most of the code), while the the other three mentioned http servers are complete, ground-up re-writes of code.
 
I am currently trying this:
www/thttpd

Here's my config file!

Code:
user=www
port=1080
dir=/TMI/logs
chroot
logfile=/dev/null
pidfile=/TMI/var/thttpd.pid
Now that is easy.

And look at all these dependencies, shocking.

Code:
$ ldd /usr/local/sbin/thttpd
/usr/local/sbin/thttpd:
        libcrypt.so.5 => /lib/libcrypt.so.5 (0x800658000)
        libc.so.7 => /lib/libc.so.7 (0x800771000)

Can only do static linked compiled CGI, so no perl or shell, but it's up and running and I am very busy so it'll do for now.
 
Hi, I thought I would give it a spin as well, but ran into a snag. My thttpd runs jailed, the server starts up, but all I get in my browser is the pink 404 page. My thttpd.conf (not sure if host setting binds thttpd to specific IP, which is my intention):
Code:
user=www
dir=/dbhttp
nochroot
nosymlink
vhost
charset=utf-8
#cgipat=*.cgi
cgipat=/cgi-bin/*.*
logfile=/var/log/www/thttpd.log
pidfile=/var/run/thttpd.pid
host=192.168.2.100
 
Have you looked at the web site thttpd/notes.html? The developer appears to be a FreeBSD fan so he may have a solution.

I must say I like it. I can easily browse my logs on all my servers and so can my colleagues, plus it cost virtually nothing. Almost zero configuration install.
 
I did read the notes and other stuff, I also e-mailed the developer some days ago - he probably will get around to answering eventually.
I think the description for start-up in notes is out-dated, because /usr/local/etc/rc.d/thttpd seems to have the same code anyway. How do you start the server? I just do a "service onestart".
The 404 makes me think that dir= is not being read correctly, but you have it working so that's that...
 
The fact you have the thttpd 404 implies it's working I reckon.
I start the service normally in rc.conf.
I suppose you've read the log file ;-)
 
I also installed it on the host itself (not in jail) so I could de-bug easier. After start-up and query through browser only thing log shows:
Code:
127.0.0.1 - - [04/Apr/2012:15:****] "GET /localhost/ HTTP/1.1" 404 0 "" "Mozilla/5.0 (X11; FreeBSD
amd64) AppleWebKit/534.26+ (KHTML, like Gecko) Version/5.0 Safari/534.26+ Epiphany/2.30.6"
127.0.0.1 - - [04/Apr/2012:15:****] "GET /localhost/favicon.ico HTTP/1.1" 404 0 "http://localhost/"
"Mozilla/5.0 (X11; FreeBSD amd64) AppleWebKit/534.26+ (KHTML, like Gecko) Version/5.0 Safari/534.26
+ Epiphany/2.30.6"
 
@magna-aures-William:
I got the service running by modifying thtttpd.conf (disabled 1-3, enabled 4th):
Code:
1- #nosymlink
2- #vhost
3- #cgipat=/cgi-bin/*.*
4- cgipat=*.cgi
Files with php extensions are not working though and all I get for the sub-folders under www is a dir-listing. Obviously my cgipat is wrong somehow as opening www/folder/index.php just shows that file as php code.

I would also like to get vhost working and I have no clue why vhost gives problems.
 
Beeblebrox said:
AFAIK, hiawatha is a fork of apache (so shares most of the code), while the the other three mentioned http servers are complete, ground-up re-writes of code.
As the author of the Hiawatha webserver, I seriously feel insulted by this post. The Hiawatha webserver has completely been written from scratch and does not share a single line of code with that crappy webserver!
 
@Hiawatha: No need to get insulted; AFAIK implies the "correct me if I'm wrong" caveat, AFAIK! So thanks for the correction and for helping us to be better informed. Maybe you could even post some nice links to comparisons with other servers re speed, memory usage, etc.
 
So Mr Hiawatha I take it your webserver is better than all the others!
;)

I just tried it on puppy linux and it seems to do what I need. I.e. Perl CGI.
I will give it a go when I get back to work!
 
@bigearsbilly: I leave that up to you to decide :)

@gpatrick: Hiawatha has reverse proxy functionality too, so there is no more need for nginx.
 
My personal choice is nginx (sendfile, tcp_nopush) + fastcgi (prefork) + memcached (for nginx cache and dynamic application caches). It's the fastest setup I could get after a lot of experimenting and works very well with big frameworks like RrubyOnRails and Django.

For logging you can set up a single host just for gathering logs for all of your machines. Take a look at this manual http://www.freebsd.org/doc/handbook/network-syslogd.html.
 
They aren't system logs, just logs from scripts, cron jobs, configs etc.
Setting up remote syslog is bit of a sledgehammer.
I've never really liked using syslog for user mode stuff. You have to make all scripts use it.

It's dead easy to do:
Code:
exec > $log
exec 2>&1

Mostly though, I have very limited resources, especially time!
 
Back
Top