WordPress

From DikapediaV2
Jump to: navigation, search


Download and Configure WordPress (and mysql/mariadb)



Download WordPress, extract, and change ownership of Files so Apache can access them:

wget -c http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
chown -R apache:apache /var/www/html/wordpress


Assuming you have mysql/mariadb installed, login to mysql to configure it:

mysql -u root -p


Configure DB:

CREATE DATABASE wordpress_db;
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wordpress_user'@'localhost' IDENTIFIED BY 'PASSWORD';
FLUSH PRIVILEGES;
Exit;


Note: These configurations must be the ones you will input when you go to [localip]/wp-admin/configsetup OR in the ‘wp-config.php’ file:

cp wp-config-sample.php wp-config.php
vim wp-config.php


And update the database settings, replacing database_name_here, username_here and password_here with what you entered in step 5 if necessary. Be sure to restart apache and mysql.

systemctl restart httpd/mariadb


Install WordPress on Amazon Linux 2


Install and configure WordPress on Amazon Linux 2: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.html - it will show you how to configure Wordpress to use your Mariadb database

(Be sure you have already configured a LAMP stack!
Tutorial: Install a LAMP Web Server on Amazon Linux 2 https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-lamp-amazon-linux-2.html )


How to Migrate WordPress Site to a New Host


Essentially, on the new server, you need to:

  • Move the old website files under /var/www/html or whatever (could be public_html), into the instance
  • Backup and restore the database (see MySQL / MariaDB)
  • And then simply install the WordPress theme on your new host, and install and activate the required plugins for that theme: Click here


Migrate using phpMyAdmin to export/import the sql file! EASY! TRIED AND TRUE
https://www.wpexplorer.com/migrating-wordpress-website/

Migrate WordPress site by exporting XML and importing using WordPress Import tool (LIGHTSAIL):
https://lightsail.aws.amazon.com/ls/docs/en_us/articles/migrate-your-wordpress-blog-to-amazon-lightsail

Updraftplus Plugin for wordpress is also another good way!
https://updraftplus.com/faqs/restore-site-updraftplus/
https://updraftplus.com/faqs/how-do-i-migrate-to-a-new-site-location/


Other ways to Migrate a WordPress Website and restore .sql file:
https://wpengine.com/resources/migrate-wordpress-site/
https://makeawebsitehub.com/migrating-wordpress-website-to-another-host/


How to download/install WordPress Themes



Theme is missing the style.css stylesheet error

https://help.market.envato.com/hc/en-us/articles/202821510-Theme-is-missing-the-style-css-stylesheet-error



For a more complete guide:
[+] How To Install WordPress with LAMP Stack on Ubuntu 16.04 (RoseHosting.com)


SSL content fixers


https://wordpress.org/plugins/really-simple-ssl/


https://wordpress.org/plugins/ssl-insecure-content-fixer/


WordPress Caching and Optimization


  • Good if you have issues with TTFB (Time to first byte) taking too long:

WP-Optimize – Cache, Clean, Compress.
https://wordpress.org/plugins/wp-optimize/


How to Change WordPress Domain Name: A Step-by-Step Guide


https://www.hostinger.com/tutorials/change-wordpress-domain-name


WordPress site gets "Error establishing database connection"


WordPress database error Table … is marked as crashed and should be repaired



How to add a button in the footer of Ray's site


Previously it had the following block in a WIDGET (Footer - Main)

Physio is a premium WordPress theme designed & build for physical therapy and rehabilitation clinics. The theme is responsive, has a drag and drop page builder and is fully customizable. Only available on ThemeForest.

[button href="http://themeforest.net/item/physio-physical-therapy-rehabilitation-wp-theme/14747135?ref=QreativeThemes" target="_blank"]More Theme Info[/button]


How to add a expire headers in wordpress


https://www.wpbeginner.com/wp-tutorials/how-to-add-expires-headers-in-wordpress/

For WordPress, you can do it via a plugin (WP rocket for example).

Alternatively, you can do it via the .htaccess file in Apache. If you are using Nginx, you can do it via some file (not sure), but it's possible. See the link above.


Update failed: the update cannot be installed because some files could not be copied. this is usually due to inconsistent file permissions


If you ever get the error "update failed: the update cannot be installed because some files could not be copied. this is usually due to inconsistent file permissions", then try this (this worked for me):

# chown -R apache:apache /var/www/html/*
# sudo systemctl restart httpd

I think sometimes permissions get's messed up somehow when doing stuff in WordPress


How to Update WordPress (via FTP)