Ubuntu 20.04.3 server can Apache be made to render md documents like on GitHub?

Bo Berglund bo.berglund at gmail.com
Wed Jan 12 23:11:21 UTC 2022


On Wed, 12 Jan 2022 21:03:12 +0000, Peter Flynn <peter at silmaril.ie> wrote:

>> Right now I have followed the apt install part of the github readme, 
>> so Apache is up and running but I don't know (yet) how to proceed.

I have come a long bit further now! :)

What I did was the following after installing the indicated packages:

Cd into the source dir checked out from GitHub, then

autoreconf -f -i
./configure --with-apxs=/usr/bin/apxs --with-discount=/usr
make
sudo make install

sudo nano /etc/apache2/apache2.conf
Enter this before the <Directory> section:

#Module responsible for rendering md documents
LoadModule markdown_module /usr/lib/apache2/modules/mod_markdown.so

sudo nano /etc/apache2/sites-available/000-default.conf
Enter this line into the file towards the end:

        AddHandler markdown .md

Copy the file LinuxCommands.md to /var/www/html (my Linux notes)

Restart apache:
sudo systemctl restart apache2

Test if the md file is handled via a browser:

http://ubu-asa/LinuxCommands.md

And voila! The md document is displayed and mostly readable, except parts seem
to be non-recognized by the mod_markdown, so they look awful, not anywhere like
they are rendered by the FireFox add-on when opened with a file system URL. 

I guess this can be solved using a style sheet so now I need to find such, which
can render my file sensibly.


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list