Deploying Your MkDocs Site on a Subdomain¶
This guide details how to deploy your MkDocs documentation to a subdomain (e.g., wiki.mus.is).
1. Build Your MkDocs Documentation¶
Navigate to your MkDocs project directory and build the static site:
This creates the site/
directory with your generated documentation.
2. Set the DocumentRoot in Your Virtual Host¶
Ensure the Apache virtual host (configured in setup-subdomain.md) uses the correct path. For example, if your MkDocs project is in /var/www/wiki/
, then the DocumentRoot should be:
Adjust the path if your project directory is different.
3. Adjust File Permissions¶
Make sure Apache can read your documentation files. For example:
Alternatively, adjust permissions so that the Apache user has access.
4. Reload Apache to Apply Changes¶
5. Verify Your Deployment¶
Open your browser and visit https://wiki.mus.is to ensure your MkDocs site is served correctly.
6. Troubleshooting¶
-
Permission Issues:
Confirm that the Apache user (www-data
) has sufficient permissions to read yoursite/
directory. -
Module Errors:
Refer to setup-mkdocs.md for further details.
If you encounter errors likecannot find module 'pymdownx.emoji'
, install missing dependencies: