No description
README.md | ||
setup_server_laravel.sh |
Please USE a Blank Ubuntu 24.04 x86_64 VM. Not tested on arm or any other flavours. It should techinically work but not sure.
- Enhanced Error Handling and Logging:
- Added comprehensive logging system with timestamps and log levels
- Implemented trap-based error handling
- Added detailed error messages with line numbers
- Created separate log file for better tracking
- System Health Checks:
- Disk space verification
- Memory availability check
- System load monitoring
- Pre-installation requirements verification
- Backup Functionality:
- Automated backup of nginx configs
- PHP configuration backup
- MySQL database dumps
- Timestamped backup directories
- Redis Support:
- Added Redis server installation
- Configured Redis with optimized settings
- Memory limits and eviction policies
- Integration with PHP-FPM
- Monitoring Setup with Prometheus:
- Prometheus server installation
- Node Exporter for system metrics
- Automated service configuration
- Default monitoring endpoints
- Security Hardening:
- SSH configuration hardening
- Firewall rules with UFW
- Fail2ban installation
- Secure shared memory configuration
- Performance Optimization:
- PHP-FPM tuning
- Nginx optimization
- Kernel parameter optimization
- Redis caching configuration
Additional Improvements:
- Modular function-based design
- Proper command-line argument parsing
- Colored output for better readability
- Detailed success/failure messages
To use the script:
- Save it as
setup_server_laravel.sh
- Make it executable:
chmod +x setup_server_laravel.sh
- Run it with a domain:
./setup_server_laravel -d yourdomain.com
The script will:
- Perform system checks
- Create initial backups
- Install and configure all services
- Apply security hardening
- Set up monitoring
- Optimize performance
- Create final backups
All actions are logged to /var/log/server_setup.log
for troubleshooting.