re-organise config structure
This commit is contained in:
parent
d3549ec9ed
commit
e3186d9cc9
|
@ -1,4 +0,0 @@
|
|||
## apache configuration
|
||||
#
|
||||
## uncomment if using apache
|
||||
apache2_version='latest'
|
|
@ -0,0 +1,8 @@
|
|||
export mariadb_version='latest'
|
||||
#mysql_version='latest'
|
||||
|
||||
export db_root_pass='9483ujtej0--=0FFFdl'
|
||||
|
||||
export db_name='wordpress'
|
||||
export db_user='wordpress'
|
||||
export db_pass='wordpress'
|
|
@ -1,4 +0,0 @@
|
|||
## uncomment if using mariadb
|
||||
mariadb_version='latest'
|
||||
db_root_pass='9483ujtej0--=0FFFdl'
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
## uncomment if using mysql
|
||||
#mysql_version='latest'
|
||||
#db_root_pass='9483ujtej0--=0FFFdl'
|
|
@ -1,5 +0,0 @@
|
|||
## nginx configuration
|
||||
|
||||
## uncomment if using nginx
|
||||
#nginx_version='latest'
|
||||
|
|
@ -1,10 +1,15 @@
|
|||
## litespeed configuration
|
||||
## uncomment if using litespeed
|
||||
apache2_version='latest'
|
||||
|
||||
#nginx_version='latest'
|
||||
|
||||
## specify specific version from latest, 54, 55, 56, 70, 71, 72, 73 or 74
|
||||
#export litespeed_version='latest'
|
||||
|
||||
## php version
|
||||
######################
|
||||
# litespeed specific #
|
||||
######################
|
||||
|
||||
## litespeed php version
|
||||
#export ls_lsphp_version='73'
|
||||
|
||||
## https://openlitespeed.org/kb/1-click-install/
|
|
@ -1,4 +0,0 @@
|
|||
## apache configuration
|
||||
#
|
||||
## uncomment if using apache
|
||||
# apache2_version='latest'
|
|
@ -1,11 +0,0 @@
|
|||
# cloudways configuration
|
||||
|
||||
. ./config/remote/cloudways.secret
|
||||
|
||||
cloudways_user='cloudways@rayelliott.dev'
|
||||
cloudways_url='https://wordpress-453075-1468300.cloudwaysapps.com'
|
||||
|
||||
cloudways_ssh='test123@wordpress-453075-1468300.cloudwaysapps.com'
|
||||
|
||||
cloudways_db_name='mhhusspndh'
|
||||
cloudways_db_user='mhhusspndh'
|
|
@ -0,0 +1,8 @@
|
|||
# export mariadb_version='latest'
|
||||
# export mysql_version='latest'
|
||||
|
||||
# export db_root_pass='9483ujtej0--=0FFFdl'
|
||||
|
||||
export db_name='mhhusspndh'
|
||||
export db_user='mhhusspndh'
|
||||
export db_pass='w9Chzh6fR4'
|
|
@ -1,4 +0,0 @@
|
|||
## uncomment if using mariadb
|
||||
# mariadb_version='latest'
|
||||
# db_root_pass='9483ujtej0--=0FFFdl'
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
## uncomment if using mysql
|
||||
#mysql_version='latest'
|
||||
#db_root_pass='9483ujtej0--=0FFFdl'
|
|
@ -1,5 +0,0 @@
|
|||
## nginx configuration
|
||||
|
||||
## uncomment if using nginx
|
||||
#nginx_version='latest'
|
||||
|
|
@ -1,10 +1,15 @@
|
|||
## litespeed configuration
|
||||
## uncomment if using litespeed
|
||||
# apache2_version='latest'
|
||||
|
||||
#nginx_version='latest'
|
||||
|
||||
## specify specific version from latest, 54, 55, 56, 70, 71, 72, 73 or 74
|
||||
#export litespeed_version='latest'
|
||||
|
||||
## php version
|
||||
######################
|
||||
# litespeed specific #
|
||||
######################
|
||||
|
||||
## litespeed php version
|
||||
#export ls_lsphp_version='73'
|
||||
|
||||
## https://openlitespeed.org/kb/1-click-install/
|
|
@ -18,11 +18,6 @@ for _file in ./config/$_target/* ; do
|
|||
. "$_file"
|
||||
done
|
||||
|
||||
if [ "$_target" = remote ] && [ -n "$cloudways_user" ] ; then
|
||||
echo "Using Cloudways - nothing to install"
|
||||
exit
|
||||
fi
|
||||
|
||||
# source script files
|
||||
if [ -n "$_target_os" ] ; then
|
||||
_script_dir="./scripts/$_target_os"
|
||||
|
|
|
@ -24,9 +24,9 @@ if [ -n "$wp_user" ] ; then
|
|||
--wordpressplus "$url" \
|
||||
--wordpresspath "$wp_path" \
|
||||
--dbrootpassword "$db_root_pass" \
|
||||
--dbpassword "$wp_db_pass" \
|
||||
--dbname "$wp_db_name" \
|
||||
--dbuser "$wp_db_user" \
|
||||
--dbpassword "$db_pass" \
|
||||
--dbname "$db_name" \
|
||||
--dbuser "$db_user" \
|
||||
--wpuser "$wp_user" \
|
||||
--wppassword "$wp_pass" \
|
||||
&& ufw allow 7080
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
db_file="$wp_path/data.sql"
|
||||
|
||||
wp db export --dbuser=wordpress --dbpass=$wp_db_pass --add-drop-table --alow-root "$db_file"
|
||||
wp db export --dbuser=wordpress --dbpass=$db_pass --add-drop-table --alow-root "$db_file"
|
||||
tar czf /tmp/wordpress.tar.gz "$wp_path"
|
||||
# scp
|
||||
rm "$db_file"
|
||||
|
|
|
@ -24,6 +24,10 @@ ssh -T $ssh << EOSSH
|
|||
$_mysql_cmd "DROP DATABASE IF EXISTS test;"
|
||||
$_mysql_cmd "DELETE FROM mysql.db WHERE Db='test' OR Db='"'test\\_%'"'"
|
||||
|
||||
$_mysql_cmd "CREATE DATABASE $db_name;"
|
||||
$_mysql_cmd "GRANT ALL PRIVILEGES ON $db_name.* TO '$db_user'@'localhost' IDENTIFIED BY '$db_pass';"
|
||||
$_mysql_cmd "FLUSH PRIVILEGES;"
|
||||
|
||||
mysqladmin --user=root password "$db_root_pass"
|
||||
mysqladmin --user=root --password="$db_root_pass" flush-privileges
|
||||
EOSSH
|
||||
|
|
|
@ -24,6 +24,10 @@ ssh -T $ssh << EOSSH
|
|||
$_mysql_cmd "DROP DATABASE IF EXISTS test;"
|
||||
$_mysql_cmd "DELETE FROM mysql.db WHERE Db='test' OR Db='"'test\\_%'"'"
|
||||
|
||||
$_mysql_cmd "CREATE DATABASE $db_name;"
|
||||
$_mysql_cmd "GRANT ALL PRIVILEGES ON $db_name.* TO '$db_user'@'localhost' IDENTIFIED BY '$db_pass';"
|
||||
$_mysql_cmd "FLUSH PRIVILEGES;"
|
||||
|
||||
mysqladmin --user=root password "$db_root_pass"
|
||||
mysqladmin --user=root --password="$db_root_pass" flush-privileges
|
||||
EOSSH
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
echo "Installing WordPress .."
|
||||
|
||||
_mysql_cmd="mysql -uroot -p$db_root_pass -e "
|
||||
|
||||
ssh -T $ssh << EOSSH
|
||||
|
||||
# install wp-cli first
|
||||
|
@ -15,15 +13,6 @@ su "$user"
|
|||
if wp core is-installed --quiet --path="$wp_path" ; then
|
||||
echo "WordPress already installed"
|
||||
else
|
||||
# first create database and user
|
||||
if command -v mysql ; then
|
||||
$_mysql_cmd "CREATE DATABASE $wp_db_name;"
|
||||
$_mysql_cmd "GRANT ALL PRIVILEGES ON $wp_db_name.* TO '$wp_db_user'@'localhost' IDENTIFIED BY '$wp_db_pass';"
|
||||
$_mysql_cmd "FLUSH PRIVILEGES;"
|
||||
else
|
||||
echo "ERROR: mysql not found - aborting WordPress install"
|
||||
exit 40
|
||||
fi
|
||||
wp core download \
|
||||
--version="$wp_version" \
|
||||
--path="$wp_path" \
|
||||
|
@ -31,9 +20,9 @@ else
|
|||
--locale="$wp_locale"
|
||||
wp config create \
|
||||
--path="$wp_path" \
|
||||
--dbname="$wp_db_name" \
|
||||
--dbuser="$wp_db_user" \
|
||||
--dbpass="$wp_db_pass" \
|
||||
--dbname="$db_name" \
|
||||
--dbuser="$db_user" \
|
||||
--dbpass="$db_pass" \
|
||||
--locale="$wp_locale" \
|
||||
--extra-php <<PHP
|
||||
define( 'WP_DEBUG', true );
|
||||
|
|
|
@ -5,9 +5,10 @@ _mysql_cmd="mysql -uroot -p$db_root_pass -e "
|
|||
ssh -T $ssh << EOSSH
|
||||
# remove database
|
||||
if command -v mysql ; then
|
||||
$_mysql_cmd "DROP DATABASE $wp_db_name;"
|
||||
$_mysql_cmd "DROP DATABASE $db_name;"
|
||||
$_mysql_cmd "CREATE DATABASE $db_name;"
|
||||
else
|
||||
echo "ERROR: no installed database found - aborting WordPress removal"
|
||||
echo "ERROR: mysql not found - aborting WordPress removal"
|
||||
exit 40
|
||||
fi
|
||||
# remove files
|
||||
|
|
|
@ -11,8 +11,8 @@ ssh -T $ssh << EOSSH
|
|||
cd "$wp_path"
|
||||
wp db export \
|
||||
--path="$wp_path" \
|
||||
--dbuser="$wp_db_user" \
|
||||
--dbpass="$wp_db_pass" \
|
||||
--dbuser="$db_user" \
|
||||
--dbpass="$db_pass" \
|
||||
--add-drop-table \
|
||||
--allow-root \
|
||||
"/tmp/$_db_filename"
|
||||
|
|
|
@ -5,7 +5,8 @@ _mysql_cmd="mysql -uroot -p$db_root_pass -e "
|
|||
ssh -T $ssh << EOSSH
|
||||
# remove database
|
||||
if command -v mysql ; then
|
||||
$_mysql_cmd "DROP DATABASE $wp_db_name;"
|
||||
$_mysql_cmd "DROP DATABASE $db_name;"
|
||||
$_mysql_cmd "CREATE DATABASE $db_name;"
|
||||
else
|
||||
echo "ERROR: no installed database found - aborting WordPress removal"
|
||||
exit 40
|
||||
|
|
Loading…
Reference in New Issue