Advanced Configuration

This section covers advanced configuration tasks for your LIVCK installation, including adding additional domains to your status page and managing SSL certificates.

Adding Additional Domains

You can configure multiple domains or subdomains to point to your LIVCK status page. This is useful when you want to make your status page accessible from different URLs.

Prerequisites

  • Root or sudo access to your server
  • Domains must be pointed to your server's IP address via DNS
  • Navigate to the LIVCK directory: cd /opt/livck

Quick Setup (Recommended)

Option 1: Add domain with HTTP + SSL (Recommended)

NEW_DOMAIN="status.example.com" && EMAIL="[email protected]" && sed "s/INSTALLER-REPLACEMENT/$NEW_DOMAIN/g" /opt/livck/docker/web/sites/default.sample >> /opt/livck/docker/web/sites/default.conf && docker compose exec app nginx -t && docker compose exec app certbot --nginx -d $NEW_DOMAIN --email $EMAIL --agree-tos --non-interactive

Replace:

This command will:

  1. Set your domain and email
  2. Add it to the Nginx configuration
  3. Test the configuration
  4. Obtain an SSL certificate from Let's Encrypt

Done! Your domain is accessible via HTTP and has an SSL certificate ready to be activated.


Option 2: Add domain with HTTP only

NEW_DOMAIN="status.example.com" && sed "s/INSTALLER-REPLACEMENT/$NEW_DOMAIN/g" /opt/livck/docker/web/sites/default.sample >> /opt/livck/docker/web/sites/default.conf && docker compose exec app nginx -t

Replace status.example.com with your actual domain. This command will:

  1. Set your domain
  2. Add it to the Nginx configuration
  3. Test the configuration

Done! Your domain is now accessible via HTTP (you can add SSL later).


SSL Certificate Renewal

Let's Encrypt certificates are valid for 90 days. Certbot can automatically renew them.

Automatic Renewal is by default enabled in the Docker container and runs automatically.

Manual Renewal

To manually renew all certificates:

docker compose exec app certbot renew

Troubleshooting

Domain Not Accessible

Check DNS:

nslookup your-domain.com

Check if app-container is running:

docker compose ps

Check Nginx logs:

docker compose logs app

Certbot Fails

Common issues:

  1. Port 80 not accessible

    • Ensure firewall allows port 80
    • Check if another service is using port 80
  2. DNS not propagated

    • Wait for DNS propagation (can take up to 48 hours)
    • Use nslookup or dig to verify DNS records
  3. Rate limiting

    • Let's Encrypt has rate limits (5 certificates per domain per week)
    • If you hit the limit, wait a week or use staging environment for testing

Test with staging environment:

docker compose exec app certbot --nginx -d your-domain.com --email [email protected] --agree-tos --staging --non-interactive

Nginx Configuration Errors

Check for syntax errors:

docker compose exec app nginx -t

Common mistakes:

  • Missing semicolons at the end of directives
  • Mismatched brackets { }
  • Incorrect file paths
  • Duplicate server_name directives across server blocks

Best Practices

Security

  • Always use SSL/TLS certificates for production domains
  • Enable HSTS (Strict-Transport-Security header)
  • Keep Certbot and Nginx updated
  • Use strong SSL protocols (TLSv1.2 and TLSv1.3 only)

Performance

  • Enable gzip compression (already enabled in sample)
  • Set appropriate client_max_body_size for your use case
  • Monitor Nginx access and error logs regularly

Maintenance

  • Test configuration changes before applying them
  • Keep backups of working Nginx configurations
  • Document any custom modifications
  • Set up automatic SSL certificate renewal

Multiple Domains

  • You can add as many domains as needed by repeating the process
  • Each domain can have its own server block
  • All domains will serve the same LIVCK status page
  • Consider using one primary domain and redirecting others to it for SEO purposes

Useful Commands

Here are commonly used commands for maintaining and managing your LIVCK installation:

Clear All Caches

Clear all application caches (config, route, view, etc.):

docker compose exec app php artisan optimize:clear

When to use:

  • After updating configuration files
  • When experiencing unexpected behavior
  • After major updates or changes
  • To troubleshoot caching issues

Clear Job Queue

Clear the job queue (removes all pending jobs):

docker compose exec app php artisan queue:clear

When to use:

  • When jobs are stuck or failing repeatedly
  • To clear failed jobs from the queue
  • Before deploying major updates
  • When troubleshooting queue-related issues

Warning: This will delete all pending jobs. Make sure this is what you want before running this command.

Restart Application

Restart the entire LIVCK application (Laravel, PHP, scheduler, queue workers):

docker compose restart app

When to use:

  • When queue workers aren't processing jobs
  • After major configuration changes
  • When the application seems unresponsive
  • To apply certain changes that require a restart

View Application Logs

Check application logs for errors or debugging:

docker compose logs app

Or follow logs in real-time:

docker compose logs -f app

Check Container Status

See which containers are running:

docker compose ps