mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-04-19 14:18:06 +00:00
Alpine-MariaDB: Fix Install Service startup (#3701)
This commit is contained in:
parent
89ae467364
commit
97674cfae7
@ -15,41 +15,40 @@ update_os
|
|||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apk add \
|
$STD apk add \
|
||||||
gpg \
|
gpg \
|
||||||
sudo
|
sudo
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Installing MariaDB"
|
msg_info "Installing MariaDB"
|
||||||
$STD apk add --no-cache mariadb mariadb-client
|
$STD apk add --no-cache mariadb mariadb-client
|
||||||
$STD rc-update add mariadb default
|
$STD rc-update add mariadb default
|
||||||
$STD rc-service mariadb start
|
|
||||||
msg_ok "Installed MariaDB"
|
msg_ok "Installed MariaDB"
|
||||||
|
|
||||||
msg_info "Configuring MariaDB"
|
msg_info "Configuring MariaDB"
|
||||||
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql >/dev/null 2>&1
|
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql >/dev/null 2>&1
|
||||||
$STD rc-service mariadb restart
|
$STD rc-service mariadb start
|
||||||
msg_ok "MariaDB Configured"
|
msg_ok "MariaDB Configured"
|
||||||
|
|
||||||
read -r -p "Would you like to install Adminer with lighthttpd? <y/N>: " prompt
|
read -r -p "Would you like to install Adminer with lighthttpd? <y/N>: " prompt
|
||||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||||
msg_info "Installing Adminer"
|
msg_info "Installing Adminer"
|
||||||
$STD apk add --no-cache lighttpd php php-cgi php-mysqli php-mbstring php-zip php-gd php-json php-curl jq
|
$STD apk add --no-cache lighttpd php php-cgi php-mysqli php-mbstring php-zip php-gd php-json php-curl jq
|
||||||
sed -i 's|server.modules += ( "mod_cgi" )|server.modules += ( "mod_cgi", "mod_fastcgi" )|' /etc/lighttpd/lighttpd.conf
|
sed -i 's|server.modules += ( "mod_cgi" )|server.modules += ( "mod_cgi", "mod_fastcgi" )|' /etc/lighttpd/lighttpd.conf
|
||||||
echo 'fastcgi.server += ( ".php" => (( "bin-path" => "/usr/bin/php-cgi", "socket" => "/var/run/php-cgi.sock" )))' >>/etc/lighttpd/lighttpd.conf
|
echo 'fastcgi.server += ( ".php" => (( "bin-path" => "/usr/bin/php-cgi", "socket" => "/var/run/php-cgi.sock" )))' >>/etc/lighttpd/lighttpd.conf
|
||||||
ADMINER_VERSION=$(curl -s https://api.github.com/repos/vrana/adminer/releases/latest | jq -r '.tag_name' | sed 's/v//')
|
ADMINER_VERSION=$(curl -fsSL https://api.github.com/repos/vrana/adminer/releases/latest | jq -r '.tag_name' | sed 's/v//')
|
||||||
wget -q -O /var/www/adminer.php "https://github.com/vrana/adminer/releases/download/v${ADMINER_VERSION}/adminer-${ADMINER_VERSION}.php"
|
curl -fsSL "https://github.com/vrana/adminer/releases/download/v${ADMINER_VERSION}/adminer-${ADMINER_VERSION}.php" -o /var/www/adminer.php
|
||||||
chown lighttpd:lighttpd /var/www/adminer.php
|
chown lighttpd:lighttpd /var/www/adminer.php
|
||||||
chmod 755 /var/www/adminer.php
|
chmod 755 /var/www/adminer.php
|
||||||
msg_ok "Adminer Installed"
|
msg_ok "Adminer Installed"
|
||||||
|
|
||||||
msg_info "Starting Lighttpd"
|
msg_info "Starting Lighttpd"
|
||||||
$STD rc-update add lighttpd default
|
$STD rc-update add lighttpd default
|
||||||
$STD rc-service lighttpd restart
|
$STD rc-service lighttpd restart
|
||||||
msg_ok "Lighttpd Started"
|
msg_ok "Lighttpd Started"
|
||||||
|
|
||||||
echo -e "Adminer is available at: ${BL}http://$(hostname -I | awk '{print $1}')/adminer${CL}"
|
echo -e "Adminer is available at: ${BL}http://$(hostname -I | awk '{print $1}')/adminer${CL}"
|
||||||
else
|
else
|
||||||
echo -e "Skipped Adminer Installation..."
|
echo -e "Skipped Adminer Installation..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user