██▓ ▄▄▄ ███▄ ▄███▓ ██▓███ ███▄ ▄███▓ ███▄ █ ▄████ ██▀███
▓██▒ ▒████▄ ▓██▒▀█▀ ██▒▓██░ ██▒▓██▒▀█▀ ██▒ ██ ▀█ █ ██▒ ▀█▒▓██ ▒ ██▒
▒██░ ▒██ ▀█▄ ▓██ ▓██░▓██░ ██▓▒▓██ ▓██░▓██ ▀█ ██▒▒██░▄▄▄░▓██ ░▄█ ▒
▒██░ ░██▄▄▄▄██ ▒██ ▒██ ▒██▄█▓▒ ▒▒██ ▒██ ▓██▒ ▐▌██▒░▓█ ██▓▒██▀▀█▄
░██████▒▓█ ▓██▒▒██▒ ░██▒▒██▒ ░ ░▒██▒ ░██▒▒██░ ▓██░░▒▓███▀▒░██▓ ▒██▒
░ ▒░▓ ░▒▒ ▓▒█░░ ▒░ ░ ░▒▓▒░ ░ ░░ ▒░ ░ ░░ ▒░ ▒ ▒ ░▒ ▒ ░ ▒▓ ░▒▓░
░ ░ ▒ ░ ▒ ▒▒ ░░ ░ ░░▒ ░ ░ ░ ░░ ░░ ░ ▒░ ░ ░ ░▒ ░ ▒░
░ ░ ░ ▒ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░
Bash script to automate the installation and configuration of a LAMP server (Linux, Apache, MySQL, PHP) on Ubuntu. It allows for quickly setting up a complete hosting environment with support for WordPress sites, permission management, basic MySQL security, and SSL certificate generation using Certbot.
Warning:
The script is in Beta phase and may contain errors or bugs. It is recommended to run it in a testing environment before using it in production!
/etc/hosts
file.Download the script to your Ubuntu server:
wget https://raw.githubusercontent.com/enricomarogna/lamp-mngr/refs/heads/main/lamp-mngr.sh
Assign execution and security permissions to the script:
chmod +x lamp-mngr.sh
sudo chown root:root lamp-mngr.sh
sudo chmod 700 lamp-mngr.sh
Run the script:
sudo ./lamp-mngr.sh
The script provides a menu interface with the following options:
# | Option | Description |
---|---|---|
1 | Install LAMP Server | Installs Apache, MySQL, PHP, and Certbot |
2 | Create a Site | Creates an Apache VirtualHost and a MySQL database for a site (with an option for WordPress) |
3 | Uninstall Site | Removes a specific site, including files, database, Apache VirtualHost, and log files |
4 | Set WP Permissions | Configures security permissions for a WordPress site |
5 | Generate SSL Certificate | Installs and configures an SSL certificate for a domain |
6 | List Installed Sites | Displays a list of installed sites |
7 | Exit | Exits the script |
mod_rewrite
and firewall configuration using ufw
.mysql_secure_installation
, and creation of databases and users.php-curl
, php-gd
, php-mbstring
, php-xml
, php-zip
, php-imagick
, php-intl
, and php-fdomdocument
.700
) to maintain security.If you’d like to help improve this script, feel free to create a fork of the project and submit a pull request. Any feedback and suggestions are welcome!
Created by Enrico Marogna
Distributed under the MIT License. See the LICENSE file for more details.
You can support the development of this project with a donation on Ko-fi.