mirror of https://github.com/kirsle/kirsle.net
5 changed files with 221 additions and 155 deletions
@ -1,154 +0,0 @@ |
|||
{% extends "layout.html" %} |
|||
{% block title %}About Me{% endblock %} |
|||
{% block content %} |
|||
|
|||
<!-- INDEX BEGIN --> |
|||
<div name="index"> |
|||
<p><a name="__index__"></a></p> |
|||
|
|||
<ul> |
|||
|
|||
<li><a href="#siikirperl">SiikirPerl</a></li> |
|||
<li><a href="#perlbrew">Perlbrew</a></li> |
|||
<li><a href="#apache_configuration">Apache Configuration</a></li> |
|||
<li><a href="#perl_modules">Perl Modules</a></li> |
|||
<ul> |
|||
|
|||
<li><a href="#image__magick">Image::Magick</a></li> |
|||
<ul> |
|||
|
|||
<li><a href="#misc_notes">Misc Notes</a></li> |
|||
</ul> |
|||
|
|||
<li><a href="#template">Template</a></li> |
|||
</ul> |
|||
|
|||
</ul> |
|||
|
|||
<hr name="index" /> |
|||
</div> |
|||
<!-- INDEX END --> |
|||
|
|||
<p> |
|||
</p> |
|||
<h1><a name="siikirperl">SiikirPerl</a></h1> |
|||
<p>How to install the Perl Siikir CMS.</p> |
|||
<p> |
|||
</p> |
|||
<hr /> |
|||
<h1><a name="perlbrew">Perlbrew</a></h1> |
|||
<p>Recommended to install a custom Perl w/ perlbrew instead of using your vendor |
|||
version of Perl. I made a dedicated user, <code>bob</code> that "owns" the Perl |
|||
installation.</p> |
|||
<pre> |
|||
[bob]$ sudo mkdir /opt/perl5 && chown bob:bob /opt/perl5 |
|||
[bob]$ export PERLBREW_ROOT="/opt/perl5" |
|||
[bob]$ wget -O - <a href="http://install.perlbrew.pl">http://install.perlbrew.pl</a> | bash |
|||
[bob]$ perlbrew init |
|||
[bob]$ perlbrew install perl-5.18.0 |
|||
[bob]$ perlbrew switch perl-5.18.0</pre> |
|||
<p>After installing Perl, make a symlink so that <code>/opt/perl</code> points to the Perl |
|||
root, for example:</p> |
|||
<pre> |
|||
/opt/perl -> /opt/perl5/perls/perl-5.18.0</pre> |
|||
<p>So that <code>/opt/perl/bin/perl</code> exists.</p> |
|||
<p> |
|||
</p> |
|||
<hr /> |
|||
<h1><a name="apache_configuration">Apache Configuration</a></h1> |
|||
<p>You'll need <code>mod_fcgid</code>, <code>mod_rewrite</code>, and probably <code>mod_suexec</code>. On |
|||
Debian, install the package <code>apache2-suexec-custom</code> so that you can change |
|||
suexec to use <code>/home</code> as its root (not needed if you plan to put your site |
|||
under <code>/var/www</code>). The suexec config file is usually at |
|||
<code>/etc/apache2/suexec/www-data</code>.</p> |
|||
<p>Typical VirtualHost configuration for mod_fcgid:</p> |
|||
<pre> |
|||
<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></pre> |
|||
<p>Follow that up with a <code>.htaccess</code> in your document root:</p> |
|||
<pre> |
|||
<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></pre> |
|||
<p> |
|||
</p> |
|||
<hr /> |
|||
<h1><a name="perl_modules">Perl Modules</a></h1> |
|||
<p>The typical Siikir installation requires these modules. Install them using |
|||
cpanminus as your Perl user (<code>bob</code> in my case).</p> |
|||
<pre> |
|||
$ cpan App::cpanminus</pre> |
|||
<p>The required modules (install each with <code>cpanm $NAME</code>):</p> |
|||
<pre> |
|||
CGI::Fast |
|||
FCGI |
|||
JSON |
|||
JSON::XS |
|||
Image::Magick* |
|||
LWP::UserAgent |
|||
Mail::Sendmail |
|||
Template* |
|||
Digest::SHA1 |
|||
Net::DNS</pre> |
|||
<p>You'll <strong>need</strong> JSON::XS. JSON::PP doesn't quite cut it.</p> |
|||
<p>A couple modules have special cases and might not be installable via <code>cpanm</code>:</p> |
|||
<p> |
|||
</p> |
|||
<h2><a name="image__magick">Image::Magick</a></h2> |
|||
<p>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).</p> |
|||
<pre> |
|||
$ wget <a href="http://www.imagemagick.org/download/ImageMagick.tar.gz">http://www.imagemagick.org/download/ImageMagick.tar.gz</a> |
|||
$ 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</pre> |
|||
<p><strong>Note:</strong> If your site ever starts crashing (particularly after a software |
|||
update) saying it can't find <code>libmagick.so</code> or something, run |
|||
<code>sudo ldconfig /usr/local/lib</code> to rebuild the library cache.</p> |
|||
<p> |
|||
</p> |
|||
<h3><a name="misc_notes">Misc Notes</a></h3> |
|||
<p>You'll need <code>libperl-dev</code> installed on the system (if you get an error like |
|||
"<code>can't find -lperl</code>" when building).</p> |
|||
<p> |
|||
</p> |
|||
<h2><a name="template">Template</a></h2> |
|||
<p>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.</p> |
|||
|
|||
{% endblock %} |
@ -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 |
|||
<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: |
|||
|
|||
```apache |
|||
<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). |
|||
|
|||
```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. |
@ -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 } |
Loading…
Reference in new issue