安装环境 ubuntu16.04 64位
下载源码
git clone https://github.com/hamano/apache-mod-markdown.git
安装依赖
apt-get install build-essential libtool automake autoconfapt-get install libmarkdown2-dev apache2-dev
编译安装
autoreconf -f -i./configure --with-apxs=/usr/bin/apxs2 --with-discount=/usrmakesudo make install
赋予so权限
sudo chmod 644 /usr/lib/apache2/modules/mod_markdown.so
修改apache配置文件
sudo vim /etc/apache2/apache2.conf
添加以下数据
LoadModule markdown_module /usr/lib/apache2/modules/mod_markdown.so<Location /> ???AddHandler markdown .md ???????# If you want to use stylesheet. ???MarkdownCss style.css</Location>
重启apache
sudo systemctl restart apache2
最终效果
apache服务器显示md文件
原文地址:https://www.cnblogs.com/QUSIR/p/9056060.html