Update 'README.md'

This commit is contained in:
Sarimoko 2021-07-21 02:28:48 +00:00
parent 4fb0d9d85d
commit b6f8587f4d
1 changed files with 49 additions and 1 deletions

View File

@ -1,3 +1,51 @@
# WordPress
Wordpress on Ubuntu
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');
```