ShuDudu's Home was started in 2011, but the web data is lost, so now begin again, I would like to make some friends, I hope you like ShuDudu's home.
Current position: ShuDudu > Net Web >

How to write the VPS LAMP/LNMP of a key installation command

Saturday on February 8th, 2020Net Web

Linux than Windows servers good thing is, you can write a Linux shell command button, fully automated install it. The basic approach is by semicolons command; or spaced No. &&; shell there are many scenarios require a response, for example, need to input Y, input or Yes, or need to press Enter. Need to enter Y, most of the install command, prior to the install command can add -Y, as apt-get -y install ......, yum -y install .......

Scene need to auto-answer, a lot of echo command can be used without the need to expect also automatically agree, for example, yesterday I debug Ubuntu 16 + PPA + PHP 7.3, when there have been a need to press Enter in response scene, with echo "\ r" | shell command will automatically press enter, for example, write:

echo "\ r" | LC_ALL = en_US.UTF-8 add-apt-repository ppa: ondrej/php

There are several peers in the industry written in Python VPS panel, provide LAMP, LNMP installation.

If we prefer the command manually install their own LAMP, LNMP environment with a shell, the shell commands can all be written as a key command.

However, the preparation of a key command in a shell environment to spend at least 1 to 3 days. If no command to write such a key, a manually mounted, system optimization, each manual installation LAMP, LNMP environment, at least 30 minutes or more.

For example, I have two or three years ago and has written over a LAMP key commands for their own use. But then after a long time, has been sometimes difficult to read at the time of the program, the idea has been forgotten, so last year they removed completely reconstructed, there were only compatible with Ubuntu 12, Ubuntu 14, CentOS 5, that LAMP a very easy to use key commands . I'm from last year to now, a key to use this command to reinstall the system approximately 100 times.

Last year, the LAMP write a key command, which contains shell commands, as well as PHP and call each other, but now they are less read it to understand, ideas and forgotten. A few days before the start of removed again, completely reconstructed, and try to write a comment. This time, write LAMP, LNMP a key command, VPS panel is ready to develop in, and that time will LAMP, LNMP a key command provided free of charge to the user.

The beginning of 2019 the new LAMP, LNMP a key command + automatic optimization, will be compatible with CentOS, Ubuntu, Debian system. Since Ubuntu + PHP 7.0 PHP is not performed, the Ubuntu 16 to be automatically mounted PPA + PHP 7.3/or PHP 7.4.

18 is derived from the Ubuntu with PHP 7.2, also allows the user to select Ubuntu 18 + PPA + PHP 7.3/PHP 7.4 or a key command.

Yesterday, Ubuntu has completed 16 of Ubuntu + Apache + PPA + PHP 7.3's automatic installation, these days, no fewer than 20 times this purpose reloading system.

Subsequent development, each compatible with a system, developers need to reinstall the system 10-30 times. Compatible with each system development requires time-consuming half a day to 2 days.

For modify Apache, Nginx, PHP configuration file, shell program can also be achieved, but the shell program is very complicated, difficult to read. My solution is to modify all the files from the PHP program, after the changes are complete, these profiles will use the copy command shell command (cp), copied to the Linux system.

This is because PHP does not have permission to directly modify these files, you need to shell commands to copy.

PHP program can also generate .sh file. Write .sh file, to note that there is not \ r carriage return, otherwise it will error, you can chr (13) replaced with a PHP program.

Copyright Protection: ShuDudu from the original article, reproduced Please keep the link: https://www.shududu.com/netweb/How-to-write-the-VPS-LAMP-LNMP-of-a-key-installation-command.htm