thelinuxlist/scripts/pmainstall.sh

44 lines
1.4 KiB
Bash
Raw Normal View History

2022-10-18 23:44:22 -07:00
#!/bin/bash
while [ "$go" != 'y' ] && [ "$go" != 'n' ]; do
2022-10-19 09:34:30 -07:00
read -p "Would you like to install phpMyAdmin? (y/n) " go
2022-10-18 23:44:22 -07:00
done
if [ "$go" == 'n' ]; then
exit
fi
2022-10-19 10:24:20 -07:00
sudo apt update && apt upgrade -y
2022-10-19 10:38:00 -07:00
sudo add-apt-repository ppa:ondrej/php && apt install libapache2-mod-php8.1 -y
2022-10-19 10:21:40 -07:00
sudo systemtl stop apache2
2022-10-19 10:37:05 -07:00
sudo apt install apache2 -y
2022-10-19 09:34:30 -07:00
sudo apt install software-properties-common
2022-10-18 23:44:22 -07:00
sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl -y
2022-10-19 09:34:30 -07:00
sudo echo "Include /etc/phpmyadmin/apache.conf" >> /etc/apache2/apache2.conf
2022-10-18 23:44:22 -07:00
sudo phpenmod mbstring
2022-10-19 20:25:48 -07:00
sudo a2dismod php8.1
sudo a2dismod mpm_prefork
sudo a2disconf php7.4-fpm
sudo a2enmod mpm_event
sudo a2enmod proxy
sudo a2enmod proxy_fcgi
sudo a2enconf php8.1-fpm
sudo systemctl restart php8.1-fpm
2022-10-19 10:23:23 -07:00
sudo systemctl enable apache2
2022-10-19 20:25:48 -07:00
sudo systemctl restart apache2
2022-10-18 23:44:22 -07:00
2022-10-19 20:30:04 -07:00
echo -e "=================================================================="
publicipaddress=$(curl -sS --connect-timeout 10 -m 60 https://ipv4.icanhazip.com/ || curl -sS --connect-timeout 10 -m 60 https://api.ipify.org )
intenalip=$(ip addr | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -E -v "^127\.|^255\.|^0\." | head -n 1)
echo "phpMyAdmin Should be available at http://${intenalip}/phpmyadmin"
echo "Or If you are using a VPS at http://${publicipaddress}:3000/phpmyadmin"
echo -e "=================================================================="
2022-10-18 23:44:22 -07:00