How to install LAMP automatically on CentOS / Debian / Ubuntu

Already on previous occasions (How to install LAMP on UbuntuInstalling a LAMP environment on Debian and derivativesHow to install LAMP on Ubuntu: the easy way) I have talked about how to install LAMP (Linux + Apache + MySQL / MariaDB / Percona + PHP)Today, in particular, we are going to teach you how to install LAMP from the console, automatically and with minimal user participation.

To achieve our goal we will use a bash script called lamp, By teddysun, which allows us to install different versions of Apache + PHP + MySQL / MariaDB / Percona, the user has the power to choose which version of these software to use (although it comes parameterized with some by default).

What distributions does the script lamp support?

The script has been tested on the following distributions and should work on any derived from them:

  • CentOS-5.x
  • CentOS-6.x
  • CentOS-7.x
  • Ubuntu-12.x
  • Ubuntu-13.x
  • Ubuntu-14.x
  • Ubuntu-15.x
  • Ubuntu-16.x
  • Debian-7.x
  • Debian-8.x

What software versions does the script lamp support?

The script offers the possibility to install the following software and versions:

  • Apache-2.2, Apache-2.4.
  • MySQL-5.5, MySQL-5.6, MySQL-5.7, MariaDB-5.5, MariaDB-10.0, MariaDB-10.1, Percona-Server-5.5, Percona-Server-5.6, Percona-Server-5.7.
  • PHP-5.3, PHP-5.4, PHP-5.5, PHP-5.6, PHP-7.0.
  • PHP Module: OPcache, ZendGuardLoader, ionCube_Loader, XCache, Imagemagick, GraphicsMagick, Memcache, Memcached Redis, Mongo Swoole.
  • Other Software: Memcached, phpMyAdmin, Redis-Server

How to install the lamp script?

To install we must follow the following steps according to your distribution:

Install the lamp script on CentOS and derivatives:

yum -y install wget screen unzip wget --no-check-certificate -O lamp.zip https://github.com/teddysun/lamp/archive/master.zip unzip lamp.zip
cd lamp-master chmod + x *.sh screen -S lamp

Install the lamp script on Debian / Ubuntu and derivatives:

apt-get -y install wget screen unzip wget --no-check-certificate -O lamp.zip https://github.com/teddysun/lamp/archive/master.zip unzip lamp.zip
cd lamp-master chmod + x *.sh screen -S lamp

How to use the lamp script?

To use the lamp script we must execute the installation .sh file with the following command:

./lamp.sh

Then we must select one by one the versions of the software that we want to install, we can select each version indicating the number that identifies it or if we press enter it will install the default version. We can also choose the password from the database.

lamp_apache

lamp_mariadb

lamp_php

lamp_phpmodules

lamp_phpmyadmin

Without a doubt, this is a fast, efficient and fun way to install LAMP. I hope it works for you and do not hesitate to leave your comments.


6 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Christopher said

    Use part of the script to modify my .bash_rc

    #################### System information ####################

    CPU Model: Intel (R) Core (TM) 2 Duo CPU E8400 @ 3.00GHz
    Number of cores: 2
    CPU frequency: 3000.000 MHz
    Amount of RAM: 1983 MB
    SWAP Amount: 1999 MB
    Power on time: 0 days, 6 hours 11 minutes 22 seconds
    Average load: 0.17, 0.25, 0.34
    Architecture: x86_64 (64 Bit)
    Kernel: 4.4.0-43-generic
    Machine name: dc5800

    ################################################## #################
    This is how it looks every time I open a console.

    About the LAMP it is easier to install

    sudo apt install phpmyadmin mysql-server

  2.   HO2gi said

    In case of an emergency, I already know how to do it, thanks good post.

  3.   nameless said

    Isn't it better to use docker?)
    So it can be used even in windows ...

    Also we do not "dirty" the system, we keep the backups of the databases or apps in our system only, the rest runs in separate containers (container bd + container apache)

  4.   Gustavo said

    How can I uninstall all this since I want to do it one by one

    1.    Luigys toro said

      You can run the uninstall script found in the lamp-master ./uninstall.sh folder

  5.   Paul bustamante said

    Good morning I want to configure the ServerName in apache2 but I cannot find the config I am a student and I don't have much skill.

    Thank you very much