Appearance
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
- Build the static files locally:
bash
npm run docs:buildThis will create a .vitepress/dist directory inside the docs folder containing the static files.
Deployment Steps
Using File Manager
- Log in to your cPanel account
- Open File Manager
- Navigate to
public_html(or your desired subdirectory) - Upload the contents of the
docs/.vitepress/distdirectory - Ensure
index.htmlis in the root of your chosen directory
Using FTP
- Connect to your hosting using FTP credentials
- Navigate to
public_html(or your desired subdirectory) - Upload the contents of the
docs/.vitepress/distdirectory - Verify that
index.htmlis in the root directory
Configuration
Setting up Node.js (if running dynamically)
If you want to run the documentation site dynamically:
- In cPanel, find "Setup Node.js App"
- Click "Create Application"
- 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
- 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
- Test all documentation pages
- Verify that navigation works
- Check that all assets (images, etc.) load correctly
- Test the search functionality
Troubleshooting
Common Issues
404 Errors:
- Ensure
.htaccessis properly configured - Verify all files are in the correct directory
- Ensure
Missing Assets:
- Check file permissions (should be 644 for files, 755 for directories)
- Verify asset paths in the built files
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 {} \;