Automatic installation

 LAMP

system requirements

  • System support
Amazon Linux 2
CentOS 7
CentOS Stream 8
CentOS Stream 9
Rocky Linux 8 (recommend)
Rocky Linux 9
AlmaLinux 8 (recommend)
AlmaLinux 9
Debian 9
Debian 10
Debian 11 (recommend)
Ubuntu 18.04
Ubuntu 20.04
Ubuntu 22.04 (recommend)
  • Memory requirements: ≥ 512MB
  • Hard disk requirements: at least 10GB Remaining space above
  • The server must be configured Software source and Internet connection
  • Must have system root permission
  • Strongly recommended use New system To install

Support Components

  • Support PHP Almost all assembly
  • Supports SQLite, MySQL, and MariaDB databases
  • Yaf support (optional installation)
  • Support Redis (optional installation)
  • Support for Swoole (optional installation)
  • Support Memcached (optional installation)
  • Support ImageMagick (optional installation)
  • Support ionCube Loader (optional installation)
  • Self service upgrade Apache, PHP, phpMyAdmin, Administrator, MySQL/MariaDB to the latest version
  • The command line adds a virtual host (using the lamp command), which is easy to operate
  • One click uninstallation is supported (website data will not be deleted)

Installation steps

  1. Prepare in advance (install wget and git)
Note: Do not copy the contents after the double slash//
 yum -y install wget git      // for Amazon Linux/CentOS apt-get -y install wget git  // for Debian/Ubuntu
  1. Git clone and give script execution permission
 git clone  https://github.com/teddysun/lamp.git cd lamp chmod 755 *.sh
  1. Install using automatic mode
 [ root@lamp ]# ~/lamp/lamp.sh -h +-------------------------------------------------------------------+ | Auto Install LAMP(Linux + Apache + MySQL/MariaDB + PHP )          | | Intro :  https://lamp.sh                                            | | Author: Teddysun < [email protected] >                                 | +-------------------------------------------------------------------+ Usage  : ./lamp.sh [Options] [Parameters] Options: -h, --help                       Print this help text and exit -v, --version                    Print program version and exit --apache_option [1-2]            Apache server version --apache_modules [mod name]      Apache modules: mod_wsgi, mod_security, mod_jk --db_option [1-9]               Database version --db_data_path [location]        Database Data Location. for example: /data/db --db_root_pwd [password]         Database root password. for example: lamp.sh --php_option [1-4]              PHP version --php_extensions [ext name]     PHP extensions: apcu, ioncube, pdflib, imagick, xdebug memcached, redis, mongodb, libsodium, swoole yaf, yar, phalcon, grpc --db_manage_modules [mod name]   Database management modules: phpmyadmin, adminer --kodexplorer_option [1-2]      KodExplorer version Parameters: --apache_option [1-2],  please select a available Apache version 1. httpd-2.4.52 2. do_not_install --db_option [1-9],  please select a available Database version 1. mysql-5.7.37 2. mysql-8.0.28 3. mariadb-10.2.43 4. mariadb-10.3.34 5. mariadb-10.4.24 6. mariadb-10.5.15 7. mariadb-10.6.7 8. mariadb-10.7.3 9. do_not_install --php_option [1-4],  please select a available PHP version 1. php-7.4.28 2. php-8.0.16 3. php-8.1.3 4. do_not_install --kodexplorer_option [1-2],  please select a available KodExplorer version 1. kodexplorer-4.47 2. do_not_install

For example, install Apache, Apache module mod_wsgi, mod_security, MySQL - 5.7, and root password teddysun.com PHP 7.4, PHP extension ioncube, imagick,redis,mongodb,libsodium,swoole、 And phpMyAdmin Adminer、KodExplorer

 ./lamp.sh --apache_option 1 --apache_modules mod_wsgi, mod_security --db_option 1 --db_root_pwd teddysun.com --php_option 1 --php_extensions ioncube,imagick,redis,mongodb,libsodium,swoole --db_manage_modules phpmyadmin,adminer --kodexplorer_option 1

When installing in automatic mode, the installation options will be displayed. For example, in the above example, the following results will be returned, and these information will be recorded in the installation log:

 ------------------------- Install Overview -------------------------- Apache: httpd-2.4.52 Apache Location: /usr/local/apache Apache Additional Modules: mod_wsgi-4.9.0 modsecurity-2.9.5 Database: mysql-5.7.37 MySQL Location: /usr/local/mysql MySQL Data Location: /usr/local/mysql/data MySQL Root Password: teddysun.com Database Management Modules: phpMyAdmin-5.1.3-all-languages adminer-4.8.1 PHP: php-7.4.38 PHP Location: /usr/local/php PHP Additional Extensions: ioncube_loaders imagick-3.7.0 redis-5.3.7 mongodb-1.12.0 libsodium-php-2.0.23 swoole-4.8.6 KodExplorer: kodfile-4.37 KodExplorer Location: /data/www/default/kod ---------------------------------------------------------------------

Parameter Description

If you don't want to install or use the default values, just omit the corresponding parameters.
The data location of the database defaults to data catalog;
The default root password of the database is lamp.sh
For example, install Apache MariaDB-10.5、PHP-7.4、phpMyAdmin

 ./lamp.sh --apache_option 1 --db_option 6 --php_option 1 --db_manage_modules phpmyadmin

The above example will return the following results:

 ------------------------- Install Overview -------------------------- Apache: httpd-2.4.52 Apache Location: /usr/local/apache Database: mariadb-10.5.15 MariaDB Location: /usr/local/mariadb MariaDB Data Location: /usr/local/mariadb/data MariaDB Root Password: lamp.sh Database Management Modules: phpMyAdmin-5.1.3-all-languages PHP: php-7.4.38 PHP Location: /usr/local/php KodExplorer: do_not_install ---------------------------------------------------------------------

Tips

 lamp add       Create virtual host lamp del       Delete virtual host lamp list      List Virtual Hosts lamp version   Show current version

How to upgrade

Note: Do not copy the contents after the double slash//
 cd ~/lamp git reset --hard         // Resets the index and working tree git pull                 // Get latest version first chmod 755 *.sh ./upgrade.sh             // Select one to upgrade ./upgrade.sh apache      // Upgrade Apache ./upgrade.sh db          // Upgrade MySQL or MariaDB ./upgrade.sh php         // Upgrade PHP ./upgrade.sh phpmyadmin  // Upgrade phpMyAdmin ./upgrade.sh adminer     // Upgrade Adminer

How to uninstall

 ./uninstall.sh

Program directory

  • MySQL installation directory:/usr/local/mysql
  • MySQL database directory:/usr/local/mysql/data (default path, which can be changed during installation)
  • MariaDB installation directory:/usr/local/mariadb
  • MariaDB database directory:/usr/local/mariadb/data (default path, which can be changed during installation)
  • PHP installation directory:/usr/local/php
  • Apache installation directory:/usr/local/apache

Command list

  • MySQL or MariaDB command
 /etc/init.d/mysqld (start|stop|restart|status)
  • Apache Command
 /etc/init.d/httpd (start|stop|restart|status)
  • Memcached command (optional installation)
 /etc/init.d/memcached (start|stop|restart|status)
  • Redis command (optional installation)
 /etc/init.d/redis-server (start|stop|restart|status)

Site Root

Default site root directory:/data/www/default

Comments closed