Installation

Install NextGenSwitch on Linux

This guide follows the official installation workflow and presents it in a clearer, more operational tone for production environments.


1. Prerequisites

  • Root or sudo access on the target server.
  • Installer assets available in the project: `setup/nextgenswitch.zip`, `setup/supervisord/nextgenswitch.ini`, `setup/httpd/nextgenswitch.conf`, `setup/iptables-rules`.
  • System commands in PATH: `sox`, `lame`, `supervisorctl`, and Apache (`apache2`/`httpd`).
  • PHP extensions: `bcmath`, `ctype`, `fileinfo`, `json`, `mbstring`, `openssl`, `pdo`, `tokenizer`, `xml`.

The installer is safe to rerun after fixing prerequisites because key setup steps are idempotent.

2. Run the Installer

# Interactive
php artisan easypbx:install

# MySQL (non-interactive)
php artisan easypbx:install \
  --db-driver=mysql \
  --db-url="mysql://user:pass@localhost:3306/easypbx"

# SQLite (non-interactive)
php artisan easypbx:install \
  --db-driver=sqlite \
  --sqlite-path="/var/lib/nextgenswitch/database.sqlite"

For MySQL, provide a full `DATABASE_URL`. For SQLite, use an absolute writable path.

3. What the Installer Configures

Step Action
Runtime deploymentExtracts runtime bundle under `/usr/infosoftbd/nextgenswitch` when missing.
User and permissionsCreates `nextgenswitch` user/group and applies ownership/executable permissions.
Supervisor configCopies and normalizes `nextgenswitch.ini` for your distro paths.
Apache configCopies `nextgenswitch.conf` and rewrites project paths.
Environment and cacheWrites DB settings and sets cache driver (Redis/file based on health checks).
MigrationsRuns `php artisan migrate --force`.
Filesystem and symlinksAdjusts storage/public permissions and creates required symlinks.
Process reloadRuns `supervisorctl reread && supervisorctl update`.

4. Post-Install Checklist

  • Check workers with `supervisorctl status`.
  • Enable/reload site config in Apache (`a2ensite` + reload on Debian/Ubuntu).
  • Verify migrations and table creation.
  • Confirm Lua API config points to the correct server API URL.
  • Validate writable paths for `storage` and runtime records.

5. Troubleshooting

  • Re-run the installer after fixing missing dependencies.
  • Review runtime logs at `/usr/infosoftbd/nextgenswitch/logs`.
  • Review web server logs in `/var/log/apache2/` or `/var/log/httpd/`.
  • If Redis is unavailable, ensure `CACHE_DRIVER=file` until Redis is healthy.

6. Unattended / CI Example

DB_URL="mysql://user:password@db.internal:3306/easypbx"
php artisan easypbx:install --db-driver=mysql --db-url="$DB_URL"