API Reference

Complete CLI commands and web dashboard API documentation

🎯 Core Commands

lns help
Show LocNetServe Help with all available commands
lns -v
Show LocNetServe version information
$ lns -v
LocNetServe v1.0.0
lns status
Show status of all services (Apache, MySQL, PHP)
$ lns status
🟢 Apache: Running (port 80)
🟢 MySQL: Running (port 3306)
🟢 PHP: 8.2.8
lns start
Start LocNetServe main server
lns stop
Stop LocNetServe main server
lns all start
Start Apache and MySQL services together
lns all stop
Stop all running services
lns all restart
Restart Apache and MySQL services
lns exit
Exit the terminal
lns lang
Get current language
lns lang <code>
Set language (en, fr, es)
$ lns lang fr
Language set to French

🌐 Apache Management

lns apache start
Start Apache service
lns apache stop
Stop Apache service
lns apache restart
Restart Apache service
lns apache status
Check Apache Status
lns apache log
Open Apache log folder
lns apache conf
Open httpd.conf configuration file
lns apache vhosts
Open VirtualHosts configuration file
lns apache ports
List Apache listening ports
lns apache version
Show Apache version
lns apache config check
Check Apache configuration for errors

🗄️ MySQL Management

lns mysql start
Start MySQL service
lns mysql stop
Stop MySQL service
lns mysql restart
Restart MySQL service
lns mysql status
Check MySQL Status
lns mysql ports
List MySQL listening ports
lns mysql shell
Open MySQL interactive shell
$ lns mysql shell
Welcome to the MySQL monitor...
lns mysql export <db> [output_file.sql]
Export a database to SQL file
lns mysql import <db> <file.sql>
Import SQL file into a database
lns mysql create <db_name>
Create a new database
lns mysql drop <db_name>
Drop an old database
lns mysql data list
List all MySQL databases
lns mysql users
List all MySQL users with host information
lns mysql users info <username>
Show detailed information about a specific user
lns mysql user add <username> <password>
Create a new MySQL user with a password
lns mysql user del <username>
Remove a MySQL user
lns mysql version
Show MySQL version
lns mysql health
Run a health check for MySQL service

⚡ PHP Management

lns php version
Show PHP version
lns php info
Open phpinfo() in browser
lns php ini
Open php.ini configuration file
lns php ext list
List all PHP extensions with status
lns php ext enable <ext>
Enable a PHP extension
lns php ext disable <ext>
Disable a PHP extension
lns php ext available
List available disabled extensions
lns php update
Check PHP update
lns php composer <cmd>
Run composer command (install, update, etc.)

🪄 Laravel Commands

lns laravel serve
Run Laravel local development server
lns laravel migrate
Run Laravel migrations
lns laravel cache
Clear Laravel cache
lns laravel route
List Laravel routes
lns laravel tinker
Open Laravel tinker shell

🔄 Update Commands

lns update locnetserve
Check if new versions are available and update online
lns update apache <zip>
Update Apache from ZIP file
lns update mysql <zip>
Update MySQL from ZIP file
lns update php <zip>
Update PHP from ZIP file
lns update check
Check if new versions are available

🔧 Utilities

lns -u open www
Open www project root folder
lns -u open localhost
Open localhost in browser
lns -u open dashboard
Open local dashboard in browser
lns -u config edit
Open config.json for editing
lns -u show ports
List all active ports
lns -u ssl gen
Generate self-signed SSL certificate for localhost
lns -u backup all
Backup MySQL + WWW + configs
lns -u backup mysql
Backup MySQL databases
lns -u backup config
Backup configuration files
lns -u backup projects
Backup projects in www
lns -u backup list
List available backups
lns -u backup restore <zip>
Restore from a backup

🌐 Virtual Hosts

lns -vh show
List all configured virtual hosts
$ lns -vh show
myproject.local → C:\MyServer\www\myproject
testsite.dev → C:\MyServer\www\testsite
lns -vh open <vhost>
Open specific virtual host in browser
$ lns -vh open myproject.local

🌐 Web Dashboard API

The web dashboard provides a RESTful API for monitoring and controlling services.

GET Service Status
/api/status
Get current status of all services
{ "apache": { "running": true, "port": 80, "version": "2.4.65" }, "mysql": { "running": true, "connections": 5, "version": "8.0.34" }, "php": { "version": "8.2.8" } }
POST Start Service
/api/services/start
Start a specific service
Payload: { "service": "apache" } Response: { "success": true, "message": "Apache started successfully" }
POST Stop Service
/api/services/stop
Stop a specific service
Payload: { "service": "mysql" } Response: { "success": true, "message": "MySQL stopped successfully" }

⚙️ Configuration Reference

Complete structure of the config.json file used by LocNetServe.

📁 File Structure

{ "configPath": "..\\config\\config.json", "icons": { ... }, "myserver": { ... }, "paths": { ... }, "services": { ... }, "settings": { ... } }

🎨 Icons Configuration

"icons": { "apache": { "off": "light.ico", "on": "green.ico" }, "custom": "logo1.png", "mysql": { "off": "light.ico", "on": "green.ico" }, "tray": { "off": "logo2.png", "on": "logo3.png", "stopped": "logo1.png" } }

🚀 Server Information

"myserver": { "status": "running", "version": "v1.0.0" }

📂 Paths Configuration

"paths": { "apache": "{BASE_PATH}\\bin\\apache", "apache_conf": "{BASE_PATH}\\bin\\apache\\conf", "base": "{BASE_PATH}\\", "cmd": "{BASE_PATH}\\config\\cmd\\", "dashboard": "{BASE_PATH}\\apps\\dashboard\\", "icons": "{BASE_PATH}\\icons\\", "locales": "{BASE_PATH}\\config\\locales\\", "mysql": "{BASE_PATH}\\bin\\mysql\\", "php": "{BASE_PATH}\\bin\\php" }

🔧 Services Configuration

"services": { "Apache": { "conf": "{BASE_PATH}\\bin\\apache\\conf\\httpd.conf", "exe": "{BASE_PATH}\\bin\\apache\\bin\\httpd.exe", "hide_window": 1, "log_file": "{BASE_PATH}\\bin\\apache\\logs\\error.log", "process": "httpd.exe", "service": "Apache2.4", "version_cmd": "-v", "version_file": "{BASE_PATH}\\bin\\apache\\bin\\httpd.exe" }, "LocNetServe": { "exe": "{BASE_PATH}\\LocNetServe.exe" }, "MySQL": { "admin": "{BASE_PATH}\\bin\\mysql\\bin\\mysqladmin.exe", "exe": "{BASE_PATH}\\bin\\mysql\\bin\\mysqld.exe", "hide_window": 1, "log_file": "{BASE_PATH}\\bin\\mysql\\data\\mysql_error.log", "password": "", "process": "mysqld.exe", "service": "MySQL94", "user": "root", "version_cmd": "-version", "version_file": "{BASE_PATH}\\bin\\mysql\\bin\\mysqld.exe" }, "PHP": { "exe": "{BASE_PATH}\\bin\\php\\php.exe", "url_info": "http://localhost/info.php", "version_cmd": "-v", "version_file": "{BASE_PATH}\\bin\\php\\php.exe" }, "versions": { "apache": "2.4.65", "locnetserve": "LocNetServe v1.0.0", "mysql": "8.0.34", "php": "8.2.8" } }

⚙️ Settings Configuration

"settings": { "language": "en", "refreshInterval": "3000", "t_lang": "1760953244", "t_pid": "1760296258", "t_serve": "1761084120" }

Environment Variables

LocNetServe uses these environment variables:
LOCNETSERVE_HOME=C:\MyServer
PATH=%LOCNETSERVE_HOME%\bin;%PATH%