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 deployment | Extracts runtime bundle under `/usr/infosoftbd/nextgenswitch` when missing. |
| User and permissions | Creates `nextgenswitch` user/group and applies ownership/executable permissions. |
| Supervisor config | Copies and normalizes `nextgenswitch.ini` for your distro paths. |
| Apache config | Copies `nextgenswitch.conf` and rewrites project paths. |
| Environment and cache | Writes DB settings and sets cache driver (Redis/file based on health checks). |
| Migrations | Runs `php artisan migrate --force`. |
| Filesystem and symlinks | Adjusts storage/public permissions and creates required symlinks. |
| Process reload | Runs `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"