28. Deploying the Web Panels (Shared Hosting vs VPS)
All three panels are Laravel applications and can run on shared hosting (cPanel) or on a VPS/dedicated server. Choose the approach that matches your hosting.
28.1. Shared hosting (cPanel)
Best for getting started quickly when you do not have SSH/root access.
- Create a MySQL database and user (see Admin Panel Setup).
- Upload each panel’s ZIP to its domain/subdomain folder and extract it. Point the document root at the panel’s
public/directory (or use the supplied.htaccess). - Shared hosting usually has no Composer, so run
composer installon your own machine first and upload the project with itsvendor/folder already installed. - Configure
.env(database + Firebase credentials) and placecredentials.jsoninstorage/app/firebase/. - Set writable permissions (typically
755) onstorage/andbootstrap/cache/. - Import that panel’s supplied
.sqlfile into its database through phpMyAdmin → Import in cPanel. No Artisan or shell access is needed for this step. - Add the Laravel scheduler as a cron entry under Cron Jobs — see Cron & Scheduled Tasks.
Note: make sure your host runs PHP 8.2+ with the required extensions and that mod_rewrite is enabled. The Admin Panel’s scheduled jobs need Node.js, which basic shared plans often lack — choose a plan that offers it, or use a VPS.
28.2. VPS / dedicated server
Recommended for production — you get SSH access, Composer, Node.js and full control.
- Install the stack: PHP 8.2+, Composer, MySQL/MariaDB, Node.js and a web server
(Nginx or Apache). - Upload or clone each project, then run
composer install(andnpm installfor the Admin Panel). - Copy
.env.exampleto.env, set the database and Firebase credentials, then runphp artisan key:generate. - Import that panel’s supplied
.sqlfile:mysql -u user -p database < panel.sql. - Point each server block’s document root at that project’s
public/directory. - Set ownership/permissions so the web server can write to
storage/andbootstrap/cache/. - Add the scheduler to the system crontab (
* * * * * php /path/artisan schedule:run) — see Cron & Scheduled Tasks. - For production, run
php artisan config:cacheandphp artisan route:cache, and serve everything over HTTPS.
28.3. Common deployment pitfalls (.htaccess & shared hosting)
- Only the home page works; every other route returns 404.
mod_rewriteis disabled orAllowOverrideis notAll, so Laravel’spublic/.htaccessis ignored. - App installed in a sub-folder. Add a
RewriteBasetopublic/.htaccess, e.g.RewriteBase /foodie/. - Document root points at the project root instead of
public/. Point the domain atpublic/, or add a root.htaccessthat rewrites into it. Never serve the project root — it makes.envandstorage/app/firebase/credentials.jsonreachable from the internet. - 404 on uploaded images / assets. Run
php artisan storage:link(or create thepublic/storagelink manually if symlinks are blocked). - 500 error after upload. Usually permissions — set
755onstorage/andbootstrap/cache/, and confirm PHP is 8.2+. - “No input file specified”. A PHP handler / CGI mismatch on some cPanel hosts — add the host’s recommended handler line (or
Options -MultiViews) to.htaccess. - Mixed-content warnings over HTTPS. Set
APP_URLto yourhttps://domain and force HTTPS in.htaccess.
28.4. SSL / HTTPS configuration (production)
Always serve all three panels over HTTPS. Firebase Authentication, payment-gateway callbacks and secure cookies all require it, and browsers block mixed content on pages that are not fully secure.
Shared hosting (cPanel). Most hosts issue a free certificate automatically. Open cPanel → Security → SSL/TLS Status (or Let’s Encrypt / AutoSSL), select your domains, and click Run AutoSSL.
VPS / dedicated server. Install a free Let’s Encrypt certificate with Certbot:
# Nginx sudo apt install certbot python3-certbot-nginx sudo certbot --nginx -d yourdomain.com -d admin.yourdomain.com -d restaurant.yourdomain.com # Apache sudo apt install certbot python3-certbot-apache sudo certbot --apache -d yourdomain.com
Certbot installs the certificate and adds an automatic renewal timer.
Force HTTPS. Add this at the top of each panel’s public/.htaccess, just inside <IfModule mod_rewrite.c> and before Laravel’s front-controller rules:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]Then finish up:
- Set
APP_URL=https://…in every panel’s.env. - In Firebase console → Authentication → Settings → Authorized domains, add all three HTTPS domains so sign-in works.
- Update the OAuth 2.0 client’s authorised origins and redirect URIs to the HTTPS versions.
- Re-cache the config:
php artisan config:cache.
