0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Apache2.4でMarkdownを表示する

Posted at

この記事のターゲット

  • Markdown大好きな人
  • 家のサーバとかで公開したいけど変換するのが面倒
  • せっかくリモートでサーバに上げれるのに変換なんてナンセンス
    などと思っている方

手順

1. 準備

# apt install build-essential libtool automake autoconf
# apt install libmarkdown2-dev apache2 apache2-dev
# cd /usr/lib/apache2/modules
$ which apxs apxs2

↑は後で必要になるのでメモしておく

2. mod_markdownのインストール

hamano/apache-mod-markdownのダウンロード

  1. git clone https://github.com/hamano/apache-mod-markdown
  2. Discountからダウンロード

パッケージのビルド

# autoreconf -if
# ./configure —-with-apxs=/usr/bin/apxs2 —-with-discount=/usr
# make
# make install

/usr/bin/apxs2には準備でメモしたものを使用する

3. Apacheの設定

/etc/apache2/apache2.conf
~追記~

LoadModule markdown_module /usr/lib/apache2/modules/mod_markdown.so
<Location />
    AddHandler markdown .md
    
    # MarkdownCss style.css
</Location>

4. Apacheの再起動

# apachectl configtest
Syntax OK
# systemctl restart apache2
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?