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:
A MySQL/MariaDB server
GNU patch
C compiler
Some knowledge of how Apache works
Estimated time: a quiet evening or so
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.
I wanted to install it all to my home directory. I ran
mod_perl's Makefile.PL like so:
Adjust as needed.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
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.
Run make and make install, and go make some coffee. You can make test, too, but then also grab a sandwich.
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...
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.
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.
Now run install_esite, as QUICKINSTALL says.
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>
(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..."
EDIT 2016-07-19: Updated GitHub links
In reply to Want to make an Everything site of your own? by thomas895
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |