WP – Michael Groff /blog Expand or Die Wed, 27 Feb 2019 17:00:16 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 WordPress Permissions for Windows /blog/wordpress-permissions-for-windows/ Tue, 26 Feb 2019 03:08:00 +0000 /blog/?p=662

So I have had this post sitting in the “Draft” stage for years now. Probably 3 or 4. I thought I was going to tackle this and set something definitively out there for some people to follow. And today I will finally do just that.

Here are the suggested WordPress file permissions for Windows:

RUN LINUX!

RUN LINUX!

RUN LINUX!

]]>
PS Script install WP manually on Server 2012 R2 /blog/ps-script-install-wp-manually-server-2012-r2/ Thu, 14 Jul 2016 22:23:07 +0000 /blog/?p=548

This post does basically the same thing that I have already covered in my “WordPress on IIS 8.5 (Windows 2012 R2)” post, but it is a script that does literally everything for you. You will just need to add in a few of your own settings into the script, run it, and you will have a functional WP site.

First lets start of with the Features that I already have installed:

You will most likely have all of these but Telnet… INSTALL TELNET!

 

DisplayName                                   Name                      InstallState
-----------                                   ----                      ------------
File and Storage Services                     FileAndStorage-Services      Installed
Storage Services                              Storage-Services             Installed
.NET Framework 4.5 Features                   NET-Framework-45-Features    Installed
.NET Framework 4.5                            NET-Framework-45-Core        Installed
WCF Services                                  NET-WCF-Services45           Installed
TCP Port Sharing                              NET-WCF-TCP-PortSharing45    Installed
SMB 1.0/CIFS File Sharing Support             FS-SMB1                      Installed
Telnet Client                                 Telnet-Client                Installed
User Interfaces and Infrastructure            User-Interfaces-Infra        Installed
Graphical Management Tools and Infrastructure Server-Gui-Mgmt-Infra        Installed
Server Graphical Shell                        Server-Gui-Shell             Installed
Windows PowerShell                            PowerShellRoot               Installed
Windows PowerShell 4.0                        PowerShell                   Installed
Windows PowerShell ISE                        PowerShell-ISE               Installed
WoW64 Support                                 WoW64-Support                Installed

 

NOTES:

  • Use https://api.wordpress.org/secret-key/1.1/salt/ to generate your Salt Keys… After they have been generated, you must replace any “$” character with any other character. Not just this script, but WordPress will not work if there is a “$” character in the salt keys.
  • You will be asked for some variables, they are as follows:
Variable Example
IIS Site Name MyWordpressSite.com
IIS App Pool Name MyWordpressSite.com
Directory Path for website C:\inetpub\wwwroot\MyWordpressSite
Database Name wordpress612
Database Username wordpressuser612
Database Password mysecretpassword612
MySQL root Password v9gvBhTG@*b6n#^!v
FTP Username FTPUser
FTP Password FTPPass123!
  • You can download check out the progress of the script on my Github and you can download it with the following icon:

ps1_Icon

Now for the Script

<# 

    .SYNOPSIS
    Install a new WP site with all pre-reqs using pre-set variables. Can be used for additional sites.
    
    .DESCRIPTION
    This script will create a WordPress site with known-working configurations.
    Script can also be used to add additional sites as checks are in place. 
    To customize site, update custom variables as desired. 
    CAUTION - this script will overwrite a current site
        
    .OUTPUTS  
    A new wp site ready for your configuration! ;-)
     
    .NOTES
    Author: Michael Groff
    Minimum OS: 2012, 2012 R2
    PS Version: 4.0
    Date:  1/12/17
    
#>

#Checking Powershell Version

$LocalPSVers = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine\").PowerShellVersion | Where-Object {$_ -gt "4"}

IF (-not$LocalPSVers)
{
    Write-Host "
You need to upgrade to atleast PS Verion 5 before running this script!
" -ForegroundColor Red
    Read-Host "Press enter to exit"
    BREAK
}
ELSE
{
    Write-Host "
Correct Powershell Version found, you are good to go!
    " -ForegroundColor Green
}

###
###Variables Start: 
###
#Site Name, must inclue the TLD (.com, .info, .net, etc.)
Write-Host "
The website name, must inclue the TLD (.com, .info, .net, etc.)
" -ForegroundColor Yellow
$iisAppName = Read-host -prompt "Enter the website name"
#IIS App Pool Name: 
Write-Host "
The iis app pool name, can be same as website
" -ForegroundColor Yellow
$iisAppPoolName = Read-host -prompt "Enter the iis app pool name, can be same as website"
#Site Path
Write-Host "
The suggested website root directory path is 'C:\inetpub\wwwroot\MyWordpressSite'
" -ForegroundColor Yellow
$directoryPath = Read-host -prompt "Enter the Website root directory path"
#Database Name
Write-Host "
The WordPress Database is a MySQL Database
" -ForegroundColor Yellow
$dbn = Read-host -prompt "Enter the WordPress Database Name"
#Database Username
Write-Host "
The WordPress Database User is a MySQL User
" -ForegroundColor Yellow
$dbun = Read-host -prompt "Enter the WordPress Database Username"
#Database User Password
Write-Host "
The WordPress Database Password should be a strong password, minimum 12 characters
" -ForegroundColor Yellow
$dbpw = Read-host -prompt "Enter the WordPress Database User Password"
#MySQL root password
Write-Host "
The  MySQL root password, this will create one if it doesnt exist
" -ForegroundColor Yellow
$MySQL = Read-host -prompt "Enter the MySQL root password"
#Salt Keys - https://api.wordpress.org/secret-key/1.1/salt/ (NOTE: Replace any $ that you see with another character!)
#Authentication Key
$AuthKey = "ry=,b*Gp,+1-voDYM`zq#:S_^ODN Lp9:_:&D5o6C%0SXsyi

		
]]>
WordPress on IIS 8.5 (Windows 2012 R2) /blog/wordpress-iis-8-5-windows-2012-r2/ /blog/wordpress-iis-8-5-windows-2012-r2/#comments Sun, 24 Jan 2016 05:11:12 +0000 /blog/?p=43

The Manual Installation and Configuration of WordPress and all accompanying components on Windows Server 2012 R2

WordPress “Requirements”

  • PHP 5.6 or greater
  • MySQL 5.5 or greater
  • The mod_rewrite Apache module

– You can find the requirements more depth directly from the WordpPress page: WordPress Requirements

We are going to use:

  • WordPress Version 4.3.1
  • PHP 5.4
  • MySQL 5.5
  • IIS URL Rewrite
NOTE: This tutorial assumes you have turned off IE Enhanced Security and Enabled downloads in IE
And that you have set up DNS correctly or modified your hosts file with your domain name

Prep

Windows Roles and Services

First we need to install the proper Windows Roles and Services, some IIS add-ons and MySQL

Roles:

  • Web Server (IIS) – Add features that are required and Include management tools (if applicable)

Features:

  • .NET Framework 3.5 Features – Add features that are required and Include management tools (if applicable) – Note: this includes .net 2.0 for PHP Manager that we will install later
  • SMTP Server – Add features that are required and Include management tools (if applicable) *This will not be covered
  • Telnet Client (you dont need it for wordpress, but you should always have this installed for testing)

Role Services for IIS: (leave the default and add the following)

  • Health and Diagnostics:
    • Logging Tools
    • Request Monitor

Wordpress Installation 1

 

  • Application Development:
    • ASP.NET 4.5 – Add features that are required and Include management tools (if applicable)
    • CGI

Wordpress Installation 2

IIS add-ons (PHP, URL Rewrite,

Open IIS, click on your server, and a pop-up box will ask you if “…you want to get started with Microsoft Web Platform…” Click Yes, then proceed to download and install the Web Platform Installer.

Wordpress Installation 3

Close IIS and the re-open it, now you will see the Web Platform Installer

Wordpress Installation 4

Open the Web Platform Installer and Install the following:

  • PHP 5.4.24, this will install:
    • Microsoft Drivers 3.2 for PHP v5.4 for SQL Server in IIS
    • IIS Manager
  • URL Rewrite

Wordpress Installation 5

Click Finish and close IIS as we are done with that for now.

MySQL

Now we are going to Download & Install MySQL 5.5.45 and MySQL Workbench.

NOTE: If you know how to run mysql from the command line, the more power to you, this is for Windows. We are going to use a feature of my sql that incorporates a windowed GUI, hence the name

Links to Downloads: MySQL Server & MySQL Workbench

First install MySQL 5.5.45 and at the end of the installation, leave the box checked and you will enter the Instance Configuration.

Choose the Standard Configuration option, click Next

Wordpress Installation 6

Choose the Install As Windows Service option, name it, and then click Next

Wordpress Installation 7

Set your root password and click Next

Wordpress Installation 8

Last click Execute

Wordpress Installation 9

Now to install MySQL Workbench. I will let you figure this one out. Hint: Download the prerequisites.
At the end of the install, make sure you launch MySQL Workbench before you click Finish

WordPress

Download WordPress and unzip it to C:\inetpub\wwwroot, so you should see the following:

Wordpress Installation 10

That concludes the prep for a WordPress site to be built, now we need to start the actual configurations.

Configuration

IIS Configuration

Create a new website in IIS, and fill out the fields appropriately:

  • Site Name: MyDomain WP Site (arbitrary, just make it identifiable)
  • Physical path: C:\inetpub\wwwroot\wordpress (the folder we extracted earlier)
  • IP address: Depends on the IP’s on your server, I have one so all unassigned is fine.
  • Host name: www.mydomain.com

Wordpress Installation 11

Add in an additional binding for non-www: http, All Unassigned, Port 80, and mydomain.com

Wordpress Installation 24

Move the Default Document for index.php to the to of the list:

Wordpress Installation 12

Create a URL Rewrite rule as follows:

  • Rule Name: WordPress (or whatever you want, this is arbitrary)
  • Match URL:
    • Requested URL: Matches the Pattern
    • Using: Wildcards
    • Pattern: *

Wordpress Installation 13

  • Conditions:
    • Is Not a File
    • Is Not a Directory

Wordpress Installation 14

  • Action:
    • Action type: Rewrite
    • Rewrite URL: index.php
    • Append Query String: Check

Wordpress Installation 15

Create another URL Rewrite rule as follows:

  • Type: Canonical domain name
  • Select the primary host name: www.mydomain.com

After both rules have been entered, your URL Rewrites should look similar to the following:

Wordpress Installation 16

Additional, recommended configutations:

  • Stop your site, there is no reason to have it running.
  • Set up Recycling for App Pool:
    • Time: 4:00 AM (or whenever your site is least active, and remove the check for Regular Time Intervals)
  • Edit PHP.ini file (C:\Program Files (x86)\PHP\v5.4\php.ini):
    • Old Line: post_max_size = 8M
      • New Line: post_max_size = 1024M
    • Old Line: ;upload_tmp_dir =
      • New Line: upload_tmp_dir = C:\inetpub\temp
    • Old Line: upload_max_filesize = 2M
      • New Line: upload_max_filesize = 1000M
    • Old Line: max_file_uploads = 20
      • New Line: max_file_uploads = 200
    • Add Modify Permission the C:\inetpub\temp

 

MySQL Configuration

Open MySQL and log into the instance we created previously.

First thing you will want to do is change the default character-set-server variable to UTF8 as UTF-8 supports any language.

Wordpress Installation 17

Restart MySQL for the settings to take, or just make sure you manually set the collation of you DB to UTF8 in the next step. (Powershell command: Restart-Service MySQL)

Next we are going to create your WordPress Database.

Right-click on the blank space under the test DB and choose Create Schema…

Wordpress Installation 18

Give your Schema/DB an appropriate name, I will use mydomainwpdatabase

Wordpress Installation 19

Next, create a user for that database. I will use mydomainwpdbuser, and give that user full permissions to the Schema/DB that you just created. It will look similar to the following:

Wordpress Installation 20

Wordpress Installation 21

And that concludes the database configuration, we are almost done, just a couple more steps.

WordPress Connection Configuration

Navigate to C:\inetpub\wwwroot\wordpress and copy your wp-config-sample.php in the same folder, then rename it wp-config.php

Then you will need to make the following changes to that file to allow your WP site to connect to the database.

========================================

// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘mydomainwpdatabase‘);

/** MySQL database username */
define(‘DB_USER’, ‘mydomainwpdatabaseuser‘);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘mydomainwpdatabaseuerpsswd‘);

/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);

/** Database Charset to use in creating database tables. */
define(‘DB_CHARSET’, ‘utf8’);

/** The Database Collate type. Don’t change this if in doubt. */
define(‘DB_COLLATE’, ”);

========================================

WordPress Login

You are ready to start your site, navigate to IIS and start it up (or restart it, if it has been up this whole time). Then browse to the site in IE and set up the admin creds as you see fit.

Wordpress Installation 22

You are done!    Just log into your site and start configuring your new WordPress Site.

Wordpress Installation 23

Additional Setup for WP

Suggested WP Plugins

Suggested WP Settings Changes

Settings > General Settings

  • Site Title
  • Tagline
  • Membership
  • Timezone

Settings > Discussion

  • Deselect – 

Settings > Permalinks

  • Common Settings > Post name (or whatever makes the most sense for your site)

 

]]>
/blog/wordpress-iis-8-5-windows-2012-r2/feed/ 1