| 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 nginx.success
checkTagExist php.success
checkTagExist mysqld.success
checkTagExist nginx-enable-php-ssl.success
currentDate=`date +"%Y-%m-%d %H:%M:%S"`
appPath=/var/www/html
appVersion=3-9-13
rootDir=$(rootDir)
echo "Installing Joomla" | log
echo "Downloading Joomla from original repo" | log
cd $rootDir/temp
# curl -Lo joomla.tgz https://downloads.joomla.org/cms/joomla3/3-9-1/joomla_3-9-1-stable-full_package-tar-gz?format=gz | log
# NOTICE: there's been a change of route paths between older 3-9-1 and 3-9-10, not just different versions
curlDownload https://downloads.joomla.org/cms/joomla3/$appVersion/joomla_$appVersion-stable-full_package.tar.gz?format=gz joomla.tgz
waitOrStop 0 "File not downloaded from official source"
echo "Extracting Joomla to ${appPath}/" | log
mkdir -p $appPath/
tar -xzvf joomla.tgz -C $appPath/ | log
waitOrStop 0 "Failed to extract application archive"
rm -f joomla.tgz
echo "Creating Joomla Database" | log
mysql --defaults-file=/root/.my.cnf -h localhost <<EOF
CREATE DATABASE joomla CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL ON joomla.* TO 'joomla'@'localhost' IDENTIFIED BY '${ADMINPASSWORD}';
FLUSH PRIVILEGES;
EOF
echo "Configuring Joomla for first use" | log
cp $rootDir/tweaks/extras/joomla-nginx/configuration.php $appPath/configuration.php
sed -i "s/Password/${ADMINPASSWORD}/g" $appPath/configuration.php
sed -i "s/some@mail.com/${ADMINEMAIL}/g" $appPath/configuration.php
mysql --defaults-file=/root/.my.cnf -h localhost joomla < $rootDir/tweaks/extras/joomla-nginx/joomla.sql
waitOrStop 0 "Failed to create database"
mysql --defaults-file=/root/.my.cnf -h localhost <<EOF
INSERT INTO joomla.joomla_users VALUES (632,'Super User','admin','${ADMINEMAIL}',MD5('${ADMINPASSWORD}'),0,1,'${currentDate}','${currentDate}','0','','${currentDate}',0,'','',0);
EOF
echo "Setting permissions and cleanup" | log
rm -rf $appPath/installation/
rm $appPath/index.nginx-debian.html
chown -R www-data:www-data $appPath
echo "Configuring PHP to support app needs" | log
phpVersion=$(php -v | head -n 1 | cut -d " " -f 2 | cut -f1-2 -d".")
phpiniPath=/etc/php/$phpVersion/fpm/php.ini
sed -i '/upload_tmp_dir/s/^;//' $phpiniPath
sed -i '/upload_tmp_dir/s/=/= \"\/tmp\"/' $phpiniPath
systemctl restart php$phpVersion-fpm.service
waitOrStop 0 "Restart php-fpm service failed"
echo "Setting nginx config" | log
# Copy Joomla vhost from extras
cp $rootDir/tweaks/extras/joomla-nginx/joomla.conf /etc/nginx/sites-available/
# Symlink magento vhost
ln -s /etc/nginx/sites-available/joomla.conf /etc/nginx/sites-enabled/
# Remove default vhosts
unlink /etc/nginx/sites-enabled/default
unlink /etc/nginx/sites-enabled/default-ssl
systemctl restart nginx
waitOrStop 0 "Restart nginx service failed"
echo "adding descriptions" | log
descriptionAppend "Joomla Admin Web UI: https://${CWM_DISPLAYED_ADDRESS}/administrator"
descriptionAppend "Joomla Username: admin"
descriptionAppend "Joomla Password: ${ADMINPASSWORD}"
descriptionAppend " "
tagScript success
exit 0