nohttpd logo

Welcome to nohttpd, and what's this all about?

Screenshots
Changelog
Download (Windows installer)
Download (source code for all operating systems, including Linux and Mac OS X)
Hosts files
Thanks and credits
Contact

nohttpd is a very simple webserver with only one, special functionality: To return a http 404 error code (which means the file was not found on the server) to the browser.

This can be useful if you are using a modified hosts file, for example to prevent ads or banners from being loaded. For some recommended hosts files please see section Hosts files.

A hosts file is always part of your operating system (i.e. Windows, Linux etc.) and can be used to manually resolve Internet hostnames like "www.slashdot.org" to a numerical IP address like 66.35.250.151. All communication on the Internet solely uses numerical addresses, so such a conversion happens all the time, albeit automatically and invisible to you as the user.
If you'd like to know more about domain-/hostnames and IPs: http://computer.howstuffworks.com/dns.htm covers the basics.

What a modified hosts file does is resolving hostnames of webservers containing annoying ads to your local network interface, the so-called "loopback device" with address 127.0.0.1. Every computer connected to a network possesses a loopback device, and it always points back to your computer.
So instead of querying the ad server for an ad your own computer is contacted by your browser. Usually there's no webserver running and sending out ads, so basically you get rid of mosts ads displayed in your browser when surfing the net.

The only problem using this method was my then preferred browser Opera and Firefox nowadays, which take some time to realize that there won't be an answer for their requests for ads on the local network interface, thus delaying page loading.

And that's what nohttpd does: Rapidly answering http requests to your local interface with a 'file not found' message, speeding up surfing with a modified hosts file using Opera or Mozilla-based browsers like Firefox.

One additional remark: eDexter (http://www.accs-net.com/hosts/eDexter.html) basically does the same, but is much more configurable and has more features. You may specify your own graphics being displayed instead of the ads, for example. You have to recognize your needs; while nohttpd is slim and requires no configuration, eDexter is more complex.

Top

Screenshots


nohttpd Windows screenshot nohttpd Linux screenshot
nohttpd running on Windows XP nohttpd running on Linux (KDE 3.5, GTK2)
nohttpd Mac OS X screenshot nohttpd statistics screenshot
nohttpd running on Mac OS X nohttpd statistics on Linux
Top

Changelog

Update to version 2.1.0 (06/18/2006):
Note: This version may be safely installed over an existing nohttpd 2.0.x installation.

This version introduces support for compiling on Mac OS X. Many thanks to Jaroslaw Piwonski for his help!

Update to version 2.0.1 (02/23/2006):
Note: This version may be safely installed over an existing nohttpd 2.0.0 installation.

Update to version 2.0.0 (01/12/2006):

The following changes were for the Windows version only, but are also incorporated in nohttpd 2.0.0 for all operating systems.

Update to version 1.03 (03/11/2004):

Update to version 1.02 (06/12/2003):

Both changes done by request.

Update to version 1.01 (03/22/2003):

Done by request.

Top

Download nohttpd Windows installer

nohttpd supports Windows 98 and higher (Windows ME, Windows 2000, Windows XP, Windows Server 2003).

Install nohttpd by executing the downloadable file below. The installer asks if you want to start nohttpd with each session, which is recommended.
Please note that nohttpd automatically minimizes to the tray bar when started.

Note: nohttpd requires Administrator privileges to run.


Download nohttpd Windows installer (version 2.1.0, date 06/18/06). Size: 436kb

Attention: The download links are redirects to the actual files, so you have to open them with a left click ("Save as" won't work).


License: nohttpd is Open Source software licensed under the GPL.
This means nohttpd is free of charge, and you are even allowed to use its source code in your own programs, if you comply to the terms of the GPL.

Top

Download nohttpd source code for all operating systems

nohttpd uses wxWidgets for its GUI elements and the BSD socket API for networking. Both should be available for common operating systems. The source has been successfully compiled on Windows XP, Linux and Mac OS X. If you managed to compile nohttpd for an OS not listed here, I'd be very grateful for a short email, perhaps with compile instructions if you had to tweak some things.

To compile nohttpd on any OS you'll need wxWidgets.
Most Linux distributions package wxWidgets and it's well-advised to use such a package if available. nohttpd was developed with wxWidgets 2.6.3 and you should make sure you are linking at least to the currently stable 2.6 branch.
On Windows you'll have to download the wxWidgets source and compile the library yourself. Please understand that I can not give support for compilation problems of wxWidgets; if you have got troubles try the wx forum or the wx mailing list.

nohttpd's source compiles with both ANSI and Unicode builds of wxWidgets.

Quick compile instructions by operating system:

All of the above commands will create the nohttpd executable in the source directory. Manually copy that executable wherever you think it fits (like /usr/local/bin on Linux).

Attention: nohttpd is required to run with root priviledges, because it has to bind to the priviledged port 80, the default webserver port. Unfortunately, it is not possible to drop root priviledges when using GTK+ (which the Linux port of wxWidgets does), and therefore nohttpd must be kept running as root. This will raise security concerns for sure, and rightfully so, but I think those are negligible in the case of nohttpd because

The easiest way to start nohttpd as an ordinary user on a Linux system you have root access to is probably via sudo. To achieve this you need an entry in /etc/sudoers like username ALL=/path/to/nohttpd NOPASSWD: /path/to/nohttpd, with username substituted to the name of the user you want to start nohttpd from and /path/to/nohttpd pointing to the location of the nohttpd executable (for example /usr/local/bin/nohttpd). Please note that by default the nohttpd executable is created by make -f Makefile.linux in the same directory you extracted the source code zip to.
Refer to your distribution's documentation or man sudoers for further information about sudo.


Download zipped nohttpd source code (version 2.1.0, date 06/18/06). Size: 74kb

Attention: The download links are redirects to the actual files, so you have to open them with a left click ("Save as" won't work).


License: nohttpd is Open Source software licensed under the GPL.

As for any Open Source project, patches are very welcome. However, if you don't know how to program but have some idea to improve nohttpd, you are of course welcome to mail me. See section Contact for the email address.

Top

Hosts files

Here are some links to recommended hosts files. Please make sure to read the documentation on the sites, they contain valuable information and hints.

Top

Thanks and credits

Thanks to the team of wxWidgets for providing a great Open Source cross-platform programming toolkit.
Also thanks to Nullsoft for NSIS, their Open Source installer system and to the folks of HM NIS Edit for providing an easy way to actually use NSIS.
Further thanks to Jaroslaw Piwonski for his help on getting nohttpd to compile and run on Mac OS X.

Top

Contact the author

If you want to drop me an email, feel free to mail to c.buck(at}gmx.de.

Attention: Replace the '(at}' with an '@'. This is a protection against spam bots.
Also please make sure to have the word 'nohttpd' in the subject to avoid being trapped by a spam filter.

I prefer to receive PGP encrypted mail (see http://www.gnupg.org or www.pgpi.com). My public key as ASCII is available here.

Christian Buck