Bash Web Server Management Tool (BWSMT)

Introduction

The Bash Web Server Management Tool (BWSMT) is a comprehensive script designed to simplify the management of web servers and related services. It provides an intuitive interface for managing Apache, Nginx, PHP-FPM, MySQL, and PostgreSQL, along with additional features like SSL certificate management and basic security checks.

Features

  • Interactive Menu System: Easy-to-navigate menus for all management tasks.
  • Web Server Management: Support for Apache and Nginx.
  • Database Management: MySQL and PostgreSQL support.
  • PHP-FPM Management: Start, stop, restart, and view logs.
  • Virtual Host Management: Create and delete virtual hosts for Apache and Nginx.
  • Database Operations: Create, delete, backup, and restore databases.
  • SSL Certificate Management: Generate self-signed certificates and install Let’s Encrypt certificates.
  • Security Checks: Basic security audits including open port checking and failed login attempts.
  • System Information: Detailed system stats and service status overview.
  • Log Viewing: Quick access to error logs for Apache, Nginx, and PHP-FPM.

Installation

  1. Clone the repository:

    git clone https://github.com/phantompixeldev/BWSMT.git
    
  2. Navigate to the BWSMT directory:

    cd BWSMT
    
  3. Make the script executable:

    chmod +x webserver_manager.sh
    
  4. (Optional) Move the script to a directory in your PATH for system-wide access:

    sudo mv webserver_manager.sh /usr/local/bin/bwsmt
    

Usage

Interactive Menu

To launch the interactive menu, simply run the script without any arguments:

sudo ./webserver_manager.sh

or if you’ve moved it to your PATH:

sudo bwsmt

Navigate through the menus using the number keys to select options.

Command-line Usage

You can also use BWSMT directly from the command line for quick actions:

sudo ./webserver_manager.sh [service] [action]

Examples:

  • Start Apache: sudo ./webserver_manager.sh apache start
  • Create MySQL database: sudo ./webserver_manager.sh mysql createdb
  • View Nginx log: sudo ./webserver_manager.sh nginx viewlog

Special commands:

  • Show MOTD: sudo ./webserver_manager.sh motd
  • Detect services: sudo ./webserver_manager.sh detect
  • Manage SSL: sudo ./webserver_manager.sh ssl
  • Security checks: sudo ./webserver_manager.sh security

Detailed Features

Web Server Management

  • Apache and Nginx: Start, stop, restart, check status
  • Virtual Hosts: Create and delete virtual host configurations
  • Log Viewing: Quick access to error logs

Database Management

  • MySQL and PostgreSQL: Start, stop, restart, check status
  • Database Operations: Create and delete databases
  • Backup and Restore: Easily backup and restore databases

PHP Management

  • PHP-FPM: Start, stop, restart, check status
  • Log Viewing: Access to PHP-FPM error logs

SSL Certificate Management

  • Self-Signed Certificates: Generate self-signed SSL certificates
  • Let’s Encrypt: Automate the process of obtaining and installing Let’s Encrypt certificates

Security Checks

  • Open Ports: Check for open ports on the system
  • Failed Logins: View recent failed login attempts
  • System Updates: Check for available system updates

Contributing

Contributions to BWSMT are welcome! Please feel free to submit pull requests, report bugs, and suggest features through the GitHub issue tracker.

License

This project is licensed under the MIT License - see the LICENSE file for details.


For more information and updates, please visit the BWSMT GitHub repository.