No description
Find a file
2024-12-01 15:25:21 +05:30
README.md Add README.md 2024-12-01 13:10:36 +05:30
setup_server_laravel.sh Update setup_server_laravel.sh 2024-12-01 15:25:21 +05:30

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.

  1. 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
  1. System Health Checks:
  • Disk space verification
  • Memory availability check
  • System load monitoring
  • Pre-installation requirements verification
  1. Backup Functionality:
  • Automated backup of nginx configs
  • PHP configuration backup
  • MySQL database dumps
  • Timestamped backup directories
  1. Redis Support:
  • Added Redis server installation
  • Configured Redis with optimized settings
  • Memory limits and eviction policies
  • Integration with PHP-FPM
  1. Monitoring Setup with Prometheus:
  • Prometheus server installation
  • Node Exporter for system metrics
  • Automated service configuration
  • Default monitoring endpoints
  1. Security Hardening:
  • SSH configuration hardening
  • Firewall rules with UFW
  • Fail2ban installation
  • Secure shared memory configuration
  1. 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:

  1. Save it as setup_server_laravel.sh
  2. Make it executable: chmod +x setup_server_laravel.sh
  3. Run it with a domain: ./setup_server_laravel -d yourdomain.com

The script will:

  1. Perform system checks
  2. Create initial backups
  3. Install and configure all services
  4. Apply security hardening
  5. Set up monitoring
  6. Optimize performance
  7. Create final backups

All actions are logged to /var/log/server_setup.log for troubleshooting.