2 Apache
David Campbell edited this page 2024-11-19 16:49:35 -05:00

Apache

Deployment

mdbook build --dest-dir /var/www/html/

Sitemap

To setup sscli a sitemap generator:

# As of this writing:
# installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

# download and install Node.js (you may need to restart the terminal)
nvm install 22

# verifies the right Node.js version is in the environment
node -v # should print `v22.11.0`

# verifies the right npm version is in the environment
npm -v # should print `10.9.0`

# install sscli
npm i -g static-sitemap-cli

Everytime you update your site:

mdbook build --dest-dir /var/www/html/
sscli -b https://<your.domain.name> -r /var/www/html/

404 Pages (Global Setup)

Add a 404.md file to the root directory of your book. Deploy your site: mdbook build --dest-dir /var/www/html/

Edit /etc/apache2/apache.conf.

Add the line: ErrorDocument 404 /404.html

Restart Apache: systemctl restart apache2