Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © 2011 Pearson Addison-Wesley Web Servers and Projects Deployment Chapter 11 – Slide 1.

Similar presentations


Presentation on theme: "Copyright © 2011 Pearson Addison-Wesley Web Servers and Projects Deployment Chapter 11 – Slide 1."— Presentation transcript:

1 Copyright © 2011 Pearson Addison-Wesley Web Servers and Projects Deployment Chapter 11 – Slide 1

2 Copyright © 2011 Pearson Addison-Wesley Web Servers &Projects Deployment HTTP Transactions Multitier Application Architecture Client-Side Scripting versus Server-Side Scripting Accessing Web servers Deploying ASP.NET Web Developer Express Deploying MVC Sites and Web Applications IIS Chapter 11 – Slide 2

3 Copyright © 2011 Pearson Addison-Wesley A web server responds to client requests (typically from a web browser) by providing resources such as HTML documents. When users enter a Uniform Resource Locator (URL) address, such as www.deitel.com, into a web browser, they’re requesting a specific document from a web server. The web server maps the URL to a resource on the server (or to a file on the server’s network) and returns the requested resource to the client. A web server and a client communicate using the platform- independent Hypertext Transfer Protocol (HTTP), a protocol for transferring requests and files over the Internet or an intranet. 3 Introduction ©1992-2012by Pearson Education, Inc. All Rights Reserved.

4 Copyright © 2011 Pearson Addison-Wesley URIs (Uniform Resource Identifiers) identify resources on the Internet. URIs that start with http:// are called URLs (Uniform Resource Locators). Common URLs refer to files, directories or server- side code that performs tasks, such as database lookups, Internet searches and business-application processing. A URL contains information that directs a browser to the resource that the user wishes to access. http:// indicates that the HyperText Transfer Protocol (HTTP) should be used to obtain the resource. 4 HTTP Transactions ©1992-2012by Pearson Education, Inc. All Rights Reserved.

5 Copyright © 2011 Pearson Addison-Wesley Next in the URL is the server’s fully qualified hostname – the name of the web-server computer on which the resource resides. A hostname is translated into an IP (Internet Protocol) address—a numerical value that uniquely identifies the server – An Internet domain name system (DNS) server maintains a database of hostnames and their corresponding IP addresses and performs the translations automatically The remainder of the URL after the hostname specifies the resource’s location (/books) and name on the web server For security reasons the path location is typically a virtual directory. The web server translates the virtual directory into a real location on the server, thus hiding the true location of the resource 5 HTTP Transactions (Cont.) ©1992-2012by Pearson Education, Inc. All Rights Reserved.

6 Copyright © 2011 Pearson Addison-Wesley When given a web page URL, a web browser uses HTTP to request and display the web page found at that address. HTTP method get indicates that the client wishes to obtain a resource from the server. The remainder of the request provides the path name of the resource (e.g., an HTML5 document) and the protocol’s name and version number ( HTTP/1.1 ). Any server that understands HTTP can receive a get request and respond appropriately. HTTP status code 200 indicates success. Status code 404 informs the client that the web server could not locate the requested resource. A complete list of numeric codes indicating the status of an HTTP transaction can be found at www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 6 HTTP Transactions (Cont.) ©1992-2012by Pearson Education, Inc. All Rights Reserved.

7 Copyright © 2011 Pearson Addison-Wesley Next, the server sends one or more HTTP headers, which provide additional information about the data that will be sent. The Multipurpose Internet Mail Extensions (MIME) standard specifies data formats, which programs can use to interpret data correctly. The MIME type text/plain indicates that the sent information is text that can be displayed directly. The MIME type image/jpeg indicates that the content is a JPEG image. When the browser receives this MIME type, it attempts to display the image. The header or set of headers is followed by a blank line, which indicates to the client browser that the server is finished sending HTTP headers. 7 HTTP Transactions (Cont.) ©1992-2012by Pearson Education, Inc. All Rights Reserved.

8 8

9 9

10 Copyright © 2011 Pearson Addison-Wesley Web-based applications are often multitier applications that divide functionality into separate tiers. Although tiers can be located on the same computer, the tiers of web-based applications typically reside on separate computers. The bottom tier (also called the data tier or the information tier) maintains the application’s data. The middle tier implements business logic, controller logic and presentation logic to control interactions between the application’s clients and its data. Business logic in the middle tier enforces business rules and ensures that data is reliable before the server application updates the database or presents the data to users. Business rules dictate how clients can and cannot access application data, and how applications process data. The top tier, or client tier, is the application’s user interface. In response to user actions, the client tier interacts with the middle tier to make requests and to retrieve data from the information tier. The client tier then displays the data retrieved for the user. The client tier never directly interacts with the information tier. 10 Multitier Application Architecture ©1992-2012by Pearson Education, Inc. All Rights Reserved.

11 11

12 Copyright © 2011 Pearson Addison-Wesley Client-side scripting can be used to validate user input, to interact with the browser, to enhance web pages, and to add client/server communication between a browser and a web server. Client-side scripting does have limitations, such as browser dependency; the browser or scripting host must support the scripting language and capabilities. Client-side scripts can be viewed by the client by using the browser’s source-viewing capability. Sensitive information, such as passwords or other personally identifiable data, should not be stored or validated on the client. 12 Client-Side Scripting versus Server-Side Scripting ©1992-2012by Pearson Education, Inc. All Rights Reserved.

13 Copyright © 2011 Pearson Addison-Wesley Placing large amounts of JavaScript on the client can open web applications to security issues. Code executed on the server often generate custom responses for clients. Server-side scripting languages have a wider range of programmatic capabilities than their client-side equivalents. 13 Client-Side Scripting versus Server-Side Scripting (Cont.) ©1992-2012by Pearson Education, Inc. All Rights Reserved.

14 Copyright © 2011 Pearson Addison-Wesley To request documents from web servers, users must know the hostnames on which the web server software resides. Users can request documents from local web servers or remote web servers. Local web servers can be accessed through your computer’s name or through the name localhost —a hostname that references the local machine and normally translates to the IP address 127.0.0.1 (also known as the loopback address). 14 Accessing Web Servers ©1992-2012by Pearson Education, Inc. All Rights Reserved.

15 Copyright © 2011 Pearson Addison-Wesley Deploying ASP.NET Websites Difficulties of deploying your application ASP.NET is. – First, unlike many traditional scripting languages such as PHP or classic ASP, ASP.NET is compiled. – Second, SQL Server databases are not as easily transportable – Third, the complex nature of the framework may lead that work in development on your local machine fail on your remote web server, still possible to deploy ASP.NET applications quite easily using Visual Web Developer Express and the SQL Server Hosting Toolkit. Chapter 11 – Slide 15

16 Copyright © 2011 Pearson Addison-Wesley Using Visual Web Developer Express to Deploy ASP.NET Websites The principal tool that Visual Web Developer Express offers to help you deploy your website is the Copy Website feature. It can be found through the Solution Explorer (it’s the second button from the left) or via the Website menu’s Copy Website… item. The deployment tools also support the deployment of the file system, a local IIS instance, a remote IIS instance using Front Page Server extensions, and/or a remote server via FTP. Chapter 11 – Slide 16

17 Copyright © 2011 Pearson Addison-Wesley Using Visual Web Developer Express to Deploy ASP.NET Websites 1. Click on the Website menu and select Copy Website… to open the website copy tool. 2. Click on the Connect button and leave File System selected. It’s here that, when transferring your website to a remote host, you’d choose FTP and configure the connection using the credentials provided by your host or your network administrator. For now, we’ll practice the process using the local file system. 3. Select a folder to deploy to. Since we’re just practicing, and we’ll remove it later, let’s create a temporary folder for the time being. Type C:\mywebsiteTemp 4. into the Folder field and click Open. Click Yes when prompted, to create the folder. Your screen should now look like Figure Chapter 11 – Slide 17

18 Copyright © 2011 Pearson Addison-Wesley Using Visual Web Developer Express to Deploy ASP.NET Websites Chapter 11 – Slide 18 5. Select all the files in your Source Web site panel and click on the double arrow button to synchronize all selected files. There should now be an identical list in both panes of the display

19 Copyright © 2011 Pearson Addison-Wesley Using Visual Web Developer Express to Deploy ASP.NET Websites To update any file after editing Save the file and open the Copy Website tool again. Note that there is now a blue arrow next to the Default.aspx file icon and the status is now listed as Changed. Select everything and click the double-arrow button again. Since we’re working locally, the action will be a little too quick for us to catch, but if we click the View Log… button, we should see that, even though we had all the files selected, only the Default.aspx has been updated: Chapter 11 – Slide 19

20 Copyright © 2011 Pearson Addison-Wesley Deploying MVC Sites and Web Applications One of the main differences between websites and web applications is how they are deployed. Websites will deploy all the code files, including the source code, to your hosting server. – The first browser request for a page on your site will cause IIS to compile your.cs files. Subsequent requests don’t have this compilation step unless your code files have changed. – If you need to make a change on the server, you can do so quite quickly. You do not have an App_Code folder as part of Web Applications, as your project is compiled into a single DLL for deployment, along with only your designer.aspx files. One of the newer features of Visual Web Developer 2010 is the ability to publish these web applications automatically to the server or to a file system. This is will include the step for compiling your site into the DLL and copying the views only. To do right-click on the project and select Publish. You will see a similar screen Chapter 11 – Slide 20

21 Copyright © 2011 Pearson Addison-Wesley Deploying MVC Sites and Web Applications Chapter 11 – Slide 21

22 Copyright © 2011 Pearson Addison-Wesley Deploying using IIS Chapter 11 – Slide 22 Installing IIS in Windows The process for enabling IIS 7.5 (in Windows 7) or IIS 7 (in Windows Vista) is the same. In both versions of Windows, IIS is included but not initially installed. To switch it on, you need to follow these steps: 1. Click Start, and then click Control Panel. 2. Choose Programs and Features. 3. In the task list (on the left), click the “Turn Windows features on or off” link. Now you’ll need to wait while Windows examines your system. 4. Find the Internet Information Services item near the top of the list (see Figure 26-2), and click it (so that the square next to the item becomes filled in).

23 Copyright © 2011 Pearson Addison-Wesley IIS in the same way you need to add the following Chapter 11 – Slide 23

24 Copyright © 2011 Pearson Addison-Wesley Chapter 11 – Slide 24 How to Deploy ASP. Net Websites on IIS 7.0 From now onwards, I will describe one example to deploy your ASP.NET websites on IIS 7.0. Step 0: change web.config file to Step 1: From Visual Studio, publish your Web application. Step 2: Copy the published application folder to "C:\intepub\wwwroot" [default] folder. Step 3: From Control Panel  Administrative tool  Internet Information Services (IIS) 6.0 The following screen will come.

25 Copyright © 2011 Pearson Addison-Wesley Chapter 11 – Slide 25 Step 4: We need to convert it to an application, just right click and then Click on "ConvertToApplication" as shown in the following picture:

26 Copyright © 2011 Pearson Addison-Wesley IIS Chapter 11 – Slide 26 In case you got the following error when loading the asp page HTTP Error 500.21 - Internal Server Error Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

27 Copyright © 2011 Pearson Addison-Wesley Refrences Chapter 11 – Slide 27 Deitel & Deitel (2011), Internet and World Wide Web How to Program, 5th Edition, Harvey & Paul Deitel& Associates.


Download ppt "Copyright © 2011 Pearson Addison-Wesley Web Servers and Projects Deployment Chapter 11 – Slide 1."

Similar presentations


Ads by Google