#============================================================================== # INSTALL SECOND WEBSITE WITH WORDPRESS #============================================================================== echo Welk domein mag gekoppeld worden? Typ domein zonder www read domain echo Standaard wachtwoord? read passwd echo Database user en name? read db_name db_user echo Standaard wachtwoord read passwd db_pass=$(date +%s|sha256sum|base64|head -c 32) #-------------------# # MYSQL CONFIG # #-------------------# mysql -u root -p"$passwd" -e "CREATE DATABASE "$db_name" DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;" mysql -u root -p"$passwd" -e "GRANT ALL ON "$db_name".* TO '"$db_user"'@'localhost' IDENTIFIED BY '"$db_pass"';" mysql -u root -p"$passwd" -e "FLUSH PRIVILEGES;" #-------------------# # WP - INSTALL # #-------------------# cd /tmp curl -LO https://wordpress.org/latest.tar.gz tar xzvf latest.tar.gz cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php cp -a /tmp/wordpress/. /var/www/"$domain"/html chown -R www-data:www-data /var/www/"$domain"/html WPSalts=$(wget https://api.wordpress.org/secret-key/1.1/salt/ -q -O -) cat < /var/www/"$domain"/html/wp-config.php array( # '127.0.0.1:11211' # ) #); #define('WP_REDIS_HOST', '127.0.0.1'); #define('WP_REDIS_PASSWORD', '$passwd'); #define('WP_REDIS_PORT', '6379'); require_once(ABSPATH . 'wp-settings.php'); EOF #-------------------# # OPCACHE GUI # #-------------------# cd /tmp curl -LO https://raw.githubusercontent.com/amnuts/opcache-gui/master/index.php cp /tmp/index.php /tmp/opcache.php cp -a /tmp/opcache.php /var/www/"$domain"/html cat > /var/www/"$domain"/html/info.php <<- "EOF" EOF