This Blog runs on WordPress installed on a Windows Server that runs in Azure. There are obviously cheaper and easier (probably?) places to run a WordPress blog. But I work in a Microsoft centric environment and I work in Azure (a lot) and doing it this way allows me to tinker and test things.
I decided to create another blog. I don’t know for sure yet what I want to post there, but this one is primarily about my work related activities. I think this new one will be about non work things. I will still post here a couple of times each decade (given my current history), so no one should feel like this is going away or that they should follow this or the new one more closely.
In keeping with the technical nature of this blog, here is how I setup the new one. It has been a couple of years since I moved to the current setup, so it took me an hour or two to figure out the new setup.
I first downloaded the latest WordPress files. I am sure you can search for the page, but Download – WordPress.org is where I went. As of this writing, the current version is 6.1.1, so that is what I downloaded. Then I created a directory for the new blog site, and extracted the WordPress files. In IIS, I right clicked on Sites, and selected Add Website (names changed to protect the guilty):
For now, I entered the site name, and gave it the path to the WordPress files for this site. I left it as ‘http’ and entered the host name (the web address for the site). This is so I can work on getting the setup done (locally on the machine) before I add DNS and SSL Certs. I also had to update the ‘hosts’ file on the machine to point the new site name to the local machine.
When you have it setup, you can right click on the site, Manage Website>Browse to get to the setup for the site.
This is an indication that you at least have IIS and local hosts file setup working(ish). So select your language hit continue, where you are then reminded that there is more to the story than just he WordPress files:
WordPress has an article with instructions on how to setup the new database in various scenarios. In my case, I use the MySQL Client. The instructions are great except that the commands are not exactly current. Versions of MySQL after 8 do not allow you to create the db user implicitly when you are granting permissions. You have to create the user first. If you are using the MySQL Client, here are the steps that should be in the article:
CREATE DATABASE databasename;
CREATE USER ‘newusername’@’localhost’ IDENTIFIED BY ‘password’;
GRANT ALL PRIVILEGES ON databasename.* TO ‘newusername’@’localhost’;
The lower case portions of the above commands should be changed to match your preferred names. You can leave localhost. See if you can spot the error in the WordPress documentation, as shown in my example here:
Here is how that applies to the setup:
When you hit submit, this information gets written to the wp-config.php file. That works if you have IIS configured correctly. If not, you might get this:
Basically, the web service can’t write to the directory, so it can’t update the file. The fix for this is to create an account to run the website and apppool. It needs to have read/write access to the directory.
Create a local account to use for this:
In IIS, go to the Application Pools, click on the app pool for your site, click on the Advanced Settings… on the right. In the Identity field hit the ellipses and enter the information for the local account:
Then in IIS, click on the website and the Advanced Settings… on the right. In the Physical Path Credentials field, hit the ellipses and enter the information for the local account. Notice I got the username right this time, for my local user. In the previous screen shot, I had it as test.local, but I created it as testlocal so that didn’t work:
Once you have done all of that, and you enter the correct information, you get to this:
Once you click the button, you get to actually start putting important information in:
Then you are prompted to log in so you can see your Dashboard. You are on your own from here.