V
V
Vladislav Raev2020-11-30 15:07:32
linux
Vladislav Raev, 2020-11-30 15:07:32

How to make a bash script that sets up a lamp server?

In college, they let me make a script that installs the lamp server. Which is to install it piece by piece.
Optional installs:
1. APACHE Server
2. PHP 7. *
3. MySQL
4. APACHE + PHP + MYSQL
Instantly, if desired, remove:
1. APACHE Server
2. PHP 7. *
3. MySQL
4. APACHE + PHP + MYSQL instantly.
Nobody could help?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Victor Taran, 2020-11-30
@qu1ton

vestacp (free web morad) in 1 click
brainycp (proprietary but free) in 1 click
ispconfig3 ( there is a free web snout) + there are scripts on the git but my personal bitrix
vm config (free only centos and console snout) excellent performance optimization, ready vm machines for any virtualization, there is also a simple sh script
, etc.
All this is done with a bash script with a web or console face. All you have already done.

V
Valdemar Smorman, 2020-11-30
@smorman

Installing LAMP (P - Mariadb-Server) with a script in Ubuntu 20.04 (for other Linux OSes, change apt installto sudo apt update; sudo apt full-upgradethe corresponding one from your OS)
Through the Terminal , create in the editor (for example, in nano ) for example a file lamp:
nano lamp

spoiler
#!/bin/bash

## Добавление репозитария PHP для установки последней версии 7.4.xxx
cd /etc/apt/sources.list.d; echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu $(lsb_release -cs) main" | sudo tee php.list > /dev/null; sudo apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 4F4EA0AAE5267A6C; cd

## Делаем паузу в 10 сек, чтобы файл php.list в /etc/apt/sources.list.d создался и был итегрирован в систему
sleep 10

## Обновляем сведения о репозитариях и апгрейдим систему
sudo apt update; sudo apt full-upgrade

## Установка L.A.M.P.
sudo apt install apache2 mariadb-server-10.3 php libapache2-mod-php php-mysql php-cgi php-gd php-zip php-xml php-xmlrpc php-curl php-json php-mbstring php-cli
sudo ufw allow in 80/tcp ## открываем порт 80
sudo a2enmod rewrite; sudo sed -i "s/AllowOverride None/AllowOverride All/" /etc/apache2/apache2.conf; sudo systemctl restart apache2

## Выход из установки
exit

Save it:
Ctrl+O -> Enter
Exit nano :
Ctrl+X
Again in the Terminal , make it executable:
nano +x lamp
Run the script to install LAMP :
./lamp

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question