From 26c7db12364e8eba08e2f8e85bb534ed735a0be8 Mon Sep 17 00:00:00 2001 From: Bradley Taunt Date: Thu, 13 Jun 2024 14:57:38 -0400 Subject: Major overhaul and cleanups --- ...-27-Installing_WordPress_on_NearlyFreeSpeech.md | 95 ++++++++++++++-------- 1 file changed, 61 insertions(+), 34 deletions(-) (limited to '_posts/2024-05-27-Installing_WordPress_on_NearlyFreeSpeech.md') diff --git a/_posts/2024-05-27-Installing_WordPress_on_NearlyFreeSpeech.md b/_posts/2024-05-27-Installing_WordPress_on_NearlyFreeSpeech.md index 716a3c0..08b5c80 100644 --- a/_posts/2024-05-27-Installing_WordPress_on_NearlyFreeSpeech.md +++ b/_posts/2024-05-27-Installing_WordPress_on_NearlyFreeSpeech.md @@ -17,11 +17,15 @@ We will use the `wp-cli` that comes packaged with NearlyFreeSpeech (NFS): For help using WP-CLI from the SSH command line, use this command: - wp help +```sh +wp help +``` To download and unpack the latest version of WordPress, enter the following command: - wp core download +```sh +wp core download +``` ## Create a MySQL Process and Database @@ -52,8 +56,10 @@ Next, [create a new database](https://members.nearlyfreespeech.net/faq?q=CreateD At the SSH command line (replace the examples with the info for the database and user you created above): - wp core config --dbhost=example.db --dbname=exampledb --dbuser=exampledbuser --dbpass=dbpassword - chmod 644 wp-config.php +```sh +wp core config --dbhost=example.db --dbname=exampledb --dbuser=exampledbuser --dbpass=dbpassword +chmod 644 wp-config.php +``` ## Run the WordPress Installation and Setting Permissions @@ -67,41 +73,50 @@ To get your permalinks to work properly, you must set up an .htaccess file. Next, create an `.htaccess` file for your WordPress site. We suggest doing this directly from the SSH command line using the cat shell command: - cat >.htaccess <.htaccess <name-of-wordpress-backup.tar.gz +```sh +ssh yourmembername_siteshortname@ssh.phx.nearlyfreespeech.net tar -C /home/public -cvf - . | gzip >name-of-wordpress-backup.tar.gz +``` To back up WordPress to a file on our system that you can transfer via SFTP to your own computer, you can use a command like: - tar -C /home/public -cvzf /home/tmp/name-of-wordpress-backup.tar.gz . +```sh +tar -C /home/public -cvzf /home/tmp/name-of-wordpress-backup.tar.gz . +``` This assumes that your WordPress install is in the default location (`/home/public`). It will put your backup file in your `/home/tmp` directory. @@ -155,11 +178,15 @@ Do not try to back up your WordPress folder into your WordPress folder, as that If you have a Unix-like system of your own (e.g. macOS or Linux), you can do the backup directly from there using your local command prompt using the MySQL username and password you created for WordPress: - ssh yourmembername_siteshortname@ssh.phx.nearlyfreespeech.net wp db export - | gzip >wordpress-backup.sql.gz +```sh +ssh yourmembername_siteshortname@ssh.phx.nearlyfreespeech.net wp db export - | gzip >wordpress-backup.sql.gz +``` Or you can do it from the SSH command line via WP-CLI: - wp db export /home/tmp/wordpress-backup.sql +```sh +wp db export /home/tmp/wordpress-backup.sql +``` The `wordpress-backup.sql` file this generates will be stored in your site's `/home/tmp` directory. Download it from there to have a local copy. -- cgit v1.2.3-54-g00ecf