How to Install nginx and PHP on CentOS7

Install nginx and PHP on CentOS7

These are some notes from installing nginx on CentOS7

Install some prerequisites sudo yum -y groupinstall “Development tools” sudo yum -y install mlocate sudo yum -y install iptables-services sudo yum -y install php-mysql php-dom sudo yum -y install wget sudo service php-fpm restart Install GeoIP cd /tmp wget . . . → Read More: How to Install nginx and PHP on CentOS7

iis disable debug

In IIS to disable debug do the following.

Modify the Web.config File Open the Web.config file in a text editor such as Notepad.exe. Web.config file is typically located in the application directory.

Modify the compilation element and set debug=”false”

<compilation debug=”false” />

Save the Web.config file. The ASP.NET application automatically restarts.

Modify the Machine.config file . . . → Read More: iis disable debug

diff two files and output lines not seen in file 2


You need two diff two files and only output what is unique to file one.

text file 1 contains:

1 2 3 4 5

text file 2 contains:

6 7 1 2 3 4 Solution $ awk ‘FNR==NR{a[$0]++;next}!a[$0]‘ file1 file2 6 7

Explanation of how the code works:

If we’re working on file1, track . . . → Read More: diff two files and output lines not seen in file 2

Using lzop on Windows

I wanted a fast way to backup an AppDynamics MySQL database directory on windows. The answer was lzop.

Tools GoW 0.8.0 (GNU on Windows) lzop for Windows Setup Set your Enviornment PATH

After installing GoW and extracting lzop.exe set your environment PATH to include the directory where you extracted lzop.exe

Stop AppDynamics Controller and Database . . . → Read More: Using lzop on Windows

Active Directory Password Expiration Date

To find out the password expiration date for an Active Directory user you must first determine your domain’s password expiration policy and then when the password was last set.

Find your Domain Password Expiration Policy import-module activedirectory Get-ADDefaultDomainPasswordPolicy

Property MaxPasswordAge will tell you the default password expiration policy

Determine Date User Password Was Last Set . . . → Read More: Active Directory Password Expiration Date

IIS7 SNI Rewrite – Howto


Windows XP Users with IE8 are unable to connect to your Server Name Indication (SNI) enabled Amazon CloudFront distribution.


Do not rewrite URLs to CloudFront if the user agent indicates a system that does not support SNI.

Example (IIS 7)

Be sure to have the URL Rewrite module installed

URL Rewrite rule precondition . . . → Read More: IIS7 SNI Rewrite – Howto

iis7 insert rewrite rule web.config

To insert a rewrite rule in to a web.config for deployment purposes you need to modify Web.Release.Config

Example <system.webServer> <rewrite xdt:Transform=”Insert”> <outboundRules> <rule name=”Add Cross Origin Access”> <match serverVariable=”RESPONSE_Access_Control_Allow_Origin” pattern=”.*” /> <conditions> <add input=”{REQUEST_URI}” pattern=”.*\.(ttf|otf|eot|woff|svg)\?*.*$” /> </conditions> <action type=”Rewrite” value=”*”/> </rule> </outboundRules> </rewrite> </system.webServer>

Cloudfront IIS7 CORS Fix


You keep getting Control Allow Origin errors on fonts that are pulling from your CloudFront CDN


You need to make changes at CloudFront and your IIS 7 Server

CloudFront Changes

Modify the origin behaviors:

Navigate to the CloudFront Distributions Panel Select your Distribution Click Behaviors Tab Select Behavior from list items Click Edit . . . → Read More: Cloudfront IIS7 CORS Fix

iis 7.5 The format of the specified network name is invalid – IIS Error 0x800704BE

Problem IIS 7.5 is holding on to an IP and you cannot get it to listen to the right IP.

You might see this error message:

The format of the specified network name is invalid – IIS Error 0x800704BE Solution

You will need to remove and add the listening ip via netsh (see below)

Determine . . . → Read More: iis 7.5 The format of the specified network name is invalid – IIS Error 0x800704BE

backup perfmon counters

How to backup your perfmon counters

The easiest way to backup your perfmon counters is to use the lodctr tool


Registers new Performance counter names and Explain text for a service or device driver, and saves and restores counter settings and Explain text.

Syntax lodctr [\\ComputerName] FileName [/s:FileName] [/r:FileName] Example lodctr /s:”perf backup1.txt” . . . → Read More: backup perfmon counters