Ever wanted to experiment with the engine PerlMonks is built on? I did, but it's rather difficult to install, so I thought I'd write this for anyone who wanted to give it a go themselves.

My Perl is v5.16.2. YMMV for others.

Requirements:

Estimated time: a quiet evening or so

  1. Download Apache 1.3.9 and mod_perl 1.14 from your nearest mirror, then unpack them. You may use other versions, but this guide won't apply to them.

  2. I wanted to install it all to my home directory. I ran mod_perl's Makefile.PL like so:

    perl Makefile.PL APACHE_SRC=../apache_1.39/src APACHE_PREFIX=$HOME/opt/apache1.3.9 DO_HTTPD=1 USE_APACI=1 EVERYTHING=1 PREFIX=/home/thomas/perl5
    Adjust as needed.
  3. If you have a relatively new version of gcc and a Perl v5.14 or newer, you will need to make some changes to the source. Apply this patch file to the mod_perl directory, and this one to the apache directory. It does the following (you can skip these details if you want):

    • In v5.16, $<; and friends are no longer cached. I just tried removing the problematic section that used these variables, and that seemed to work. You might not be able to run your server as root (which requires being able to change its own permissions), but I haven't checked.

    • For some reason, it was a trend to supply your own version of getline (maybe the libc one was broken, haven't looked it up) in those days. In any case, gcc complains about it, so I updated all of the code to use the Apache one. (it only affects the password utility, which is not really needed in our case, but it does cause make to fail)

    • In v5.14, you can't use the result of GvCV and friends as lvalues anymore, so I replaced the places where something was assigned to the result of that function with the appropriate _set macro, as the delta advises.

  4. Run make and make install, and go make some coffee. You can make test, too, but then also grab a sandwich.

  5. Try to start Apache as make install's instructions suggest, to make sure it works. You may need to choose a different port number, do so with the Listen and Port options in httpd.conf

    • If you installed Apache locally, you will need to modify apachectl and/or your shell startup script: make sure that the PERL5LIB environment variable is set to where mod_perl's Perl libraries are installed.

    Now for Everything else...

  6. Download this, unpack it, and follow QUICKINSTALL up to (but not yet including) the install_esite

    • When running Makefile.PL, if you want to install locally, don't forget to set PREFIX accordingly.

    • It is not necessary to let it append things to your httpd.conf, in a later step I'll show you why and what to do instead.

  7. If you have a modern mysql/mariadb, some of the SQL scripts won't work. Here is another patch to fix them.

    • It mostly has to do with the default values of the integer columns: by getting rid of the default value of a quoted zero, mysql accepts it.

    • There is also a timestamp column that has a size in the script, but mysql doesn't like that, so by getting rid of it, it works again.

  8. Now run install_esite, as QUICKINSTALL says.

  9. For some reason, index.pl only showed up as text, perhaps due to the other mod_perl settings I'd been playing with, or perhaps it was something else. I added this to httpd.conf, and then it worked:

    PerlModule Apache::Registry PerlModule Apache::DBI PerlModule CGI <Files *.pl> SetHandler perl-script PerlHandler Apache::Registry Options +ExecCGI PerlSendHeader On PerlSetupEnv On </Files>
  10. (Re)start Apache, visit /index.pl, and have lots of fun!

If something doesn't work for you, post it below.

Happy hacking!


Edit: forgot the third patch

-Thomas
"Excuse me for butting in, but I'm interrupt-driven..."
Did you know this software was released when I was only 3 years old? Still works, too -- I find that amazing.

EDIT 2016-07-19: Updated GitHub links

Replies are listed 'Best First'.
Re: Want to make an Everything site of your own?
by hippo (Archbishop) on Apr 20, 2015 at 09:27 UTC
    Download Apache 1.3.9 and mod_perl 1.14 from your nearest mirror, then unpack them.

    Alternatively ...

    Don your trusty leather jacket and lucky fedora. Ensure you have your whip to hand. Head out boldly to your nearest mirror, ensuring you have told Marcus where you are headed (just in case). Delve deep into the archive keeping a careful eye out for snakes (why does it always have to be snakes?). The footing will be treacherous this far down in the catacombs, so take care. Should you locate the ancient tarball be sure to replace it with something of equal mass lest a boulder roll down and crush you. Make your way back out with the prize quickly but without undue haste lest you trigger any of the booby traps.

    Once safely back, ensure that the tarball is unpacked in a contained environment and under no circumstances look at the contents. Ensure Marion doesn't look at them either.


    Seriously, thanks for taking the time to write this up. I note that this very site uses (or claims to be using) Apache 2.2.29. If that works, then there's really no need to be downloading something from the last millennium.

      I like your alternate directions, and although old software can be like navigating an Indiana Jones-esque cave, it's not that difficult :-P

      I tried to make Everything play with Apache 2 a while ago, but it didn't work for some reason or other. I'll try it again some day, maybe after AP Tests (too bad they don't allow Perl on those, it would make things so much easier), although I promised myself the same thing about this guide. ;)

      -Thomas
      "Excuse me for butting in, but I'm interrupt-driven..."