diff --git a/www/PerlSiikir.html b/www/PerlSiikir.html deleted file mode 100644 index d9fcc40..0000000 --- a/www/PerlSiikir.html +++ /dev/null @@ -1,154 +0,0 @@ -{% extends "layout.html" %} -{% block title %}About Me{% endblock %} -{% block content %} - - -
-

- - - -
-
- - -

-

-

SiikirPerl

-

How to install the Perl Siikir CMS.

-

-

-
-

Perlbrew

-

Recommended to install a custom Perl w/ perlbrew instead of using your vendor -version of Perl. I made a dedicated user, bob that "owns" the Perl -installation.

-
-  [bob]$ sudo mkdir /opt/perl5 && chown bob:bob /opt/perl5
-  [bob]$ export PERLBREW_ROOT="/opt/perl5"
-  [bob]$ wget -O - http://install.perlbrew.pl | bash
-  [bob]$ perlbrew init
-  [bob]$ perlbrew install perl-5.18.0
-  [bob]$ perlbrew switch perl-5.18.0
-

After installing Perl, make a symlink so that /opt/perl points to the Perl -root, for example:

-
-  /opt/perl -> /opt/perl5/perls/perl-5.18.0
-

So that /opt/perl/bin/perl exists.

-

-

-
-

Apache Configuration

-

You'll need mod_fcgid, mod_rewrite, and probably mod_suexec. On -Debian, install the package apache2-suexec-custom so that you can change -suexec to use /home as its root (not needed if you plan to put your site -under /var/www). The suexec config file is usually at -/etc/apache2/suexec/www-data.

-

Typical VirtualHost configuration for mod_fcgid:

-
-  <VirtualHost *:80>
-    ServerName www.yoursite.com
-    DocumentRoot /home/www/public_html
-    CustomLog /home/www/logs/access_log combined
-    ErrorLog /home/www/logs/error_log
-    SuexecUserGroup www www
-    <Directory "/home/www/public_html">
-      Options Indexes FollowSymLinks ExecCGI
-      AllowOverride All
-      Order allow,deny
-      Allow from all
-    </Directory>
-    <Directory "/home/www/public_html/fcgi">
-      SetHandler fcgid-script
-      Options +ExecCGI
-      AllowOverride All
-      Order allow,deny
-      Allow from all
-    </Directory>
-  </VirtualHost>
-

Follow that up with a .htaccess in your document root:

-
-  <IfModule mod_rewrite.c>
-    RewriteEngine on
-    RewriteBase /
-    RewriteCond %{REQUEST_FILENAME} !-f
-    RewriteCond %{REQUEST_FILENAME} !-d
-    RewriteRule . /fcgi/index.cgi [L]
-    RewriteRule ^$ /fcgi/index.cgi [L]
-  </IfModule>
-

-

-
-

Perl Modules

-

The typical Siikir installation requires these modules. Install them using -cpanminus as your Perl user (bob in my case).

-
-  $ cpan App::cpanminus
-

The required modules (install each with cpanm $NAME):

-
-  CGI::Fast
-  FCGI
-  JSON
-  JSON::XS
-  Image::Magick*
-  LWP::UserAgent
-  Mail::Sendmail
-  Template*
-  Digest::SHA1
-  Net::DNS
-

You'll need JSON::XS. JSON::PP doesn't quite cut it.

-

A couple modules have special cases and might not be installable via cpanm:

-

-

-

Image::Magick

-

Because of Image::Magick's ties with the C ImageMagick library, they need to -be installed by hand. You'll need to download and build ImageMagick from -imagemagick.org (it includes the Perl module, so you don't need to deal with -CPAN at all for this one).

-
-  $ wget http://www.imagemagick.org/download/ImageMagick.tar.gz
-  $ tar -xzvf ImageMagick.tar.gz
-  $ cd ImageMagick-*/
-  $ ./configure --with-perl
-  $ make
-  $ make perl-sources
-  $ sudo make install
-  $ sudo ldconfig /usr/local/lib
-  $ cd PerlMagick
-  $ perl Makefile.PL
-  $ make
-  $ make test
-  $ make install
-

Note: If your site ever starts crashing (particularly after a software -update) saying it can't find libmagick.so or something, run -sudo ldconfig /usr/local/lib to rebuild the library cache.

-

-

-

Misc Notes

-

You'll need libperl-dev installed on the system (if you get an error like -"can't find -lperl" when building).

-

-

-

Template

-

I sometimes have problems installing Template::Toolkit through cpanm because -the test suite doesn't pass completely (35 out of several thousand tests fail). -You can just download and install this module by hand and it works.

- -{% endblock %} diff --git a/www/PerlSiikir.md b/www/PerlSiikir.md new file mode 100644 index 0000000..a6fc0fe --- /dev/null +++ b/www/PerlSiikir.md @@ -0,0 +1,137 @@ +# SiikirPerl + +How to install the Perl Siikir CMS. + +# Perlbrew + +Recommended to install a custom Perl w/ perlbrew instead of using your vendor +version of Perl. I made a dedicated user, `bob` that "owns" the Perl +installation. + +```bash +[bob]$ sudo mkdir /opt/perl5 && chown bob:bob /opt/perl5 +[bob]$ export PERLBREW_ROOT="/opt/perl5" +[bob]$ wget -O - http://install.perlbrew.pl | bash +[bob]$ perlbrew init +[bob]$ perlbrew install perl-5.18.0 +[bob]$ perlbrew switch perl-5.18.0 +``` + +After installing Perl, make a symlink so that `/opt/perl` points to the Perl +root, for example: + +```bash +/opt/perl -> /opt/perl5/perls/perl-5.18.0 +``` + +So that `/opt/perl/bin/perl` exists. + +# Apache Configuration + +You'll need `mod_fcgid`, `mod_rewrite`, and probably `mod_suexec`. On +Debian, install the package `apache2-suexec-custom` so that you can change +suexec to use `/home` as its root (not needed if you plan to put your site +under `/var/www`). The suexec config file is usually at +`/etc/apache2/suexec/www-data`. + +Typical VirtualHost configuration for mod\_fcgid: + +```apache + + ServerName www.yoursite.com + DocumentRoot /home/www/public_html + CustomLog /home/www/logs/access_log combined + ErrorLog /home/www/logs/error_log + SuexecUserGroup www www + + Options Indexes FollowSymLinks ExecCGI + AllowOverride All + Order allow,deny + Allow from all + + + SetHandler fcgid-script + Options +ExecCGI + AllowOverride All + Order allow,deny + Allow from all + + +``` + +Follow that up with a `.htaccess` in your document root: + +```apache + + RewriteEngine on + RewriteBase / + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule . /fcgi/index.cgi [L] + RewriteRule ^$ /fcgi/index.cgi [L] + +``` + +# Perl Modules + +The typical Siikir installation requires these modules. Install them using +cpanminus as your Perl user (`bob` in my case). + +```bash +$ cpan App::cpanminus +``` + +The required modules (install each with `cpanm $NAME`): + +* CGI::Fast +* FCGI +* JSON +* JSON::XS +* Image::Magick* +* LWP::UserAgent +* Mail::Sendmail +* Template* +* Digest::SHA1 +* Net::DNS + +You'll __need__ JSON::XS. JSON::PP doesn't quite cut it. + +A couple modules have special cases and might not be installable via `cpanm`: + +## Image::Magick + +Because of Image::Magick's ties with the C ImageMagick library, they need to +be installed by hand. You'll need to download and build ImageMagick from +imagemagick.org (it includes the Perl module, so you don't need to deal with +CPAN at all for this one). + +```bash +$ wget http://www.imagemagick.org/download/ImageMagick.tar.gz +$ tar -xzvf ImageMagick.tar.gz +$ cd ImageMagick-*/ +$ ./configure --with-perl +$ make +$ make perl-sources +$ sudo make install +$ sudo ldconfig /usr/local/lib +$ cd PerlMagick +$ perl Makefile.PL +$ make +$ make test +$ make install +``` + +__Note:__ If your site ever starts crashing (particularly after a software +update) saying it can't find `libmagick.so` or something, run +`sudo ldconfig /usr/local/lib` to rebuild the library cache. + +### Misc Notes + +You'll need `libperl-dev` installed on the system (if you get an error like +"`can't find -lperl`" when building). + +## Template + +I sometimes have problems installing Template::Toolkit through cpanm because +the test suite doesn't pass completely (35 out of several thousand tests fail). +You can just download and install this module by hand and it works. diff --git a/www/blog/entry.inc.html b/www/blog/entry.inc.html index f95fe5c..42e3408 100644 --- a/www/blog/entry.inc.html +++ b/www/blog/entry.inc.html @@ -27,7 +27,7 @@ on {{ post["pretty_time"] }} - {{ post["body"] | safe }} + {{ post["rendered_body"] | safe }}

diff --git a/www/layout.html b/www/layout.html index adb74af..5c1539d 100644 --- a/www/layout.html +++ b/www/layout.html @@ -4,6 +4,7 @@ {% block title %}{% endblock %} - Kirsle.net + diff --git a/www/solar/codehilite.css b/www/solar/codehilite.css new file mode 100644 index 0000000..3d8347d --- /dev/null +++ b/www/solar/codehilite.css @@ -0,0 +1,82 @@ +/* Syntax highlighting classes for markdown codehilite plugin, which uses + Pygments. This file was generated by doing this in the Python shell: + + >>> from pygments.formatters import HtmlFormatter + >>> fh = open("codehilite.css", "w") + >>> fh.write(HtmlFormatter().get_style_defs(".codehilite")) + >>> fh.close() +*/ + +.codehilite .hll { background-color: #ffffcc } +.codehilite { background: #f8f8f8; } +.codehilite .c { color: #408080; font-style: italic } /* Comment */ +.codehilite .err { border: 1px solid #FF0000 } /* Error */ +.codehilite .k { color: #008000; font-weight: bold } /* Keyword */ +.codehilite .o { color: #666666 } /* Operator */ +.codehilite .cm { color: #408080; font-style: italic } /* Comment.Multiline */ +.codehilite .cp { color: #BC7A00 } /* Comment.Preproc */ +.codehilite .c1 { color: #408080; font-style: italic } /* Comment.Single */ +.codehilite .cs { color: #408080; font-style: italic } /* Comment.Special */ +.codehilite .gd { color: #A00000 } /* Generic.Deleted */ +.codehilite .ge { font-style: italic } /* Generic.Emph */ +.codehilite .gr { color: #FF0000 } /* Generic.Error */ +.codehilite .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.codehilite .gi { color: #00A000 } /* Generic.Inserted */ +.codehilite .go { color: #888888 } /* Generic.Output */ +.codehilite .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.codehilite .gs { font-weight: bold } /* Generic.Strong */ +.codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.codehilite .gt { color: #0044DD } /* Generic.Traceback */ +.codehilite .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.codehilite .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.codehilite .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.codehilite .kp { color: #008000 } /* Keyword.Pseudo */ +.codehilite .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.codehilite .kt { color: #B00040 } /* Keyword.Type */ +.codehilite .m { color: #666666 } /* Literal.Number */ +.codehilite .s { color: #BA2121 } /* Literal.String */ +.codehilite .na { color: #7D9029 } /* Name.Attribute */ +.codehilite .nb { color: #008000 } /* Name.Builtin */ +.codehilite .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.codehilite .no { color: #880000 } /* Name.Constant */ +.codehilite .nd { color: #AA22FF } /* Name.Decorator */ +.codehilite .ni { color: #999999; font-weight: bold } /* Name.Entity */ +.codehilite .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +.codehilite .nf { color: #0000FF } /* Name.Function */ +.codehilite .nl { color: #A0A000 } /* Name.Label */ +.codehilite .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.codehilite .nt { color: #008000; font-weight: bold } /* Name.Tag */ +.codehilite .nv { color: #19177C } /* Name.Variable */ +.codehilite .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.codehilite .w { color: #bbbbbb } /* Text.Whitespace */ +.codehilite .mf { color: #666666 } /* Literal.Number.Float */ +.codehilite .mh { color: #666666 } /* Literal.Number.Hex */ +.codehilite .mi { color: #666666 } /* Literal.Number.Integer */ +.codehilite .mo { color: #666666 } /* Literal.Number.Oct */ +.codehilite .sb { color: #BA2121 } /* Literal.String.Backtick */ +.codehilite .sc { color: #BA2121 } /* Literal.String.Char */ +.codehilite .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.codehilite .s2 { color: #BA2121 } /* Literal.String.Double */ +.codehilite .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +.codehilite .sh { color: #BA2121 } /* Literal.String.Heredoc */ +.codehilite .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +.codehilite .sx { color: #008000 } /* Literal.String.Other */ +.codehilite .sr { color: #BB6688 } /* Literal.String.Regex */ +.codehilite .s1 { color: #BA2121 } /* Literal.String.Single */ +.codehilite .ss { color: #19177C } /* Literal.String.Symbol */ +.codehilite .bp { color: #008000 } /* Name.Builtin.Pseudo */ +.codehilite .vc { color: #19177C } /* Name.Variable.Class */ +.codehilite .vg { color: #19177C } /* Name.Variable.Global */ +.codehilite .vi { color: #19177C } /* Name.Variable.Instance */ +.codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */ + +/* Dark theme overrides --Kirsle */ +.codehilite { background-color: transparent } +.codehilite .nf { color: #0099FF } +.codehilite .sd { color: #FF99FF } +.codehilite .s { color: #FF4400 } +.codehilite .nv { color: #0099FF } +.codehilite .sx, +.codehilite .k, +.codehilite .nb { color: #00BB00 } +.codehilite .nn { color: #00CCCC }