03.11.2016 Views

Beginning ASP.NET 4.5 in CSharp and VB Opsylum

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Runn<strong>in</strong>g Your Site Under IIS x 747<br />

<strong>and</strong> Home Basic versions of W<strong>in</strong>dows 7 <strong>and</strong> 8 ship with some parts of IIS, you can’t run <strong>ASP</strong>.<strong>NET</strong><br />

pages on them, so you need at least the Home Premium edition. On the server-based versions of<br />

W<strong>in</strong>dows, IIS is fully supported. If you’re host<strong>in</strong>g your site with an external host<strong>in</strong>g company, you<br />

can skip the follow<strong>in</strong>g sections on <strong>in</strong>stall<strong>in</strong>g IIS.<br />

NOTE Even though IIS is supported on consumer versions of W<strong>in</strong>dows such as<br />

W<strong>in</strong>dows 7 <strong>and</strong> 8, it doesn’t mean these operat<strong>in</strong>g systems are the best choices<br />

for host<strong>in</strong>g your website. You typically use these versions of W<strong>in</strong>dows for local<br />

development <strong>and</strong> test<strong>in</strong>g, whereas the server versions of W<strong>in</strong>dows (such as<br />

W<strong>in</strong>dows Server 2008 R2 <strong>and</strong> W<strong>in</strong>dows Server 2012) are used for host<strong>in</strong>g production<br />

websites.<br />

To <strong>in</strong>stall <strong>and</strong> configure IIS on your W<strong>in</strong>dows mach<strong>in</strong>e, you need to be logged on as an<br />

Adm<strong>in</strong>istrator. If the account you use to log on to your mach<strong>in</strong>e does not have adm<strong>in</strong>istrative privileges,<br />

you need to ask your adm<strong>in</strong>istrator to <strong>in</strong>stall <strong>and</strong> configure IIS for you.<br />

In addition to <strong>in</strong>stall<strong>in</strong>g IIS, you also see how to create <strong>and</strong> configure the website <strong>in</strong> IIS. Because<br />

of the way security works under W<strong>in</strong>dows, your site probably won’t work immediately after you<br />

configure IIS unless you change some of the security sett<strong>in</strong>gs under W<strong>in</strong>dows. You see how to do<br />

this <strong>in</strong> the section “Underst<strong>and</strong><strong>in</strong>g Security <strong>in</strong> IIS” <strong>and</strong> the Try It Out entitled “Configur<strong>in</strong>g the<br />

Filesystem.”<br />

You’ll be able to test out your IIS sett<strong>in</strong>gs more easily if you already have SQL Server 2012 Express<br />

<strong>in</strong>stalled. This is the case if you followed along with the exercises <strong>in</strong> Chapter 12. If you haven’t<br />

<strong>in</strong>stalled SQL Server 2012 Express yet, refer to the section “Install<strong>in</strong>g SQL Server 2012 Express” <strong>in</strong><br />

Chapter 12 for <strong>in</strong>stallation <strong>in</strong>structions. If you have one of the commercial versions of SQL Server,<br />

or have SQL Server on a remote mach<strong>in</strong>e, pay special attention to the section “Mov<strong>in</strong>g Data to a<br />

Remote Server” <strong>in</strong> this chapter <strong>and</strong> to Appendix B.<br />

Mak<strong>in</strong>g Sure IIS Is Installed<br />

The easiest way to <strong>in</strong>stall IIS is through the Web Platform Installer (WPI). WPI is <strong>in</strong>stalled with<br />

Visual Studio so if you’re carry<strong>in</strong>g out these steps on your development mach<strong>in</strong>e, you already have<br />

the WPI. If you’re follow<strong>in</strong>g these steps on another mach<strong>in</strong>e (runn<strong>in</strong>g W<strong>in</strong>dows Server for example),<br />

you need to download <strong>and</strong> <strong>in</strong>stall WPI first. You can download WPI from www.asp.net/download<br />

<strong>and</strong> <strong>in</strong>stall it by click<strong>in</strong>g the Install Now button. If this l<strong>in</strong>k has changed by the time you read<br />

this document, go to www.microsoft.com/web/downloads <strong>in</strong>stead, or search the web for “Web<br />

Platform Installer download” to f<strong>in</strong>d one of the other Microsoft locations that lets you download<br />

<strong>and</strong> <strong>in</strong>stall WPI.<br />

Once WPI is <strong>in</strong>stalled, it starts automatically, or you can run it from the W<strong>in</strong>dows Start menu<br />

or Start screen. When it’s done load<strong>in</strong>g, switch to the Products tab, at the top of the screen enter IIS<br />

recommended, <strong>and</strong> press Enter. WPI should list the IIS Recommended Configuration, as shown <strong>in</strong><br />

Figure 19-6.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!