| 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
# Add this at the begining of all scripts.
if [ -f "include/startup.sh" ]; then
. include/startup.sh
elif [ -f "../include/startup.sh" ]; then
. ../include/startup.sh
fi
checkOs
checkRootUser
runOnceCheck
checkTagExist nginx.success
checkTagExist mysqld.success
checkTagExist php.success
checkTagExist maild.success
checkTagExist wp-cli.success
rootDir=$(rootDir)
WP_PATH="/var/www/html"
WPID=`shuf -i 100000-999999 -n 1`
echo "Setting nginx config" | log
cp $rootDir/tweaks/extras/wordpress-nginx/wordpress.conf /etc/nginx/sites-available/
# Symlink wordpress vhost
ln -s /etc/nginx/sites-available/wordpress.conf /etc/nginx/sites-enabled/
# Remove default vhosts
unlink /etc/nginx/sites-enabled/default
unlink /etc/nginx/sites-enabled/default-ssl
service nginx reload
waitOrStop 0 "Nginx failed to restart"
echo "Creating mysql user and permissions" | log
mysql --defaults-file=/root/.my.cnf -h localhost <<EOF
CREATE DATABASE wordpress_${WPID};
CREATE USER 'wp_${WPID}'@'localhost' identified with mysql_native_password by '${ADMINPASSWORD}';
GRANT all privileges on wordpress_${WPID}.* to 'wp_${WPID}'@'localhost';
FLUSH PRIVILEGES;
EOF
echo "Downloading wordpress and installing" | log
installPackage libpcre2-8-0 | log
wp core download --path=${WP_PATH} --locale=en_US --allow-root | log
waitOrStop 0 "Application failed to download"
wp config create --dbname=wordpress_${WPID} --dbuser=wp_${WPID} --dbpass=${ADMINPASSWORD} --locale=en_US --path=${WP_PATH} --allow-root | log
waitOrStop 0 "Failed to create database"
wp core install --url=http://${CWM_DOMAIN} --title="Welcome to the WordPress" --admin_user="admin" --admin_password="${ADMINPASSWORD}" --admin_email="${ADMINEMAIL}" --path=${WP_PATH} --allow-root | log
waitOrStop 0 "Failed to install application"
echo "Fixing app permissions" | log
chown -R www-data:www-data ${WP_PATH}
echo "Misc tweaks" | log
ini=$(find /etc -type f -name "php.ini" | grep fpm)
sed -i '/display_errors = /s/On/Off/g' $ini
echo "Misc. cleanups" | log
rm $WP_PATH/index.nginx-debian.html
echo "Adding descriptions" | log
descriptionAppend "Wordpress Admin Web UI: https://${CWM_DOMAIN}/wp-login.php"
descriptionAppend "Wordpress Username: admin"
descriptionAppend "Wordpress Password: ${ADMINPASSWORD}"
descriptionAppend " "
tagScript success
exit 0