From 2cf9a8aba4e80e6ee7a587b82de5c722e6b72b87 Mon Sep 17 00:00:00 2001 From: Johan Date: Thu, 19 Jan 2023 11:56:54 +0100 Subject: [PATCH] Add ODBC driver to Apache installation bash script --- BashScripts/install-apache.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/BashScripts/install-apache.sh b/BashScripts/install-apache.sh index 6971cb4..b3df779 100644 --- a/BashScripts/install-apache.sh +++ b/BashScripts/install-apache.sh @@ -85,7 +85,26 @@ chmod -R uga+rwx /var/www/ 2>>install.log && # chown -R $REALUSER:$REALUSER /var/www/ # chown -R $REALUSER:$REALUSER /etc/apache2/ -service apache2 restart 2>>install.log && +service apache2 restart 2>>install.log + +# Install the Microsoft ODBC driver for SQL Server (Linux) +# https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15 +if ! [[ "18.04 20.04 22.04" == *"$(lsb_release -rs)"* ]]; +then + echo "Ubuntu $(lsb_release -rs) is not currently supported."; +else + curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - + curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list + apt update -qq + ACCEPT_EULA=Y apt install -y msodbcsql18 + # Optional: for bcp and sqlcmd uncomment the following lines. + # ACCEPT_EULA=Y apt install -y mssql-tools18 + # echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc + # source ~/.bashrc + + # Optional: for unixODBC development headers uncomment the following lines. + # apt install -y unixodbc-dev +fi apt install libcgi-session-perl -y 2>>install.log && apt install libapache2-mod-perl2 -y 2>>install.log &&