How to have an Apache server host a Gopher site? Can PHP do it?

Discussion in 'Web Design and Development' started by blanka, Sep 5, 2013.

  1. blanka macrumors 68000

    Joined:
    Jul 30, 2012
    #1
    I have plans to make my new website a Gopher protocol site. Just go back to the roots of internet and leave all the eye candy and CSS3 behind.
    Since it is basically text and hyperlinks, I think PHP should be able to generate gopher code based on my MySQL database.
    But I can't figure out how to set that up with Apache. Should I write custom mod-rewrite calls for it in the .htaccess file?
     
  2. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #2
    Good news, bad news:

    There is an Apache2 module for the Gopher protocol handler available at CPAN but it's circa 2004 so not sure about reliability: http://search.cpan.org/~tmurray/Apache-GopherHandler-0.1/

    Or, since PHP 4.3 the protocol has been supported with the gopher_parsedir() function to parse output from Gopher calls as outlined here: http://www.php.net/manual/en/function.gopher-parsedir.php if you only need to run as a client.

    For creating a server via PHP (with a dependency of InetD, meaning *nix server with access to /etc/inetd.conf) follow this tutorial: http://evertpot.com/100/

    Cheers.

    -jim
     

Share This Page