| Server IP : 104.129.129.72 / Your IP : 216.73.216.229 Web Server : LiteSpeed System : Linux 123answers 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 User : answe8064 ( 1002) PHP Version : 8.2.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /opt/installer/apps/ |
Upload File : |
#!/bin/bash
if [ -f "include/startup.sh" ]; then
. include/startup.sh
elif [ -f "../include/startup.sh" ]; then
. ../include/startup.sh
fi
checkTagExist httpd.success
appPath=/var/www/html/directus
rootDir=$(rootDir)
echo "Installing PHP dependencies" | log
add-apt-repository ppa:ondrej/php
apt update
packages=(unzip php7.2 libapache2-mod-php7.2 php7.2-common php7.2-curl \
php7.2-intl php7.2-mbstring php7.2-xmlrpc php7.2-mysql php7.2-gd php7.2-xml php7.2-cli php7.2-zip)
installPackage "${packages[@]}" | log
waitOrStop 0 "Failed to install dependencies"
ubuntu_version=$(lsb_release -rs)
if [[ "$ubuntu_version" == "24.04" ]]; then
a2dismod php8.3
a2enmod php7.2
fi
echo "Creating Directus Database" | log
mysql --defaults-file=/root/.my.cnf -h localhost <<EOF
CREATE DATABASE directus CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'directususer'@'localhost' identified with mysql_native_password by '${ADMINPASSWORD}';
GRANT all privileges on directus.* to directususer@localhost;
FLUSH PRIVILEGES;
EOF
echo "Downloading Directus from github repo" | log
mkdir -p $appPath
cd /tmp && curlDownload https://github.com/directus/directus/releases/download/6.4.9/directus-build-6.4.9-20180403074820.zip
waitOrStop 0 "File not downloaded from official source"
unzip directus-build-6.4.9-20180403074820.zip -d $appPath
waitOrStop 0 "Failed to extract application archive"
echo "Setting permissions for Directus" | log
chown -R www-data:www-data /var/www/html/directus/
chmod -R 755 /var/www/html/directus/
echo "Setting Apache VirtualHost" | log
cp $rootDir/tweaks/extras/directus/directus.conf /etc/apache2/sites-available/
if [[ ! -f /etc/letsencrypt/live/${CWM_DISPLAYED_ADDRESS}/cert.pem ]]; then
sed -i 's/cert\.pem/fullchain\.pem/g' /etc/apache2/sites-available/directus.conf
fi
sed -i "s/ServerDomain/${CWM_DISPLAYED_ADDRESS}/g" /etc/apache2/sites-available/directus.conf
ln -s /etc/apache2/sites-available/directus.conf /etc/apache2/sites-enabled/
unlink /etc/apache2/sites-enabled/000-default.conf
unlink /etc/apache2/sites-enabled/default-ssl.conf
systemctl restart apache2.service
waitOrStop 0 "Failed to restart Apache service"
echo "Enabling VirtualHost configuration" | log
a2ensite directus.conf
a2enmod rewrite
systemctl restart apache2.service
waitOrStop 0 "Failed to restart Apache service"
echo "Adding descriptions" | log
descriptionAppend "To finish Directus configuration go to: https://${CWM_DISPLAYED_ADDRESS}"
descriptionAppend "Directus Database: directus"
descriptionAppend "Directus Database Username: directususer"
descriptionAppend "Directus Database Password: ${ADMINPASSWORD}"
descriptionAppend " "
tagScript success
exit 0