Error Log Troubleshooting
Learning Focus
By the end of this lesson you will know how to read error log entries, recognize common patterns, and use logs to diagnose issues.
Log Location and Basic Commands
# View the most recent entries
tail -50 /usr/local/lsws/logs/error.log
# Follow the log in real time
tail -f /usr/local/lsws/logs/error.log
# Search for specific error patterns
grep -i "error\|failed\|denied" /usr/local/lsws/logs/error.log | tail -20
Common Error Patterns
| Log Pattern | Meaning | Likely Cause |
|---|---|---|
Failed to start external app | PHP cannot start | Wrong command path or permissions |
Connection refused | Socket/port issue | PHP not running or wrong socket |
Permission denied | File access blocked | Wrong ownership or permissions |
SSL_CTX_use_certificate_chain_file failed | Certificate error | Wrong cert path or format |
Max connections reached | Worker pool exhausted | Increase max connections or optimize |
Reading a Log Entry
A typical error line includes:
[ERROR] [192.168.1.1] [APVH_example] Failed to connect to socket ...
| Part | Meaning |
|---|---|
[ERROR] | Severity level |
[192.168.1.1] | Client IP (if applicable) |
[APVH_example] | Virtual host or component name |
| Rest of line | Specific error description |
Key Takeaways
- The error log is your primary diagnostic tool — learn to read it quickly.
- Use
tail -ffor real-time monitoring during troubleshooting. - Common patterns often point directly to the fix.
What's Next
- Return to the Logging and Monitoring module for the complete overview.