Explore the fun of station building and operation and maintenance

LAMP Web one click installation script – Linux server installation Apache/MySQL/PHP website environment

Earlier, Chiang shared on the website LNMP one button installation package Deploy PHP+MySQL+Nginx website running environment in Linux server, and I mentioned in the article that the script also supports LAMP installation. The script that Laojiang will introduce today can only be installed LAMP one button installation The script is lighter than the above script and does not come with too much built-in software.

LAMP one click installation package is a shell script written in Linux shell that can install Linux+Apache+MySQL/MariaDB+PHP production environment for Amazon Linux/CentOS/Debian/Ubuntu VPS or servers. It includes some optional installation components, such as Zend OPcache, ionCube Loader, PDFlib, XCache, APCu, imagick, gmagick, libsodium, memcached, redis, mongodb, swoole, yaf, yar, msgpack, psr, phalcon, grpc, xdebug。 Others such as OpenSSL, ImageMagick, GraphicsMagick, Memcached, phpMyAdmin, Adminer, Redis, re2c, KodExplorer。 At the same time, there are also some auxiliary scripts, such as virtual host management, Apache, MySQL/MariaDB, PHP, and upgrading of PhpMyAdmin and Administrator.

First, LAMP one click script installation tutorial

LAMP supports most Linux image scripts. The server should be configured with 512MB memory or more, and the memory should be more than 10GB. Mr. Jiang personally suggested that the pure version of the image should be used. This is not easy to make mistakes. Of course, we can check what the problem is if there is an error in the running process. When we install the image, we try to install newer versions, such as CentOS8+and Ubuntu 20+.

1. Script installation

 Yum - y install wget git//CentOS image installation Apt get - y install wget git//Debian/Ubuntu image installation git clone  https://github.com/teddysun/lamp.git cd lamp chmod 755 *.sh ./lamp.sh

Here in the first and second lines of the script, we need to choose the basic software to install according to the actual image. Some servers do not have wget or git installed by default. No matter whether we have installed them or not, we will install them again.

2. Installation process

 LAMP one click installation script - Linux deployment Apache/MySQL/PHP website running environment

The installation process is also a process of selecting option configurations. For example, we need to select PHP, MySQL and other software versions.

 Parameters: --apache_option [1-2],  please select a available Apache version 1. httpd-2.4.43 2. do_not_install --db_option [1-9],  please select a available Database version 1. mysql-5.6.49 2. mysql-5.7.31 3. mysql-8.0.21 4. mariadb-10.1.45 5. mariadb-10.2.32 6. mariadb-10.3.23 7. mariadb-10.4.13 8. mariadb-10.5.4 9. do_not_install --php_option [1-8],  please select a available PHP version 1. php-5.6.40 2. php-7.0.33 3. php-7.1.33 4. php-7.2.34 5. php-7.3.25 6. php-7.4.13 7. php-8.0.0 8. do_not_install --kodexplorer_option [1-2],  please select a available KodExplorer version 1. kodexplorer-4.35 2. do_not_install

We can choose according to our needs. It should be noted that we need to set the default password of MYSQL by ourselves, and do not use the default password. After the installation is completed, we can add the site with the gadget included in the lamp one click package.

Second, the LAMP one button package comes with a gadget

After installing the LAMP one click package tool, we can use the built-in gadget to create a site.

1. Common gadgets

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

The site directory we added is in the "/data/www/default" default directory. In fact, the domain name of the corresponding site is in www.

2. Upgrade gadget

 ./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

3. Program installation 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

4. Other Command Widgets

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)

In this way, can we learn another open source and free LAMP one click package installation script tool. We have another choice when deploying the Linux server WEB environment.

Like( zero )
Reprint reservation: Old Tribe » LAMP Web one click installation script – Linux server installation Apache/MySQL/PHP website environment


Follow the public account "Chiang Kai shek's circle of friends"

Get more new knowledge about station building, operation and maintenance!
Internet entrepreneurship, cutting-edge technology