Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Alternative to thttpd?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 812

PostPosted: Fri Sep 23, 2022 5:11 pm    Post subject: Alternative to thttpd? Reply with quote

Hi All,

I've been using thttpd for a long time (~15 years i think), it's now masked because of a security issue and a dead upstream project. I'm struggling to find an alternative which fits the hole thttpd leaves.

My requirements:
- Small in size on disk and low number of dependencies
- Able to run CGI shell scripts
- Standard format access_log (similar to the format apache/nginx use)
- Must be written in C/C++, not in python or other scripting languages

I've done a few searches and didn't find anything that fits my use.

Do you have any suggestions? Thanks in advance.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2719

PostPosted: Fri Sep 23, 2022 5:40 pm    Post subject: Reply with quote

Why not straight up using nginx? It's simpler/smaller than it sounds (albeit still need to learn its configs), with minimal modules the install will be like ~600kB big (only real dep is openssl, plus pcre for me since I use its pcre support) and has a very tiny memory footprint

And shell script cgi can work with www-misc/fcgiwrap, for one (that's what I use but there may be better options).
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 812

PostPosted: Sat Sep 24, 2022 6:15 am    Post subject: Reply with quote

Nginx might not be huge for what it does/can do, but even just comparing the size of the execuable:
Code:

-rwxr-xr-x 1 root root 107168 Nov 25  2021 /usr/sbin/thttpd
-rwxr-xr-x 1 root root 863504 Sep 21 16:27 /usr/sbin/nginx

It is huge compared to thttpd :), and this one already has a minimal set of USE flags active.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
logrusx
Veteran
Veteran


Joined: 22 Feb 2018
Posts: 1532

PostPosted: Sat Sep 24, 2022 7:34 am    Post subject: Reply with quote

pa4wdh wrote:
Nginx might not be huge for what it does/can do, but even just comparing the size of the execuable:
Code:

-rwxr-xr-x 1 root root 107168 Nov 25  2021 /usr/sbin/thttpd
-rwxr-xr-x 1 root root 863504 Sep 21 16:27 /usr/sbin/nginx

It is huge compared to thttpd :), and this one already has a minimal set of USE flags active.


And your limitations hasn't changed for ~15 years?

Openwrt uses nginx even in devices with 8Mb flash and 16Mb RAM.

p.s. Wikipedia page points to two forks, one seems to be dead and the other one is Merecat which has its latest commit from 14 days ago.

Regards,
Georgi
Back to top
View user's profile Send private message
Leonardo.b
Apprentice
Apprentice


Joined: 10 Oct 2020
Posts: 296

PostPosted: Sat Sep 24, 2022 10:04 am    Post subject: Reply with quote

http://www.eterna.com.au/bozohttpd/
https://www.unitedbsd.com/d/434-serve-files-securely-on-netbsd-over-https-via-bozotic-httpd

bozohttpd. I don't know it, I don't have an opinion about it, just throwing in the name. You may check.

Edit: typos.


Last edited by Leonardo.b on Sat Sep 24, 2022 1:46 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2719

PostPosted: Sat Sep 24, 2022 12:22 pm    Post subject: Reply with quote

pa4wdh wrote:
Nginx might not be huge for what it does/can do, but even just comparing the size of the execuable:
Code:

-rwxr-xr-x 1 root root 107168 Nov 25  2021 /usr/sbin/thttpd
-rwxr-xr-x 1 root root 863504 Sep 21 16:27 /usr/sbin/nginx


It is huge compared to thttpd :), and this one already has a minimal set of USE flags active.

Mine is a bit smaller fwiw :? I do imagine it could be smaller still, but I haven't been trying for smallest size given that thing still has 32GB of flash storage anyway :)
Code:
-rwxr-xr-x 1 root root 623608 Sep  5 21:28 /usr/sbin/nginx
That aside, when it comes to httpd I'd much rather stick to something well maintained and audited than someone's pet project just to save a bit of space (not to say some of these may not have their perks), if I was truly limited and worrying about a <1MB binary I'd not be using a normal Gentoo install anyway (plenty of bigger areas to lose size from).
Back to top
View user's profile Send private message
logrusx
Veteran
Veteran


Joined: 22 Feb 2018
Posts: 1532

PostPosted: Sat Sep 24, 2022 1:06 pm    Post subject: Reply with quote

Leonardo.b wrote:
http://www.eterna.com.au/bozohttpd/
https://www.unitedbsd.com/d/434-serve-files-securely-on-netbsd-over-https-via-bozotic-httpd

bozohttpd. I don't know it, I don't have an opinion about it, just thowing in the name.[/url] You may check.


Doesn't even have version control...
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 812

PostPosted: Sat Sep 24, 2022 1:07 pm    Post subject: Reply with quote

Thanks for the suggestions on merecat and bozohttpd, they look promising! I'll give them a try.

logrusx wrote:
And your limitations hasn't changed for ~15 years?

Yes they have, but still the target is to have it as small as possible. I'll keep nginx in mind as a last resort, because to be fair, i expected the size to be worse than it actually is.

Ionen wrote:
That aside, when it comes to httpd I'd much rather stick to something well maintained and audited than someone's pet project just to save a bit of space

In general i agree. In this case it's not actually internet facing so that makes it a little less important to me. I do prefer something in portage to avoid the manual update hassle.

Ionen wrote:
if I was truly limited and worrying about a <1MB binary I'd not be using a normal Gentoo install anyway

In this case i'm using a normal gentoo install to create a minimal ramdisk image which is actually used on day-to-day basis. This gives me all the optimizations from Gentoo and without the overhead.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
Leonardo.b
Apprentice
Apprentice


Joined: 10 Oct 2020
Posts: 296

PostPosted: Sat Sep 24, 2022 1:43 pm    Post subject: Reply with quote

bozohttpd has source control in NetBSD CVS tree.

A quick internet search pops up althttpd, the web server behind sqlite.org:
https://sqlite.org/althttpd/doc/trunk/althttpd.md
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3135

PostPosted: Sat Sep 24, 2022 7:25 pm    Post subject: Reply with quote

Lighttpd might be one option.
Busybox builtin httpd could be another. Chances are you already have this one anyway.
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 812

PostPosted: Sun Sep 25, 2022 9:54 am    Post subject: Reply with quote

Thanks for the suggestions, i also found some small webservers in portage so it's time to start testing and see which one fits best.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 812

PostPosted: Wed Sep 28, 2022 9:45 am    Post subject: Reply with quote

So far my results have been disappointing:
www-servers/fnord is no longer maintained (stated on website) and is replaced by www-servers/gatling
www-servers/gatling had it's last file changed about 2 years ago, so doesn't seem to get active development
www-servers/monkeyd looked promising even with sponsors at their website (http://www.monkey-project.com/), but their latest release was in 2016
I'd still like to avoid using www-servers/nginx, not only because it's own size, but it also needs an extra daemon to be able to run cgi.

Althttpd (referred to by Leonardo.b) works well. The required directory structure is a bit different from thttpd but it's easy and works. Last change was 2 days ago, so seems to be actively developed and used on high-traffic websites.

For now i'll stick with althttpd and made a simple ebuild for it since it's not in portage. I also copied the old thttpd ebuild as a backup just in case i need it.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
Banana
Veteran
Veteran


Joined: 21 May 2004
Posts: 1391
Location: Germany

PostPosted: Wed Sep 28, 2022 5:30 pm    Post subject: Reply with quote

A software does not need often updates to be a good and working one.
_________________
My personal space
My delta-labs.org snippets do expire

PFL - Portage file list - find which package a file or command belongs to.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
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