Updated WP Installer Script
parent
ac5aa4886a
commit
088e1a08e2
|
@ -681,7 +681,7 @@ actions:
|
|||
- cmd[cp]:
|
||||
user: root
|
||||
commands:
|
||||
- bash -c 'cd /var/www/webroot/ROOT && /home/litespeed/mbmanager/install-wordpress.sh --wpusername="${settings.wpusername}" --wppassword="${settings.wppassword}" --wpemail="${settings.wpemail}"'
|
||||
- bash /home/litespeed/mbmanager/install-wordpress.sh --wpusername="${settings.wpusername}" --wppassword="${settings.wppassword}" --wpemail="${settings.wpemail}"
|
||||
- return:
|
||||
type: info
|
||||
message: "${response.out}"
|
||||
|
|
|
@ -245,6 +245,49 @@ wp config create \
|
|||
--dbhost="$DB_HOST" \
|
||||
--allow-root
|
||||
|
||||
# Verify that wp-config.php was created successfully
|
||||
if [ ! -f "wp-config.php" ]; then
|
||||
echo -e "${RED}Failed to create wp-config.php. Attempting alternative method...${NC}"
|
||||
|
||||
# Try alternative method using direct file creation
|
||||
echo -e "${YELLOW}Attempting to create wp-config.php manually...${NC}"
|
||||
cat > wp-config.php <<EOF
|
||||
<?php
|
||||
define( 'DB_NAME', '${DB_NAME}' );
|
||||
define( 'DB_USER', '${DB_USER}' );
|
||||
define( 'DB_PASSWORD', '${DB_PASSWORD}' );
|
||||
define( 'DB_HOST', '${DB_HOST}' );
|
||||
define( 'DB_CHARSET', 'utf8' );
|
||||
define( 'DB_COLLATE', '' );
|
||||
|
||||
define( 'AUTH_KEY', '$(openssl rand -base64 48)' );
|
||||
define( 'SECURE_AUTH_KEY', '$(openssl rand -base64 48)' );
|
||||
define( 'LOGGED_IN_KEY', '$(openssl rand -base64 48)' );
|
||||
define( 'NONCE_KEY', '$(openssl rand -base64 48)' );
|
||||
define( 'AUTH_SALT', '$(openssl rand -base64 48)' );
|
||||
define( 'SECURE_AUTH_SALT', '$(openssl rand -base64 48)' );
|
||||
define( 'LOGGED_IN_SALT', '$(openssl rand -base64 48)' );
|
||||
define( 'NONCE_SALT', '$(openssl rand -base64 48)' );
|
||||
|
||||
\$table_prefix = 'wp_';
|
||||
|
||||
define( 'WP_DEBUG', false );
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
define( 'ABSPATH', __DIR__ . '/' );
|
||||
}
|
||||
|
||||
require_once ABSPATH . 'wp-settings.php';
|
||||
EOF
|
||||
|
||||
# Check if manual creation was successful
|
||||
if [ ! -f "wp-config.php" ]; then
|
||||
echo -e "${RED}Failed to create wp-config.php manually. Installation cannot continue.${NC}"
|
||||
exit 1
|
||||
fi
|
||||
echo -e "${GREEN}Successfully created wp-config.php manually.${NC}"
|
||||
fi
|
||||
|
||||
# Set proper permissions
|
||||
echo -e "${YELLOW}Setting proper permissions...${NC}"
|
||||
sudo chown -R litespeed:litespeed "$WP_ROOT"
|
||||
|
|
Loading…
Reference in New Issue