Install and configure WordPress

Not sure if you understood me, but I support the official Ubuntu release (well, amalgamation of) which you get by:

apt install ubuntu.

I personally use latest.tar and do build all my Wordpress sites (I have about 72 I’m the admin for currently) by hand using the ‘upstream’ method.

However, for people that know little very Linux, the upstream method tends to be more difficult, in my opinion.

Anyways, just wanted to clear that up. I’ve been helping out in this thread for years now and was probably the reason the original editor came back to clean things up.

Thanks to all the people I have helped over the years. I can see your Wordpress sites are still up, and being managed now by yourself!

Ron

So for the person’s and or people having that MySQL password issue, use this syntax:

alter ‘user’@‘localhost’ identified with caching_sha2_password by ‘password’;

Now obviously if that user entry has password options set to set to something other than sha2, for example like the default root user on mysql for ubuntu, it won’t work, but you just created the user, didn’t you? So it will work :wink:

Obviously update user, localhost and password to whatever is appropriate for your environment.

Ron

Add: apt install curl
because it is used on the next step

This isn’t needed. curl is installed by default.

I’ve tried following this guide - and when GRANTING permissions to my wordpress database, MYSQL returns 0 rows updated. Which isn’t great.

  • create user ‘user’@’localhost’ identified by ‘password’;
  • create database appdb;
  • grant all privileges on appdb.* to ‘user’@’localhost’;
  • flush privileges;

And to get rid of of your prior tries just in case they exist:

  • drop user;
  • drop database;

Use the first set of commands and see if that clears up your issues. Use the drop commands to clear out earlier attempts that didn’t work.

Let me know how it went and whether you need further help.

Ron
PS: Remember to update ‘user’, ‘localhost’ and ‘password’ to whatever is correct for your setup.

sudo systemctl start mysql[quote=“system, post:1, topic:13959”]
Enable MySQL with sudo service mysql start.
[/quote]

Enable MySQL with sudo systemctl enable mysql.

Making my first post, and I’m new to WordPress! My apologies if I’m doing this wrong.

Let’s add a suggestion to have users add 198.143.164.251 api.wordpress.org to /etc/hosts. I recently installed WordPress.org on my Ubuntu Server 20.04 VM. I got the sample site running, and I was able to access wp-admin too. But I encountered errors when trying to add plugins or themes.

I resolved my errors by making the above changes.

Thanks so much for all that y’all do! I couldn’t do my thang without y’all!

If your server is configured to resolve DNS queries this is not needed. The vast majority of installations don’t need this.

I’ve got another suggestion too – the Ubuntu tutorial doesn’t say to download the following php packages – php-gd php-xmlrpc php-soap.

I didn’t install these because this Ubuntu tutorial didn’t say we had to. I was unable to install plugins and themes. Once I installed these other php packages, I was able to install themes and plugins without issue.

In the page Configure WordPress, the user is instructed to "Open http://localhost/". This applies only if the user has installed Apache and WordPress on their local machine. In the more frequent case in which they’re being installed on a separate server (with no web browser), the more useful instruction would be to tell the user to open http://{address or domain} where {address or domain} is either an IP address by which the server can be reached or its domain name. This is the one point that briefly threw me in going through an otherwise excellent tutorial.

New to this. This tutorial contains the following in step 3:

sudo mkdir -p /srv/www
sudo chown www-data: /srv/www
curl https://wordpress.org/latest.tar.gz | sudo -u www-data tar zx -C /srv/www

Note that this sets the ownership to the user www-data, which is potentially insecure, such as when your server hosts multiple sites with different maintainers. You should investigate using a user per website in such scenarios and make the files readable and writable to only those users. This will require configuring PHP-FPM to launch a separate instance per site each running as the site’s user account. In such setup the wp-config.php should (read: if you do it differently you need a good reason) be readonly to the site owner and group and other permissions set to no-access (chmod 400). This is beyond the scope of this guide, however.<

If one were to use this guide then later added an additional site, both sites would be vulnerable. I have researched quite a bit but not able to find one for ubuntu and Apache2 (without Nginx)
Would anyone know of such a guide?

Perhaps the author could add such a guide to link to?

Forgive me if I am a bit of a newbie on this.

Thanks all.

GRANT is no longer supported in MYSQL 8.x
grant alter,create,delete,drop,index,insert,select,update,trigger,alter routine,
-> create routine, execute, create temporary tables on wordpressusr.* to ‘wordpressusr’;

will work. some od the privileges shown above may be unnecessary.

Note FLUSH PRIVILEGES has never been required after GRANT/CREATE USER or any user SQL (excluding direct hacks of underlying tables which is not encouraged).

Dear maintainers of Install and Configure WordPress,

Thanks for the great tutorial, however, the link to TinyMCE Advanced is broken on page,

It seems Advanced Editor Tools (previously TinyMCE Advanced) has replaced it.

The following page seems to have the correct links, and so perhaps could be referenced in this tutorial,
https://wordpress.org/plugins/tinymce-advanced/

Cheers, David

This is correct. I am going through the 3 or 4 replies I have received and will be taking all these changes and updating the relevant sections.

Thank you.

These are excellent suggestions however I do want to point that you make sure these are options you want. Lately there have been many exploits targeting php-xmlrpc however I am aware that thus module is used by many wordpress enthusiasts so make sure to keep up with all your system updates.

apt update
apt upgrade

It’s a good idea to run those commands prior to installing and update software to make sure your Ubuntu is up to date on all fronts as it will minimize and/or eliminate much of the security based concerns.

Thank you.

The grant command is absolutely available in current versions of mysql. The change that was made is that you cannot create a user directly anymore with the grant command. It’s the reason I use the create command to create the user.

I still suggest using ‘grant all privilges …’ instead of typing out all of the specific ‘grants’ you’d like, unless creating user with minimal privileges.

Hey,

I’m a beginner and am doing this for a homelab. I ran into a issue where I wasn’t able to connect to my server on the browser. My fix was " sudo ufw allow 80". I’d put this, or any other viable variant, and what it does into the instructions for clarification for people in a similar boat as me. This probably doesn’t apply to production/enterprise enviroments.

As Uncomplicated Firewall (ufw) is NOT enabled by default, the instructions for configuring ufw is not within the purview of this howto. It is however a good note to keep here in the responses as it is quite possible there are users who ARE using the ufw host based firewall, as I do.

Thanks!