{"id":149,"date":"2011-01-07T15:07:34","date_gmt":"2011-01-07T20:07:34","guid":{"rendered":"http:\/\/www.amixa.com\/blog\/?p=149"},"modified":"2011-01-07T15:14:58","modified_gmt":"2011-01-07T20:14:58","slug":"wordpress-windows-2008-web-server-r2-iis-7-5-setup","status":"publish","type":"post","link":"https:\/\/www.amixa.com\/blog\/2011\/01\/07\/wordpress-windows-2008-web-server-r2-iis-7-5-setup\/","title":{"rendered":"WordPress Windows 2008 Web Server R2 IIS 7.5 setup"},"content":{"rendered":"<p>I thought I would share a few important tips on getting WordPress 3.x to work properly &#8211; with PERMALINKS \/ SEO friendly URL&#8217;s.\u00a0 It&#8217;s taken me a lot of trial and error to figure out the finer points, but assuming you can get it installed, these tips should help you get it 100% functional.<\/p>\n<ol>\n<li>to install, use the Microsoft Platform Installer 2.0, and let it do the work of installing PHP, WordPress etc.\u00a0 IT IS FANTASIC!!! It will automatically setup PHP\/FASTCGI for you and it is slick!\u00a0 You can access the direct link to install WordPress on IIS here <a href=\"http:\/\/www.microsoft.com\/web\/wordpress\/\">http:\/\/www.microsoft.com\/web\/wordpress\/<\/a><\/li>\n<li>Secondly, I am going to make an assumption you are installing this as a subdirectory on your root site, such as <span style=\"text-decoration: underline;\"><strong><em>www.mysite.com\/blog<\/em><\/strong><\/span>.\u00a0 If you are installing this to the root the same directions will basically apply but you&#8217;ll need to figure out which setting will need to be adjusted to put WP on the root.<\/li>\n<li>Third, we use a dedicated MySQL 5.x box, so we don&#8217;t install MySQL as part of the MPI 2.0 install (from step 1).\u00a0 If you don&#8217;t already have a MySQL server you&#8217;ll need to let it install that as well, or make a new empty database on your MySQL box and use that info as part of the install process.\u00a0 For security and speed reasons, a dedicated server for MySQL is the best choice, but not everyone has the resouces to permit a dedicated server.<\/li>\n<li>Under IIS 7.0 or 7.5, make sure you have downloaded and installed the free URL REWRITE 2.0 add-in for IIS.\u00a0 This is a free download here: <a href=\"http:\/\/www.iis.net\/download\/urlrewrite\">http:\/\/www.iis.net\/download\/urlrewrite<\/a><\/li>\n<li><strong><em>PERMALINKS<\/em><\/strong>.\u00a0 Once you get WP installed and are able to login to the admin interface, it&#8217;s pretty simple to get permalinks running.\n<ol>\n<li>in the WP admin, go to SETTINGS-&gt;Permalinks.\u00a0 We chose to use the &#8220;DAY AND NAME&#8221; setting.\u00a0 Any other setting is your choice.\u00a0 Pick a setting and click save changes.<\/li>\n<li>make sure you have a web.config file in your \/blog\/ subdirectory.\u00a0<\/li>\n<li>here is what your web.config file should look like &#8211; customized just for WP 3.0 in the \/blog\/ subdirectory (below).\u00a0 (Download a ZIPPED copy of my file <a title=\"copy of my web.config for WP\" href=\"http:\/\/www.amixa.com\/blog\/wp-content\/uploads\/2011\/01\/web.zip\" target=\"_blank\">here<\/a>)<\/li>\n<li>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br \/>\n&lt;configuration&gt;<br \/>\n\u00a0 &lt;system.webServer&gt;<br \/>\n\u00a0\u00a0\u00a0 &lt;httpErrors errorMode=&#8221;Custom&#8221; \/&gt;<br \/>\n\u00a0\u00a0\u00a0 &lt;rewrite&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;rules&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0&lt;rule name=&#8221;Main Rule&#8221; stopProcessing=&#8221;true&#8221;&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0&lt;match url=&#8221;.*&#8221; \/&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0&lt;conditions logicalGrouping=&#8221;MatchAll&#8221;&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0&lt;add input=&#8221;{REQUEST_FILENAME}&#8221; matchType=&#8221;IsFile&#8221; negate=&#8221;true&#8221; \/&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0&lt;add input=&#8221;{REQUEST_FILENAME}&#8221; matchType=&#8221;IsDirectory&#8221; negate=&#8221;true&#8221; \/&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0&lt;\/conditions&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0&lt;action type=&#8221;Rewrite&#8221; url=&#8221;index.php&#8221; \/&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/rule&gt;<br \/>\n\u00a0\u00a0\u00a0&lt;\/rules&gt;<br \/>\n\u00a0\u00a0\u00a0 &lt;\/rewrite&gt;<br \/>\n\u00a0\u00a0\u00a0 &lt;defaultDocument&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;files&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;clear \/&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;add value=&#8221;index.php&#8221; \/&gt;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/files&gt;<br \/>\n\u00a0\u00a0\u00a0 &lt;\/defaultDocument&gt;<br \/>\n\u00a0 &lt;\/system.webServer&gt;<br \/>\n&lt;\/configuration&gt;<\/li>\n<li>Save this into your web.config file &#8211; this is all you need for WP running in the \/blog\/ directory.\u00a0 Once you replace your file with this one your permalinks should work flawlessly.<\/li>\n<\/ol>\n<\/li>\n<li><strong><em>Troubleshooting<\/em><\/strong>.\u00a0 One easy way to troubleshoot things with your WP install, is to enable DETAILED errormode.\u00a0 To do this, edit your web.config file within the \/blog\/ folder and change just the one line above to this <strong>&lt;httpErrors errorMode=&#8221;Detailed&#8221;\/&gt;<\/strong>\u00a0 Of course when you are all done and going live with WP, change that line back to &#8220;Custom&#8221;<\/li>\n<li>Fixing permissions so that images\/media\/files uploaded\u00a0via WordPress will properly render.\u00a0 This is the fix for the infamous &#8220;500&#8221; error that is thrown when your server has wrong file permissions and the visual result is all the images you uploaded are &#8220;broken images&#8221; and won&#8217;t display.\u00a0Also called <strong>HTTP Error 500.50 &#8211; URL Rewrite Module Error<\/strong> when you have Detailed errors on.\n<ol>\n<li>Don&#8217;t sweat it, I will save you HOURS of time on this one.\u00a0 \u00a0Thanks to the article I found <a href=\"http:\/\/www.howyoudo.info\/index.php\/how-to-fix-windows-server-upload-file-inherit-permissions-error\/\" target=\"_blank\">here<\/a>\u00a0after HOURS of tracking this issue down, this problem is caused because PHP first uploads the document to a temporary directory (by default C:\\Windows\\Temp), and then moves it from that directory to the actual \/blog\/wp-content\/uploads\/ subdirectory.\u00a0 What happens is that because IIS does not have any permissions to your &#8220;C:\\Windows\\Temp&#8221; directory, when the file is uploaded there, then moved by PHP, the file inherits NO permissions.\u00a0 So when IIS trys to serve out that file from your \/blog\/wp-content\/uploads\/subdirectory it throws a 500 error and that is actually a permissions error.<\/li>\n<li>The solution:\u00a0 on the Windows\\Temp folder, grant &#8220;modify&#8221; permissions to both IUSR and {servername}\\IIS_IUSRS user accounts.\u00a0<\/li>\n<li>Now when you upload files via PHP and PHP moves them to the correct directory, the files will have the correct permissions and can be accessed.<\/li>\n<li>Important note #1:\u00a0 If you already have uploaded files and are getting the dreaded broken images issue, go to the \/blog\/wp-content\/uploads\/directory and replace\/update the permissions to add access for both user accounts noted above.\u00a0 That will solve that issue.<\/li>\n<li>Important note #2: as with any change off the defaults for Windows, you do this AT YOUR OWN RISK.\u00a0 It&#8217;s up to you if you want to grant the Windows\\Temp directory permissions for those two accounts.\u00a0 If you don&#8217;t PHP won&#8217;t be able to upload without the 500 issue (unless you move the PHP temp folder elsewhere and grant those accounts access to the other folder).\u00a0 Do these changes at your own risk&#8230; I cannot and won&#8217;t take any responsiblity for your systems.\u00a0 Please know what you are doing.<\/li>\n<\/ol>\n<\/li>\n<li>Another site with good info on\u00a0WordPress\/IIS installs is <a href=\"http:\/\/wordpress.haroldkip.nl\/\" target=\"_blank\">here<\/a><\/li>\n<\/ol>\n<p>Best of luck on your Windows 2008 R2 IIS 7.5 WordPress install. We use it here and it is fantastic!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I thought I would share a few important tips on getting WordPress 3.x to work properly &#8211; with PERMALINKS \/ SEO friendly URL&#8217;s.\u00a0 It&#8217;s taken me a lot of trial and error to figure out the finer points, but assuming you can get it installed, these tips should help you get it 100% functional. to install, use the Microsoft Platform<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,22,41],"tags":[44,5,8,43,42],"class_list":["post-149","post","type-post","status-publish","format-standard","hentry","category-iis-tips-n-tricks","category-windows-server","category-wordpress-tips","tag-http-error-500-50","tag-iis","tag-microsoft-windows-server","tag-php","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/posts\/149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/comments?post=149"}],"version-history":[{"count":7,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/posts\/149\/revisions"}],"predecessor-version":[{"id":152,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/posts\/149\/revisions\/152"}],"wp:attachment":[{"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/media?parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/categories?post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/tags?post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}