This site now uses Mojolicious! Wheeee!

My Apache setup:

<VirtualHost *:80 > ServerName oddmuse.org ServerAlias www.oddmuse.org Redirect permanent / https://oddmuse.org/ </VirtualHost> <VirtualHost *:443 > ServerAdmin alex@oddmuse.org <Directory /> Options None AllowOverride None Order Deny,Allow Deny from all </Directory> ServerName oddmuse.org ServerAlias www.oddmuse.org DocumentRoot /home/alex/oddmuse.org <Directory /home/alex/oddmuse.org > Options ExecCGI Includes Indexes MultiViews SymLinksIfOwnerMatch AddHandler cgi-script .pl AllowOverride All Order Allow,Deny Allow from all </Directory> SSLEngine on SSLCertificateFile /etc/letsencrypt.sh/certs/oddmuse.org/cert.pem SSLCertificateKeyFile /etc/letsencrypt.sh/certs/oddmuse.org/privkey.pem SSLCertificateChainFile /etc/letsencrypt.sh/certs/oddmuse.org/chain.pem SSLVerifyClient None ProxyPass /wiki http://oddmuse.org:8080/wiki ProxyPass /mojo http://oddmuse.org:8080/mojo # https://oddmuse.org/ ProxyPassMatch "^/$" http://oddmuse.org:8080/wiki </VirtualHost>

Documents are still served from ~/oddmuse.org but the script it served by the toadfarm :

My farm at ~/farm/farm :

#!/usr/bin/env perl use Toadfarm - init; $ENV {PATH} .= ":/usr/local/bin" ; # hypnotoad in a non-standard location my $farm = '/home/alex/farm' ; logging { combined => 1 , file => "$farm/farm.log" , level => "error" , }; # more stuff... mount "$farm/oddmuse.pl" => { "Host" => qr{^oddmuse\.org:8080$} , mount_point => '/wiki' , }; plugin "Toadfarm::Plugin::AccessLog" ; start; # needs to be at the last line

My script at ~/farm/oddmuse.pl :

#! /usr/bin/env perl use Mojolicious:: Lite; plugin CGI => { support_semicolon_in_query_string => 1 , }; plugin CGI => { route => '/' , script => '/home/alex/farm/wiki.pl' , # ~/farm/wiki.pl run => \& OddMuse:: DoWikiRequest, before => sub { my $c = shift ; $ OddMuse:: RunCGI = 0 ; $ OddMuse:: DataDir = '/home/alex/oddmuse' ; require '/home/alex/farm/wiki.pl' unless defined & OddMuse:: DoWikiRequest; }, env => {}, errlog => '/home/alex/farm/oddmuse.log' , }; app -> start;

The wiki script itself is ~/farm/wiki.pl .

I installed perl via perlbrew, recently, so I think I have a pretty decent collection of all the things I required:

cpanm IO::Pipely cpanm Mojolicious cpanm Toadfarm # cpanm Mojolicious::Plugin::CGI cpanm -- sudo https: // cpan.metacpan.org / authors / id / J / JH / JHTHORSEN / Mojolicious - Plugin - CGI - 0.26.tar.gz cpanm File::Which cpanm Proc::ProcessTable cpanm Toadfarm::Plugin::AccessLog cpanm CGI # The rest is stuff I needed for other applications or code in my config files # cpanm Time::ParseDate # cpanm Mojolicious::Plugin::Authentication # cpanm HTTP::AcceptLanguage # cpanm LWP::UserAgent # cpanm XML::Atom # cpanm HTTP::Server::Simple # cpanm Pod::Strip # cpanm Crypt::Rijndael # cpanm Crypt::Random::Seed # cpanm RPC::XML # cpanm HTML::Template # cpanm Capture::Tiny # cpanm MLDBM # cpanm Captcha::reCAPTCHA # cpanm DB_File # requires sudo apt - get install libxml2 - dev # cpanm XML::LibXML # requires sudo apt - get install libgd2 - xpm - dev # cpanm GD # requires sudo apt - get install libdb - dev # cpanm DB_File

I needed 0.26 of the plugin instead of the current 0.32 because of a bug.

Let me know if anything breaks.