split-out ubuntu 23* versions

since 2023 didn't produce and LTS ubuntu versions

the Ondrej repo we use for installing arbitrary PHP versions doesn't
(easily) support non-LTS versions of ubuntu, which means that 23.04 and
23.10 are problematic using the repo

However, these versions ship with  php8.1 and php8.2 (respectively), so
we don't even need the Ondrej repo for these, so we'll remove it

In general, we'll only support LTS Ubuntu repos because of this, but if
they happen to ship with our preferred PHP versions and otherwise work
w/o heroics, we'll include nominal support in the script
This commit is contained in:
Jeremy Price 2023-11-30 11:28:13 -08:00
parent d5881736cf
commit 123d04ff7b

View file

@ -541,7 +541,43 @@ case $distro in
fi
;;
Ubuntu)
if [ "${version//./}" -ge "2204" ]; then
if [ "${version//./}" -ge "2304" ]; then
# Install for Ubuntu 22.04
set_fqdn
set_dbpass
tzone=$(cat /etc/timezone)
echo -n "* Updating installed packages."
log "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y upgrade" & pid=$!
progress
echo "* Installing Apache httpd, PHP, MariaDB and other requirements."
PACKAGES="cron mariadb-server mariadb-client apache2 libapache2-mod-php php8.2 php8.2-mcrypt php8.2-curl php8.2-mysql php8.2-gd php8.2-ldap php8.2-zip php8.2-mbstring php8.2-xml php8.2-bcmath curl git unzip"
install_packages
echo "* Configuring Apache."
create_virtualhost
log "phpenmod mcrypt"
log "phpenmod mbstring"
log "a2enmod rewrite"
log "a2ensite $APP_NAME.conf"
rename_default_vhost
set_hosts
echo "* Starting MariaDB."
log "systemctl start mariadb.service"
install_snipeit
echo "* Restarting Apache httpd."
log "systemctl restart apache2"
echo "* Clearing cache and setting final permissions."
chmod 777 -R $APP_PATH/storage/framework/cache/
log "run_as_app_user php $APP_PATH/artisan cache:clear"
chmod 775 -R $APP_PATH/storage/
elif [ "${version//./}" -eq "2204" ]; then
# Install for Ubuntu 22.04
set_fqdn
set_dbpass