mir fällt kein Commit-Titel ein :/

This commit is contained in:
2021-04-07 15:58:15 +02:00
parent f7fc99932d
commit 7c4031554b
7 changed files with 8043 additions and 58 deletions

View File

@@ -25,9 +25,9 @@ Ram: 2GB <br><br>
## System - Info
![](https://img.shields.io/badge/Debian%2010%20-%20error%20-%20red) ![](https://img.shields.io/badge/Debian%209%20-%20error%20-%20red) ![](https://img.shields.io/badge/Ubuntu%2018.04%20-error-%20red) <br> <br>
![](https://img.shields.io/badge/Debian%2010%20-%20error%20-%20red) ![](https://img.shields.io/badge/Debian%209%20-%20error%20-%20red) ![](https://img.shields.io/badge/Ubuntu%2018.04%20-error-%20red)<br>
is not finished<br>
<code>bash <(wget -O - 'https://git.io/JYBM8')</code>
<code>bash <(wget -O - 'https://git.io/xxxx')</code>
-----
@@ -41,7 +41,7 @@ is not finished<br>
-----
## Repo Autosetrepo
## Official Repo
![](https://img.shields.io/badge/Debian%2011-testing!-black) ![](https://img.shields.io/badge/Debian%2010-work!-green) ![](https://img.shields.io/badge/Debian%209-work!-green) ![](https://img.shields.io/badge/Ubuntu--20.04-work!-green)![](https://img.shields.io/badge/Ubuntu--18.04-work!-green) ![](https://img.shields.io/badge/Ubuntu--16.04-work!-green)<br>
<code>bash <(wget -O - 'https://git.io/JYBMr')</code>
@@ -68,4 +68,12 @@ Version: 3.9.2
## Speedtest
![](https://img.shields.io/badge/Debian%2010-work!-green) ![](https://img.shields.io/badge/Debian%209-work!-green) ![](https://img.shields.io/badge/Ubuntu%2020.04-work!-green) ![](https://img.shields.io/badge/Ubuntu%2018.04-work!-green)<br>
<code>bash <(wget -O - 'https://git.io/JYBM7')</code>
<code>bash <(wget -O - 'https://git.io/JYBM7')</code>
-----
## (L)inux(A)pache(M)ysql(P)HP
![](https://img.shields.io/badge/Debian%2010%20-%20error%20-%20red) ![](https://img.shields.io/badge/Debian%209%20-%20error%20-%20red) ![](https://img.shields.io/badge/Ubuntu%2018.04%20-error-%20red)<br>
<code>bash <(wget -O - 'https://git.io/xxxxxx')</code>

View File

@@ -1,13 +1,15 @@
#!/bin/bash
# Make sure only root can run our script
VERSION="Version: 0.6v"
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
clear
echo "$VERSION"
echo "################################################"
echo "# Version: 0.1v #"
echo "# #"
echo "# #"
echo "# (L)inux #"
echo "# (A)pache #"
@@ -20,11 +22,17 @@ echo "# #"
echo "# #"
echo "################################################"
echo ""
echo "It will now install the following packages: dialog, expect"
echo "It will now install the following packages: dialog, expect, sharutils"
sleep 2
sudo apt update && apt install dialog expect -y
sudo apt update && apt install dialog expect sharutils -y
GEN_PASS=$(
for ((n=0;n<1;n++))
do dd if=/dev/urandom count=1 2> /dev/null | uuencode -m - | sed -ne 2p | cut -c-32
done)
MYSQL_ROOT_PASSWORD="5kze2%!Np@U#rbi@ubvn"
MYSQL_MYSQLADMIN_PASSWORD="rU@DPsd3NyDJ*8x#m4z$MXuoYAL#svjv"
PHPMYADMIN_PASSPHRASE="3$HyzXf#NX!R*WdiYXvvR3fKmgMQHW^CgsjV4KWK^7&fNUaMZZx3FGF2t!V&*bVFs!9$4JSZC7D%vtfnMHZyKKcAGR8gESTQVx^xs2TwodhBJQF9srt^SYatvJE*jkXx"
SECURE_MYSQL=$(expect -c "
set timeout 10
spawn mysql_secure_installation
@@ -39,7 +47,7 @@ send \"$MYSQL_ROOT_PASSWORD\r"
expect \"Remove anonymous users?\"
send \"y\r\"
expect \"Disallow root login remotely?\"
send \"n\r\"
send \"y\r\"
expect \"Remove test database and access to it?\"
send \"y\r\"
expect \"Reload privilege tables now?\"
@@ -51,12 +59,12 @@ serviceIP=$(ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}')
HEIGHT=10
WIDTH=70
CHOICE_HEIGHT=4
BACKTITLE="(L)inux(A)apache(M)ysql(P)HP Installer - Version: 0.1v"
BACKTITLE="(L)inux(A)apache(M)ysql(P)HP Installer - $VERSION"
TITLE="Has LAMP ever been installed on this instance?"
MENU="Choose one of the following options:"
OPTIONS=(1 "Yes"
2 "No"
OPTIONS=(1 "No"
2 "Yes"
3 "Exit")
CHOICE=$(dialog --clear \
@@ -69,7 +77,65 @@ CHOICE=$(dialog --clear \
clear
case $CHOICE in
1) # - Yes
1) # - No
echo "Lets Go!"
echo "start installer" # - start the normal installer
sudo apt update
sudo apt upgrade -y
sudo apt install apache2 apache2-utils mariadb-server mariadb-client -y
echo "$SECURE_MYSQL"
sudo apt install php7.3 libapache2-mod-php7.3 php7.3-mysql php-common php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-readline -y
sudo a2enmod php7.3
sudo systemctl restart apache2
sudo a2dismod php7.3
sudo apt install php7.3-fpm -y
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.3-fpm
sudo systemctl restart apache2
sudo apt install wget -y
sudo apt install php php-cgi php-mysqli php-pear php-mbstring php-gettext libapache2-mod-php php-common php-phpseclib php-mysql -y
wget -P Downloads https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz
wget -P Downloads https://files.phpmyadmin.net/phpmyadmin.keyring
gpg --import ~/Downloads/phpmyadmin.keyring
wget -P Downloads https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz.asc
gpg --verify ~/Downloads/phpMyAdmin-latest-all-languages.tar.gz.asc
mkdir /var/www/html/phpmyadmin
sudo tar xvf ~/Downloads/phpMyAdmin-latest-all-languages.tar.gz --strip-components=1 -C /var/www/html/phpmyadmin
sudo chown -R 33:33 /var/www/html/phpmyadmin
echo "
<?php
declare(strict_types=1);
$cfg['blowfish_secret'] = '$GEN_PASS'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
$i = 0;
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';" > /var/www/html/phpmyadmin/config.inc.php
sudo chmod 660 /var/www/html/phpmyadmin/config.inc.php
sudo systemctl restart apache2
echo "CREATE USER 'mysqladmin'@'localhost' IDENTIFIED BY '$MYSQL_MYSQLADMIN_PASSWORD'; GRANT ALL PRIVILEGES ON *.* TO 'mysqladmin'@'localhost'; FLUSH PRIVILEGES;" | mysql -u root -password="$MYSQL_ROOT_PASSWORD"
echo "GRANT ALL PRIVILEGES ON *.* TO 'mysqladmin'@'localhost';" | mysql -u root -password="$MYSQL_ROOT_PASSWORD"
echo "
Thank you for using this Script
Your Webserver is available on http://$serviceIP/ and http://$serviceIP/phpmyadmin
MySQL-Login (localhost)
user: root
password: $MYSQL_ROOT_PASSWORD (Please change this password! It is static )
phpMyAdmin-Login
user: mysqladmin
password: $MYSQL_MYSQLADMIN_PASSWORD (Please change this password! It is static)
You want to improve my script or have a wish then open an issues on Github :)
>> https://github.com/MrUnknownDE/linux-script/issues/new" > installer-log.txt
cat installer-log.txt
;;
2) # - Yes
echo "Here where go again :)"
sudo apt update
sudo apt upgrade
@@ -117,52 +183,6 @@ clear
user: mysqladmin
password: $MYSQL_MYSQLADMIN_PASSWORD (Please change this password! It is static)
You want to improve my script or have a wish then open an issues on Github :)
>> https://github.com/MrUnknownDE/linux-script/issues/new" > installer-log.txt
echo "Finish, more information on the installer-log.txt in you home dir"
;;
2) # - No
echo "Lets Go!"
echo "start installer" # - start the normal installer
sudo apt update
sudo apt upgrade -y
sudo apt install apache2 apache2-utils mariadb-server mariadb-client -y
echo "$SECURE_MYSQL"
sudo apt install php7.3 libapache2-mod-php7.3 php7.3-mysql php-common php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-readline -y
sudo a2enmod php7.3
sudo systemctl restart apache2
sudo a2dismod php7.3
sudo apt install php7.3-fpm -y
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.3-fpm
sudo systemctl restart apache2
sudo apt install wget -y
sudo apt install php php-cgi php-mysqli php-pear php-mbstring php-gettext libapache2-mod-php php-common php-phpseclib php-mysql -y
wget -P Downloads https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz
wget -P Downloads https://files.phpmyadmin.net/phpmyadmin.keyring
gpg --import ~/Downloads/phpmyadmin.keyring
wget -P Downloads https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz.asc
gpg --verify ~/Downloads/phpMyAdmin-latest-all-languages.tar.gz.asc
mkdir /var/www/html/phpmyadmin
sudo tar xvf ~/Downloads/phpMyAdmin-latest-all-languages.tar.gz --strip-components=1 -C /var/www/html/phpmyadmin
sudo cp /var/www/html/phpmyadmin/config.sample.inc.php /var/www/html/phpmyadmin/config.inc.php
sudo chmod 660 /var/www/html/phpmyadmin/config.inc.php
sudo chown -R 33:33 /var/www/html/phpmyadmin
sudo systemctl restart apache2
echo "CREATE USER 'mysqladmin'@'localhost' IDENTIFIED BY '$MYSQL_MYSQLADMIN_PASSWORD'; GRANT ALL PRIVILEGES ON *.* TO 'mysqladmin'@'localhost'; FLUSH PRIVILEGES;" | mysql -u root -password="$MYSQL_ROOT_PASSWORD"
echo "GRANT ALL PRIVILEGES ON *.* TO 'mysqladmin'@'localhost';" | mysql -u root -password="$MYSQL_ROOT_PASSWORD"
echo "
Thank you for using this Script
Your Webserver is available on http://$serviceIP/ and http://$serviceIP/phpmyadmin
MySQL-Login (localhost)
user: root
password: $MYSQL_ROOT_PASSWORD (Please change this password! It is static )
phpMyAdmin-Login
user: mysqladmin
password: $MYSQL_MYSQLADMIN_PASSWORD (Please change this password! It is static)
You want to improve my script or have a wish then open an issues on Github :)
>> https://github.com/MrUnknownDE/linux-script/issues/new" > installer-log.txt
echo "Finish, more information on the installer-log.txt in you home dir"

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env sh
echo 'Generating 32-character passwords'
for ((n=0;n<100;n++))
do dd if=/dev/urandom count=1 2> /dev/null | uuencode -m - | sed -ne 2p | cut -c-128
done

12
sh_scripts/res/lamp.html Normal file
View File

@@ -0,0 +1,12 @@
<html>
<header>
<title>Successful installation</title>
</header>
<body>
<h1>Successful installation</h1>
<h2>Thank you for Using this Script!</h2>
<br />
<h3>Support us with your ideas</h3>
<h4><a href="https://github.com/MrUnknownDE/linux-script">https://github.com/MrUnknownDE/linux-script</a></h4>
</body>
</html>

10
sh_scripts/res/lamp.php Normal file
View File

@@ -0,0 +1,10 @@
<?php
// Zeigt alle Informationen (Standardwert ist INFO_ALL)
phpinfo();
// Zeigt nur die Modul-Informationen.
// phpinfo(8) führt zum gleichen Ergebnis.
phpinfo(INFO_MODULES);
?>

File diff suppressed because it is too large Load Diff