Install – Michael Groff /blog Expand or Die Wed, 12 Dec 2018 16:14:03 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 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
Install and Setup Plex on FreeNAS /blog/install-and-setup-plex-on-freenas/ Tue, 30 Jun 2015 08:11:41 +0000 /blog/?p=227

NOTE: This how-to assumes that you have set up you FreeNAS installation according to the instructions shown in my tutorial: Install and Setup FreeNAS on Dell CS24-SC

Setting up a Share

First we are going to need to set up a share(I did cover this in my Install and Setup FreeNAS on Dell CS24-SC tutorial, so you can skip if you already followed that).

NOTE: I have chosen to use CIFS, as I am going this from a Windows Machine.

Navigate to your FreeNAS IP and login, then expand “Services” on the side and click on “CIFS” and it will bring up the following:

FreeNas Install16

You can choose what to put in all these fields, just make sure you check and IP to bind it to at the bottom. Next go back to the left side of the screen and click on “Control Services” under the “Services” section.

FreeNas Install17

Here you will need to turn “CIFS” on. Now we will need to add a CIFS share onto FreeNAS, first expand “Sharing” then expand “Windows (CIFS) Shares” and click on “Add Windows (CIFS) Share
FreeNas Install18

I am choosing to share the root of my “Volume0” and I decided to name the share “FreeNASROOT

After this is done bring up Windows Explorer and verify that you can access the share. For me I had to type in \\FreeNAS or \\192.168.0.91 in my explorer bar. Once it connected I saw the share “FreeNASROOT” and when i selected that I was asked for creds to access the share, enter the root creds you use to log into the WebGUI as we have not created any users at this time.

FreeNas Install24

**I am not covering users and user permissions in this how-to, but it is pretty simple and you should always create a user so you are not doing everything as the root user**

Installing Plex

FreeNAS makes this pretty damn easy. Simply click on the “Plugins” tab and wait for it to load.

Once its loaded you will see something along the lines of the following:

FreeNas Install19

Here you need to scroll down to “PlexMediaServer” select it, then click “Install” at the bottom of the page. You will get a popup notification that reads “Are you sure you want to install “PlexMediaServer” plugin?” Click “OK” and it will proceed with the install and configurations.
Now we need to configure what IP Plex will listen on. You can do this by expanding the “Jails” tab and then expand “plexmediaserver_1” and now click “edit

FreeNas Install21

Go ahead and give it an IP that will work for you. And now click on the “Installed” tab on the Plugins page and you will see the following:

FreeNas Install20

The only difference between what you see and the image above is that your Plex will be powered off (red). Go ahead and turn it on (blue). Note that you may get “some error occurred” when you try to do this. That is bc we just changed the Jail IP. Go ahead and reboot the box if that is the case. After it powers back up, navigate back to the page above and power Plex on. Once it is on you can go to the following address: (change the IP with the IP of your Plex Jail)
http://192.168.0.93:32400/web/index.html
You can also get here by refreshing your page, then expand the plugins tab and select Plex Media Server as seen in the following screenshot:

FreeNas Install22

In the popup window click on the “here” link and that will bring up Plex! You did it, you installed Plex successfully!

Now we just have to configure it so you can see your movies on there.

Configuring Movies with Plex

Once you browse to http://192.168.0.93:32400/web/index.html your screen should look like this:

FreeNas Install23
Before we can tell what movies Plex to look at, we first have to add a movie, or movies, to our FreeNAS Share we set up. So, go ahead and navigate back to your Share in explorer and add a folder called “Movies“, then add a Movie into that Folder as shown below:

FreeNas Install25                           FreeNas Install26

We also need to add in a corresponding folder in our freenas jail, to do this, navigate to: \\freenas\FreeNASROOT\jails\plexmediaserver_1\media (if you have named everything as i have here) and add a folder called “Movies“.

FreeNas Install26.1

This is going to act as an alias in the FreeNAS Jail’s storage we are about to configure. So go ahead and open back up your web browser, open up FreeNAS and navigate to Jails on the left hand side, expand everything you can.

FreeNas Install28

…and you should be in the “Add Storage” section of your Plex jail. Go ahead and click on Add Storage. For Source put /mnt/Volume0/Movies or navigate to wherever your movies actually live. And for Destination put /media/Movies

FreeNas Install29

Now go back to Plex and Click on the + (plus) in the upper left, next to the name of your Media Server and you will get something that looks like this:FreeNas Install27

From here you will choose “Movies” and click Next

FreeNas Install30

Click on “Add folders” on the left hand side and choose the alias that we created /media/Movies. Now Plex should auto-update and find the new movie(s), but in case it doesn’t, just click on the gear on the upper left and select “Update Libraries” and there you have it, you can now see your new movie(s) on Plex!

FreeNas Install31

Now that I have gotten you up and running you just have to go look through the Plex settings by clicking on the Wrench and Screw Driver in the upper right hand corner. It’s all pretty straight forward and simple but if you can’t figure it out then google that shit, then if that doesnt work comment and message me and i will see how I can help.

So that’s it, pretty simple install. If I left anything out that you notice or are having any trouble, leave a comment or send me and email on the right hand toolbar

]]>
Install and Setup FreeNAS on Dell CS24-SC /blog/install-and-setup-freenas-on-dell-cs24-sc/ Mon, 15 Jun 2015 06:30:40 +0000 /blog/?p=61

FreeNAS is offered in two ways: Install and support it yourself, as it is a Free/OpenSource Operating System, or invest in a turnkey solution from iXsystems Inc. Their support is great as they built the OS and know how it works best, I would strongly recommend contacting them if you are running FreeNAS as a business solution.

This how-to will cover the basic install and very basic set-up of FreeNAS. FreeNAS has a lot of options and you will set it up pretty uniquely with each option. So for this tutorial I have covered a basic setup and a CIFS/SMB Share. This will allow you to use your FreeNAS server as a Data/File Store.

What you will need

  • 1 – Dell CS24-SC
  • 2 – 8GB Flash Drives
  • LAN Connectivity
  • Keyboard and Monitor – (if you are not going to use BMC)
  • 1 – Windows Computer – (I am using Win7)

FreeNAS USB Stick

Obtain a copy of the FreeNAS ISO.
NOTE: This Guide is using the Build FreeNAS 9.3 Stable

FreeNas Downloads Page

Write the ISO to a USB drive (Use a USB Drive of at least 8GB’s)
– You can do this using Win32 Disk Imager or Rufus

Win32 Disk Imager                        Rufus

**Use the settings you see above in Rufus

Installing FreeNAS

You can also refer to the FreeNAS installation instructions from the developers website found here
I am using 2 separate USB’s for the install, I have found this to be easier as i keep quite a few OS’s on USB sticks at any given time. One is set up as shown above with the ISO mounted to it, and the other one is currently formatted as FAT32, FreeNAS will work fine with this. Attach the ISO drive to the back and the blank drive to one of the front slots.

Boot your CS-24

You can do this from the BMC console which is where I will get the following screenshots come from. You will get the exact some thing when hooking up a monitor and keyboard to your CS-24.

When FreeNAS boots you will see the following screen:

FreeNas Install1

Click “enter” on the one and only option, if you fail to do so FreeNAS will proceed with executing the FreeNAS installation anyway.

Next You will see this screen with four options:

FreeNas Install2

Click “enter” on the first option, Install/Upgrade, and you will get the following screen:
(Note – I used 2 different brand flash drives that were different sizes so it was easy to identify the two)

FreeNas Install3

Here you will select the flash drive that is plugged into the front, by scrolling to it and hitting “space” and then “enter” and you will get the following screen:

FreeNas Install4

Click “enter” on YES here, this is just formatting the drive with the correct permissions for FreeNAS, and you will get the following screen:

FreeNas Install5

Here, enter your password into both fields and click “enter” on OK, then you will see some script run and after a while you will finally get this screen:

FreeNas Install6

Click “enter” to acknowledge that you understand the notification. And this will bring you back to the original screen where you will now choose option 4 Shutdown System

Once the server is off, remove the flash drive from the back of the machine, and move the one from the front to the slot in the back and you are ready to roll. Power that baby on and wait for the install to complete…

Configuring FreeNAS

When your server does finally get done booting for the first time you will see the following screen that will have an IP address on it if your network has DHCP enabled, if not you will have to configure the network settings , which will be covered in the next step:

FreeNas Install7

Now to configure the network chose option and click “enter
Now I am going to be using both NIC’s, you can choose to use just one or the other if you wish, but i have chosen to use both for redundancy reasons, both NIC’s are not necessary.
Now you can set up your network as follows, since I am on the 192.168.0.0/24 Network I will be setting my FreeNAS box accordingly.
You can see my configurations here:

FreeNas Install8                                          FreeNas Install9

Once you have done the steps above, you will come back to the main screen and it will look like the screen below:
(but the IP'(s) listed will be static IP'(s) on your network)

FreeNas Install10
Now you just need to change the root password, do so by selecting option 7 and following the reset password prompts.

FreeNAS GUI Configuration

Now that we have done all the steps for the console configuration we will choose one of the two IP’s above, open a browser from a computer on your local network and navigate to one of those IP’s. When you navigate to either of those IP’s you will see the following login screen:
FreeNas Install11

Type in the username “root” and enter the password that you set up in the previous step. Once logged in you will get the following screen:
FreeNas Install12

*It may not come up directly to this screen, you will likely get a pop-up for the language and time zone, set these accordingly, and you will get another pop-up asking to create volumes, just click exit on this.
Start off by clicking on the “General” tab and you will get this screen:
FreeNas Install13

I chose to bind the WebGUI to my .91 address and I verified my Time Zone was correct here. Now you will want to click on the “Network” tab

FreeNas Install13.1

Here you will want to change your Hostname, add in the Defualt IPv4 Gateway, and the DNS servers. After saving these settings navigate to the “Storage” tab and choose “Volume Manager” and you will see something like this:

FreeNas Install14

Since I am running hardware RAID 10 with 4x120GB’s Hard Drives. You will see Volume settings as above. Your volumes will most likely be different from this, so you have some freedom here to choose what best fits you.

You may have to run the following commands from the shell if your Add Volume fails the first time, there is some trash in the partition table area:
sysctl kern.geom.debugflags=0x10
dd if=/dev/zero of=/dev/ada0
after this runs for about a minute, hit ctrl+C and then go ahead and proceed with setting up the volume.

Once you have configured these settings to your liking click on “Add Volume“. After your volume finishes writing you will see something along the lines of the following:

FreeNas Install15

Now that we have our storage set up, we need to setup access for it. I have chosen to use CIFS, as I am going this from a Windows Machine. Expand “Services” on the left hand side and select the “CIFS” tab. and it will bring up the following:

FreeNas Install16

You can choose what to put in all these fields, just make sure you check and IP to bind it to at the bottom. Next go back to the left side of the screen and click on “Control Services” under the “Services” section.

FreeNas Install17

Here you will need to turn “CIFS” on. Now we will need to add a CIFS share onto FreeNAS, first expand “Sharing” then expand “Windows (CIFS) Shares” and click on “Add Windows (CIFS) Share
FreeNas Install18

I am choosing to share the root of my “Volume0” and I decided to name the share “FreeNASROOT

After this is done bring up Windows Explorer and verify that you can access the share. For me I had to type in \\FreeNAS or \\192.168.0.91 in my explorer bar. Once it connected I saw the share “FreeNASROOT” and when i selected that I was asked for creds to access the share, enter the root creds you use to log into the WebGUI as we have not created any users at this time.

FreeNas Install24

**I am not covering users and user permissions in this how-to, but it is pretty simple and you should always create a user so you are not doing everything as the root user**

]]>