View previous topic :: View next topic |
Author |
Message |
pa4wdh l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 16 Dec 2005 Posts: 910
|
Posted: Fri Sep 23, 2022 5:11 pm Post subject: Alternative to thttpd? |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Ionen Developer
![Developer Developer](/images/ranks/rank-dev.gif)
![](images/avatars/12407261860db424480089.png)
Joined: 06 Dec 2018 Posts: 2892
|
Posted: Fri Sep 23, 2022 5:40 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
pa4wdh l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 16 Dec 2005 Posts: 910
|
Posted: Sat Sep 24, 2022 6:15 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
logrusx Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/176594205966916859b5145.jpg)
Joined: 22 Feb 2018 Posts: 2695
|
Posted: Sat Sep 24, 2022 7:34 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Leonardo.b Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 10 Oct 2020 Posts: 308
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Ionen Developer
![Developer Developer](/images/ranks/rank-dev.gif)
![](images/avatars/12407261860db424480089.png)
Joined: 06 Dec 2018 Posts: 2892
|
Posted: Sat Sep 24, 2022 12:22 pm Post subject: |
|
|
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 ![Smile :)](images/smiles/icon_smile.gif) 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 |
|
![](templates/gentoo/images/spacer.gif) |
logrusx Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/176594205966916859b5145.jpg)
Joined: 22 Feb 2018 Posts: 2695
|
Posted: Sat Sep 24, 2022 1:06 pm Post subject: |
|
|
Doesn't even have version control... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pa4wdh l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 16 Dec 2005 Posts: 910
|
Posted: Sat Sep 24, 2022 1:07 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Leonardo.b Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 10 Oct 2020 Posts: 308
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
szatox Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 27 Aug 2013 Posts: 3495
|
Posted: Sat Sep 24, 2022 7:25 pm Post subject: |
|
|
Lighttpd might be one option.
Busybox builtin httpd could be another. Chances are you already have this one anyway. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pa4wdh l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 16 Dec 2005 Posts: 910
|
Posted: Sun Sep 25, 2022 9:54 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
pa4wdh l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 16 Dec 2005 Posts: 910
|
Posted: Wed Sep 28, 2022 9:45 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Banana Moderator
![Moderator Moderator](/images/ranks/rank-mod.gif)
![](images/avatars/5204386264b863c6da7ffb.jpg)
Joined: 21 May 2004 Posts: 1889 Location: Germany
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|