Skip to content

Deployment Guide

This guide explains how to deploy the documentation site to cPanel.

Prerequisites

  • cPanel hosting account
  • Node.js 16+ installed on your local machine
  • Access to cPanel File Manager or FTP credentials

Build the Documentation

  1. Build the static files locally:
bash
npm run docs:build

This will create a .vitepress/dist directory inside the docs folder containing the static files.

Deployment Steps

Using File Manager

  1. Log in to your cPanel account
  2. Open File Manager
  3. Navigate to public_html (or your desired subdirectory)
  4. Upload the contents of the docs/.vitepress/dist directory
  5. Ensure index.html is in the root of your chosen directory

Using FTP

  1. Connect to your hosting using FTP credentials
  2. Navigate to public_html (or your desired subdirectory)
  3. Upload the contents of the docs/.vitepress/dist directory
  4. Verify that index.html is in the root directory

Configuration

Setting up Node.js (if running dynamically)

If you want to run the documentation site dynamically:

  1. In cPanel, find "Setup Node.js App"
  2. Click "Create Application"
  3. Set the following:
    • Node.js version: 16 or higher
    • Application mode: Production
    • Application root: Your directory path
    • Application URL: Your domain or subdomain
    • Application startup file: docs/.vitepress/dist/index.html
  4. Click "Create"

Apache Configuration

If you need to handle client-side routing, create or edit .htaccess:

apache
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>

Post-Deployment

  1. Test all documentation pages
  2. Verify that navigation works
  3. Check that all assets (images, etc.) load correctly
  4. Test the search functionality

Troubleshooting

Common Issues

  1. 404 Errors:

    • Ensure .htaccess is properly configured
    • Verify all files are in the correct directory
  2. Missing Assets:

    • Check file permissions (should be 644 for files, 755 for directories)
    • Verify asset paths in the built files
  3. Blank Pages:

    • Check browser console for errors
    • Verify JavaScript is enabled and loading

File Permissions

Set correct permissions:

bash
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;