README.md

May 21, 2026 ยท View on GitHub

LAMP

LAMP Stack Installation Scripts

GitHub stars Apache httpd 2.4 MariaDB PHP License

A powerful bash script for automated installation of Apache + MariaDB + PHP


๐Ÿ“– Table of Contents


๐Ÿ“ Description

LAMP (Linux + Apache + MariaDB + PHP) is a powerful bash script for the installation of Apache + MariaDB + PHP and so on.

You can install Apache + MariaDB + PHP in a smaller memory VPS by package manager command (dnf for Enterprise Linux, apt-get for Debian/Ubuntu). Just need to input numbers to choose what you want to install before installation.

โšก All things will be done in a few minutes.


๐Ÿ–ฅ๏ธ Supported System

DistributionVersions
Enterprise Linux8 / 9 / 10 (CentOS Stream, RHEL, Rocky Linux, AlmaLinux, Oracle Linux)
Debian11 / 12 / 13
Ubuntu22.04 / 24.04

โš™๏ธ System Requirements

RequirementMinimum
Disk Space5 GiB
RAM512 MiB
NetworkInternet connection required
RepositoryCorrect system repository
Userroot

๐Ÿ› ๏ธ Supported Software

SoftwareVersionsPackage Source (RPM)Package Source (DEB)
Apache2.4Teddysun RepositoryOfficial Repository
MariaDB10.11, 11.4, 11.8MariaDB RepositoryMariaDB Repository
PHP7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5Remi Repositorydeb.sury.org

๐Ÿ—๏ธ Supported Architecture

  • x86_64 (amd64)
  • aarch64 (arm64)

๐Ÿš€ Installation

Enterprise Linux 8 / 9 / 10

# Install dependencies
dnf -y install wget git

# Clone repository
git clone https://github.com/teddysun/lamp.git
cd lamp

# Make scripts executable and run
chmod 755 *.sh
./lamp.sh

Debian 11 ~ 13 / Ubuntu 22.04 ~ 24.04

# Install dependencies
apt-get -y install wget git

# Clone repository
git clone https://github.com/teddysun/lamp.git
cd lamp

# Make scripts executable and run
chmod 755 *.sh
./lamp.sh

โฌ†๏ธ Upgrade

Enterprise Linux 8 / 9 / 10

# Upgrade Apache
dnf update -y httpd

# Upgrade MariaDB
dnf update -y MariaDB-*

# Upgrade PHP
dnf update -y php-*

Upgrade PHP Major Version (e.g., 8.3 โ†’ 8.4)

dnf module switch-to php:remi-8.4

Debian 11 ~ 13 / Ubuntu 22.04 ~ 24.04

# Upgrade Apache
apt-get install --only-upgrade -y apache2

# Upgrade MariaDB
apt-get install --only-upgrade -y mariadb-*

# Upgrade PHP (replace 8.4 with your version)
php_ver="8.4"
apt-get install --only-upgrade -y php${php_ver}-*

๐Ÿ—‘๏ธ Uninstall

Enterprise Linux 8 / 9 / 10

# Remove Apache
dnf remove -y httpd

# Remove MariaDB
dnf remove -y MariaDB-*

# Remove PHP
dnf remove -y php-*

Debian 11 ~ 13 / Ubuntu 22.04 ~ 24.04

# Remove Apache
apt-get remove -y apache2

# Remove MariaDB
apt-get remove -y mariadb-*

# Remove PHP (replace 8.4 with your version)
php_ver="8.4"
apt-get remove -y php${php_ver}-*

๐Ÿ“ Default Location

Apache

LocationEnterprise LinuxDebian/Ubuntu
Web root/data/www/default/data/www/default
Main configuration/etc/httpd/conf/httpd.conf/etc/apache2/apache2.conf
Sites configuration/etc/httpd/conf.d/vhost/etc/apache2/sites-enabled

MariaDB

LocationEnterprise LinuxDebian/Ubuntu
Data location/var/lib/mysql/var/lib/mysql
Configuration/etc/my.cnf/etc/mysql/my.cnf

PHP

LocationEnterprise LinuxDebian/Ubuntu
php-fpm configuration/etc/php-fpm.d/www.conf/etc/php/${php_ver}/fpm/pool.d/www.conf
php.ini/etc/php.ini/etc/php/${php_ver}/fpm/php.ini

Note: For Debian/Ubuntu, replace ${php_ver} with your PHP version (e.g., 8.4).


โšก Process Management

Enterprise Linux 8 / 9 / 10

ProcessCommand
Apachesystemctl [start|stop|status|restart] httpd
MariaDBsystemctl [start|stop|status|restart] mariadb
PHP-FPMsystemctl [start|stop|status|restart] php-fpm

Debian 11 ~ 13 / Ubuntu 22.04 ~ 24.04

ProcessCommand
Apachesystemctl [start|stop|status|restart] apache2
MariaDBsystemctl [start|stop|status|restart] mariadb
PHP-FPMsystemctl [start|stop|status|restart] php${php_ver}-fpm

Note: For Debian/Ubuntu PHP-FPM, replace ${php_ver} with your PHP version (e.g., php8.4-fpm).


๐Ÿ’ป lamp Command

CommandDescription
lamp startStart all LAMP services
lamp stopStop all LAMP services
lamp restartRestart all LAMP services
lamp statusCheck all LAMP services status
lamp versionPrint all LAMP software versions
lamp vhost addCreate a new Apache virtual host
lamp vhost listList all Apache virtual hosts
lamp vhost delDelete an Apache virtual host
lamp db addCreate a MariaDB database and user
lamp db listList all MariaDB databases
lamp db delDelete a MariaDB database and user
lamp db editUpdate a MariaDB user's password

๐Ÿ› Bugs & Issues

Please feel free to report any bugs or issues:


๐Ÿ“„ License

Copyright ยฉ 2013 - 2026 Teddysun

Licensed under the GPLv3 License.