Git Product home page Git Product logo

mod_whoisng's Introduction

mod_whoisng

mod_whoisng is an Apache 2.x module which implements a Whois/NICNAME (RFC 3912) service. Whois queries received from clients are converted into internal requests which can be handled in the same way as HTTP requests (ie PHP script, CGI script, static content, etc).

INSTALLATION

To install mod_whoisng, type this command:

apxs -i -a -c mod_whoisng.c

You will need the Apache development headers to be installed.

CONFIGURATION

The simplest possible configuration for mod_whoisng is as follows:

Listen 43

<VirtualHost *:43>
    WhoisProtocol On
</VirtualHost>

With this configuration, inbound whois queries will be mapped to the URI /cgi-bin/whois?query=<query>, with <query> properly quoted. <query> will contain the complete string as sent by the whois client, so if the client sends a query like

-i admin-c TEST-HANDLE

the CGI will receive the string

-i%20admin-c%20TEST-HANDLE

in the CGI variable named "query". No parsing of flags is done in the module, this is up to script handling the URI.

To change the mapping destination, add to your httpd.conf:

WhoisPrefix "GET /whois.php?searchstring="

(WhoisPrefix will have the whois query appended). You can not only map queries to scripts, but also to static content:

WhoisPrefix "GET /whoisinfo/" 

will make Apache try to retrieve /whoisinfo/bla if asked for "bla".

Attention: Be aware that if an 404 occurs, the client is presented with an ugly HTML error message (which will contain the mapped URI). So, if you map to static content, you may want to add (for example):

ErrorDocument 404 /whoisinfo/404.txt

which contains appropriate error message to your installation. You may also want to add an

ErrorDocument 500 /whoisinfo/500.txt

in case your CGI fails (e.g. to connect to your backend database).

LICENSE

Please see the LICENSE file in the source distribution.

HISTORY

mod_whoisng is a fork of the mod_whois module, originally written by Alexander Mayrhofer [email protected]. The license used for mod_whois prohibited reuse of the name "mod_whois" so "mod_whoisng" was chosen as the new name.

mod_whoisng's People

Contributors

gbxyz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

dotsensei

mod_whoisng's Issues

Default query "a" when query blank, or else not working

Without a query parameter, the letter "a" becomes the default query, but if I specify a parameter from my WHOIS client then the result is nothing at all (as in 0 bytes) returned. No errors appear in the log files.

If I browse to my "/whois.pl" script using any web browser, I get a plain/text output as expected (because my script is programmed to send output using the "text/plain" content-type).

The following lines are from my httpd.conf file:

LoadModule whoisng_module     lib/httpd/mod_whoisng.so
Listen 43
<VirtualHost *:43>
    WhoisProtocol On
    WhoisPrefix "GET /whois.pl?q="
    ErrorDocument 404 /whois404.txt
    ErrorDocument 500 /whois500.txt
</VirtualHost>

I'm running this on my test server which runs Apache HTTPd v2.4.27 on NetBSD v7.0 (amd64).

Thanks in advance.

Fix for CentOS 7

Fails with segment fault on CentOS 7 with httpd 2.2x and httpd 2.4x

Fix:
Change line 68 of mod_whoisng.c
int len=1;
Change to
apr_size_t len=1;

Recompile and restart httpd

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.