diff --git a/README.md b/README.md index 46bc4aa..5bebe2f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,51 @@ # WordPress -Wordpress on Ubuntu \ No newline at end of file +Wordpress on Ubuntu + +*** + +### Setup & Install LAMP +```sh +sudo apt update -qq && sudo apt upgrade -y +sudo apt install -y lamp-server^ +sudo apt install -y php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip wget +sudo systemctl restart apache2 +sudo a2enmod rewrite +sudo a2enmod ssl +sudo a2dissite 000-default +``` + +### Config MySQL +Default from the install above root has no password and is unsecure for the moment to just type `sudo mysql` then do each below and alter the usernames, password, and database names to your desire. So the example below the mysql datadase is `wpdb`, the mysql user is `wpdbuser`, and the password for that mysql user would be `changethispassword` +```sh +CREATE DATABASE wpdb DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; +CREATE USER 'wpdbuser'@'%' IDENTIFIED WITH mysql_native_password BY 'changethispassword'; +GRANT ALL ON shop.* TO 'wpdbuser'@'%'; +FLUSH PRIVILEGES; +EXIT; +``` + +### Install Wordpress +```sh +cd /tmp +curl -O https://wordpress.org/latest.tar.gz +tar xzvf latest.tar.gz +touch /tmp/wordpress/.htaccess +cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php +mkdir /tmp/wordpress/wp-content/upgrade +sudo mkdir /var/www/wp +sudo mkdir /var/www/wp/ssl +sudo mkdir /var/www/wp/html +sudo cp -a /tmp/wordpress/. /var/www/wp/html +sudo chown -R www-data:www-data /var/www/wp/html +sudo find /var/www/wp/html/ -type d -exec chmod 750 {} \; +sudo find /var/www/wp/html/ -type f -exec chmod 640 {} \; +``` + +### WP Config +Fix details laters +```sh +curl -s https://api.wordpress.org/secret-key/1.1/salt/ +sudo nano /var/www/shop/wp-config.php +define('FS_METHOD', 'direct'); +``` \ No newline at end of file