Solved

IIS 7.5 on Windows 7 Pro x64 adding web.config to my Wordpress Directories and failing.

Posted on 2013-01-22
14
614 Views
Last Modified: 2013-02-10
IIS 7.5 on Windows 7 Pro x64 is adding the following as a web.config file and is failing when I try and import a site using importbuddy.php (part of BackupBuddy.php).

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <defaultDocument>
      <files>
        <clear/>
        <add value="index.php"/>
        <add value="Default.htm"/>
        <add value="Default.asp"/>
        <add value="index.htm"/>
        <add value="index.html"/>
        <add value="iisstart.htm"/>
        <add value="default.aspx"/>
      </files>
    </defaultDocument>
    <rewrite>
      <rules>
			<rule name="wordpress" patternSyntax="Wildcard">
				<match url="*"/>
					<conditions>
						<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
						<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
					</conditions>
				<action type="Rewrite" url="index.php"/>
			</rule></rules>
    </rewrite>
  </system.webServer>
</configuration>

Open in new window



Here is the error I get....

Error 500.19
0
Comment
Question by:asciiassasin
  • 8
  • 6
14 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 38808428
According to this http://ithemes.com/codex/page/BackupBuddy ,  BackupBuddy is not supported on IIS.  Apache only.
0
 

Author Comment

by:asciiassasin
ID: 38808461
I got it to work by using Microsoft's Webmatrix to install WordPress and its dependencies.  After install WP that way, importbuddy worked great.

But, I HATE using apps like Webmatrix.  They always make the job MORE difficult by hiding what is being done.  After running such an app, you have a working local website, but you're clueless as to why it works or what needed to be done to make WP work on IIS 7.5 .

I think I'd rather be frustrated and learning than up and running and stupid.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 38808465
I'm glad you found a way.  And I understand how you feel but sometimes the details are too many to easily make something work.  It also makes it so you don't know what to do if it breaks.
0
 

Author Comment

by:asciiassasin
ID: 38808626
That's exactly what I hate about it.  It also seems to be limited to running a single website.  I cannot find anything that tells me how to add a second site to Webmatrix.

Then there is the fact that Webmatrix does NOT use the most up to date versions of things like PHP.  I am using version 5.5.24 on my server, but Webmatrix installs 5.3.13.  I am not comfortable running a different version of PHP or MySQL on my dev and server machines.

Webmatrix even installs WordPress 3.4 when 3.5 (with a few security additions) has been out for months.

Unfortunately, the documentation for using WordPress with IIS 7.5 on Windows 7 Pro is a scarce as hens teeth.  It took me over a week to figure  it all out on Windows Server and document the process.  I had hoped I wouldn't have to go through that on Windows 7 Pro.

There needs to be a guide that walks you step-by-step throught installing IIS 7.5, PHP, MySQL and WordPress (including running multiple sites) on a local developer box like Windows 7 Pro.

I HATE not knowing what is going on in the background.  I have everything working on a Windows 2008 R2 dedicated server, so maybe I'll try those same instructions on Win 7 and see what happens.
0
 

Author Comment

by:asciiassasin
ID: 38808667
OK, I figured out how to add another website (File > New > Site From Application Gallery).  Why isn't there a simple New Site button on the ribbon?

Also not intuitive...to change sites (you cannot see all sites on your local dev box at once like you can in IIS Manager), you need to go to File > Open > My Sites  then choose the site you want to work with.  Again...wouldn't having all sites in a simple treeview control be more intuitive?

Webmatrix does have some neat stuff.  One extension lets you see your site in an iPhone interface.   Another let's you view it in iPad or Windows Phone 7 and it has built-in PHP and HTML/CSS editing.   But there is no Win Phone 8 extension that I see - which again makes me think this is just another app that Microsoft is not committed to and will toss as soon as I get used to it.

Webmatrix is obviously NOT being maintained properly by Microsoft (installing out of date components is not a sign of a properly maintained app), so how long before they kill the damned thing outright?

The big plus is that I don;t have to spend DAYS figuring out how to properly set up IIS permissions for PHP and  WordPress.  But, I'm not sure it's worth the ignorance that Webmatrix encourages.

Then again, WordPress is built for use with Linux, Apache, nginx, PHP and MySQL.  So, perhaps I should create myself a VM of Ubuntu (or CentOS or Debian) server and try setting WordPress up like it should be set up.

The only problem with that is that I would need to shutter my Windows 2008 server and start up a Linux server.  Since I've never really "done" Linux, I am a little worried that I may really screw up something and take some of my clients' sites down while I learn how to run a proper Linux server.

Hmmmmmm........
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 38808802
It looks like you have most of it figured out.  I never look for the most current version of PHP but the version that is on the hosting I'm going to use.  The current production versions are PHP 5.4.11 and PHP 5.3.21.  PHP 5.5.0 is not ready for production.  I only worry about the major versions (5.2, 5.3, 5.4) because the minor numbers are bug fixes that rarely affect what I'm doing.  All the major functions are there in all versions.

But there are some differences in the 'major' versions.  If you are going to use (for example) Microsoft SQL Server, you would find that the driver changes from PHP 5.2 (mssql) to PHP 5.3 (sqlsrv 1 or 2) to PHP 5.4 (sqlsrv3).

Linux is not as demanding as Windows as far as hardware.  I would (did) put it on another machine.  Last years machine will work just fine as long as there is driver support.  I have Ubuntu 8.04 running on 10 year old machines and the web part of it is plenty fast enough because the web server just delivers file and does not render images.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 38808804
Also, there is a lot of web hosting running PHP 5.2.17 (Godaddy) and some even still on PHP4 with MySQL3/4.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:asciiassasin
ID: 38823351
I finally figured out how to set up IIS 7.5 on Win7 Pro x64.  I had to do it manually and I used my Server 2008 setup instructions to get most of it done.  There were a couple of things that were different, but - for the most part - everything was the same.

I should clean up my instructions and put them out for others to use when I get a chance.

I was trying to use BAckupBuddy to import my live site to my laptop and I had a problem with the web.config file IIS put out on the server.  As soon as I changed it's name to web.config.old, I could use the site locally.  

If anyone knows why IIS writes that file out to the website directory and why it is needed, I'd love to know.  Maybe there is something I can disable to prevent this from even being an issue in the future.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 38823366
'web.config' is where... the web configuration details are kept for a site on IIS 7.  But it's more oriented toward ASP.NET although I have had to add some things so that error messages would be displayed.  If you have multiple web sites running on a single IIS server, each one would normally have it's own copy of 'web.config' in it's web root directory.

You may have to add at least part of it back before you're done.
0
 

Author Comment

by:asciiassasin
ID: 38825271
So, I should be able to turn off ASP.Net on the server and not see these files in my WordPress directories?

Currently I am doing no ASP.Net or ASP programming on that server.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 38825427
I don't think that turning off ASP.NET will prevent those files.  Seems like all the set up on current versions of servers is in XML format which has nothing to do with ASP.NET.  I suspect that BackupBuddy just wanted some specific feature that was blocked.

On my IIS7 hosting on Godaddy, I have a very simple 'web.config' file but that is just for my directories.  The main web server may have a more detailed one that I can't see.

Some of the programs for the server may be using ASP.NET.  In all my instances of IIS, some version of .NET framework is installed and at least available.  I would not turn ASP.NET off if everything is working for you.

Classic ASP is not running on IIS7 unless you actually installed it.  It is not installed by default.

Here is my entire web.config file on Godaddy.  I had to edit it to get error messages to be sent to the browser instead of just getting '500' on everything.
<?xml version="1.0"?>
<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>
    </system.webServer>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true"/>
    </system.web>
</configuration>

Open in new window

0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 38825429
For what it's worth, I just checked another site that I maintain on IIS7 and there isn't any 'web.config' file there.  It's all PHP code.
0
 

Author Comment

by:asciiassasin
ID: 38833307
Here is my web.config file's contents....

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <defaultDocument>
      <files>
        <clear/>
        <add value="index.php"/>
        <add value="Default.htm"/>
        <add value="Default.asp"/>
        <add value="index.htm"/>
        <add value="index.html"/>
        <add value="iisstart.htm"/>
        <add value="default.aspx"/>
      </files>
    </defaultDocument>
    <rewrite>
      <rules>
			<rule name="wordpress" patternSyntax="Wildcard">
				<match url="*"/>
					<conditions>
						<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
						<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
					</conditions>
				<action type="Rewrite" url="index.php"/>
			</rule></rules>
    </rewrite>
  </system.webServer>
</configuration>

Open in new window


Not sure if any of this stuff is needed or not.  The website is running fine on IIS 7.5 on Win 7 Pro x64 without it.
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 38833389
Here is the 'official' reference: http://www.iis.net/configreference   One think I hadn't noticed before is that 'web.config' is a local or per-site file that can be used to override statements in the main config files.  Kind of like 'htaccess' on Apache.  Basically, if everything works without it, you don't have to have it.

Note: Some settings can be delegated to Web.config files, which may override settings in the ApplicationHost.config file. In addition, settings that are not delegated cannot be added to Web.config files.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Who says nothing in life is free? WordPress.com is a freebie. WordPress.org's downloadable publishing platform is free. Heck, even WordPressMU is free. WordPress is an open source project, which means it can be used on any personal or commerc…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now