wordpress_install/updated_install1.sh

33 lines
613 B
Bash

#!/bin/bash
DB_PASSWORD="changeme123"
apt update && apt upgrade -y
apt install -y apache2
apt install -y mysql-server
mysql_secure_installation
apt install -y php libapache2-mod-php php-mysql
systemctl restart apache2
mysql <<EOF
CREATE DATABASE wordpress;
CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY '$DB_PASSWORD';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
EOF
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
nano /tmp/wordpress/wp-config.php