diff --git a/templates/template01-nextcloud-standalone/Readme.md b/templates/template01-nextcloud-standalone/Readme.md index 5bff96e..bebaa45 100644 --- a/templates/template01-nextcloud-standalone/Readme.md +++ b/templates/template01-nextcloud-standalone/Readme.md @@ -7,7 +7,6 @@ |File name | Description| | --- | --- | -| `mkcert` | mkcert command line utility to be downloaded [here](https://github.com/FiloSottile/mkcert/releases). Pick the latest binary for amd64 and rename it to `mkcert` | | `nc-fulltext-live-indexer.service` | OPTIONAL - systemd unit file for the Fulltext live indexer | | `nc-redirect.conf` | Apache Web Server http-to-https redirect configuration file | | `nextcloud.conf` | Apache Web Server main configuration file | diff --git a/templates/template01-nextcloud-standalone/Vagrantfile b/templates/template01-nextcloud-standalone/Vagrantfile index 85ae5d4..8091bec 100644 --- a/templates/template01-nextcloud-standalone/Vagrantfile +++ b/templates/template01-nextcloud-standalone/Vagrantfile @@ -4,22 +4,19 @@ Vagrant.configure("2") do |config| - config.vm.box = "hibox/focal64" + config.vm.box = "isc/lxc-ubuntu-22.04" config.vm.box_check_update = false - - ## This is the latest box version as of 19/01/2022 - ## Box versions are available here: https://app.vagrantup.com/hibox/boxes/focal64 - config.vm.box_version = "1.0.1639726498" config.vm.provider 'lxd' do |lxd| lxd.api_endpoint = 'https://127.0.0.1:8443' lxd.timeout = 10 lxd.name = 'your-container-name' + lxd.project = 'default' + lxd.profiles = ['default'] # lxd.nesting = nil # lxd.privileged = nil # lxd.ephemeral = false - # lxd.profiles = ['default'] # lxd.environment = {} # lxd.config = {} end diff --git a/templates/template01-nextcloud-standalone/provision.sh b/templates/template01-nextcloud-standalone/provision.sh index 91699cf..525ec80 100644 --- a/templates/template01-nextcloud-standalone/provision.sh +++ b/templates/template01-nextcloud-standalone/provision.sh @@ -11,16 +11,22 @@ # Fully Qualified Name: ex. "nc.localenv.com" MACHINE_HOSTNAME= -# Nextcloud Installer name (format tar.bz2): ex. "nextcloud-21.0.7.tar.bz2" +# Nextcloud Installer name (format tar.bz2): ex. "nextcloud-X.Y.Z.tar.bz2" +# If using a version older that 24, change also the parameter PHP_VERSION NEXTCLOUD_INSTALLER_ARCHIVE= #### The user must fill these variables - END +## NC<24 => PHP=7.4 +## NC>=24 => PHP=8.1 OR PHP=7.4 +## https://www.linuxcapable.com/how-to-install-php-7-4-on-ubuntu-22-04-lts/ +PHP_VERSION=8.1 + NEXTCLOUD_USER=usrv NETWORK_INTERFACE=eth0 -PHP_INI=/etc/php/7.4/apache2/php.ini +PHP_INI=/etc/php/${PHP_VERSION}/apache2/php.ini hostnamectl set-hostname ${MACHINE_HOSTNAME} @@ -50,7 +56,7 @@ ## Check the MD5 of the Nextcloud Installer -##(cd to the folder to avoid a 'File Not Found' error +## cd to the folder to avoid a 'File Not Found' error cd /vagrant/artifacts md5sum -c ${NEXTCLOUD_INSTALLER_ARCHIVE}.md5 < ${NEXTCLOUD_INSTALLER_ARCHIVE} @@ -70,29 +76,48 @@ fi ## Install the needed packages from apt repositories + + +if [ "${PHP_VERSION}" == "7.4" ]; then + + apt update + + apt install -y software-properties-common apt-transport-https + + add-apt-repository ppa:ondrej/php -y + +fi + apt update -apt install -y apache2 mariadb-server libapache2-mod-php7.4 imagemagick - -apt install -y php7.4-gd php7.4-mysql php7.4-curl php7.4-mbstring php7.4-intl - -apt install -y php7.4-gmp php7.4-bcmath php-imagick php7.4-xml php7.4-zip - -apt install -y redis php-redis +apt install -y apache2 \ + mariadb-server \ + libapache2-mod-php${PHP_VERSION} \ + imagemagick \ + php${PHP_VERSION}-gd \ + php${PHP_VERSION}-mysql \ + php${PHP_VERSION}-curl \ + php${PHP_VERSION}-mbstring \ + php${PHP_VERSION}-intl \ + php${PHP_VERSION}-gmp \ + php${PHP_VERSION}-bcmath \ + php${PHP_VERSION}-imagick \ + php${PHP_VERSION}-xml \ + php${PHP_VERSION}-zip \ + redis \ + php${PHP_VERSION}-redis \ + mkcert ## For troubleshooting, it is typically useful to be able to access the db server from a graphical UI sed -i "s|bind-address|#bind-address|g" /etc/mysql/mariadb.conf.d/50-server.cnf systemctl restart mysql -## Install the mkcert rootCA (see https://github.com/FiloSottile/mkcert#installing-the-ca-on-other-systems) -chmod u+x /vagrant/artifacts/mkcert - export CAROOT=/vagrant/artifacts/ -/vagrant/artifacts/mkcert -install +mkcert -install -/vagrant/artifacts/mkcert --cert-file /etc/ssl/certs/${MACHINE_HOSTNAME}.pem --key-file /etc/ssl/private/${MACHINE_HOSTNAME}-key.pem "${MACHINE_HOSTNAME}" +mkcert --cert-file /etc/ssl/certs/${MACHINE_HOSTNAME}.pem --key-file /etc/ssl/private/${MACHINE_HOSTNAME}-key.pem "${MACHINE_HOSTNAME}" ## Create the database and the user for the Nextcloud backend database