echo "Installing WordPress .." # check we have ssh access [ -z "$ssh_user" ] || [ -z "$ssh_root" ] && echo "Error: user and root ssh configuration must be specified" && exit 5 ssh -T $ssh_root << EOSSH # install wp-cli first if [ ! -f /usr/local/bin/wp ] ; then wget -nv -O /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \ && chmod +x /usr/local/bin/wp fi EOSSH ssh -T $ssh_user << EOSSH if wp core is-installed --quiet --path="$wp_path" ; then echo "WordPress already installed" else echo "wp core download \ --version=$wp_version \ --path=$wp_path \ --skip-content \ --locale=$wp_locale" wp core download \ --version="$wp_version" \ --path="$wp_path" \ --skip-content \ --locale="$wp_locale" wp config create \ --path="$wp_path" \ --dbname="$db_name" \ --dbuser="$db_user" \ --dbpass="$db_pass" \ --locale="$wp_locale" \ --extra-php < /etc/apache2/sites-available/wordpress.conf ServerName $domain DocumentRoot $wp_path ErrorLog /var/log/wordpress/error.log CustomLog /var/log/wordpress/access.log combined AllowOverride All RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] EOF a2enmod rewrite a2ensite wordpress a2dissite 000-default systemctl reload apache2 elif [ -n "nginx_version" ] ; then echo "TODO - nginx wordpress config" elif [ -n "litespeed_version" ] ; then echo "TODO - litespeed wordpress config" else echo "Warning: no webserver configuration found" fi EOSSH fi