Download presentation
Presentation is loading. Please wait.
Published byElfrieda Joseph Modified over 9 years ago
1
Deployment of web Site
2
Preparing the web site for deployment you now have two versions of web site 1 -one running in the production environment 2-one you use for development. This makes it difficult to keep things synchronized
3
Avoiding hardcoded setting myMessage.From = New MailAddress(“you@yourprovider.com“, “Sender Name“); myMessage.To.Add(New MailAddress(“you@yourprovider.com“, “Receiver Name“)); Hardcoding settings in this manner makes it difficult to give them different values in different environments. Every time you want to roll out your site to production, you need to make sure you’re not accidentally overwriting settings you changed for the production environment.
4
Solution for this kind of problems the web.config file, expression syntax, and the webConfigurationManager class you use to read from web.config.
5
Web.config file We have used web.config file to store information about connection string,roles,profiles,membership. element that enables you to store data in a key/value pair using elements.
6
The element enables you to store simple information, such as an e ‑ mail address, and retrieve that value by its key. For example, to store an e ‑ mail address, you can add the following to the web.config file: The element is placed outside the element in the web.config file, yet still within the parent element. Obviously, you need a way to access the data in at runtime. You can do this in a couple of ways, including expression syntax and the WebConfigurationManager class
7
Expression setting Expression syntax enables you to bind control properties to resources, such as those found in the element in web.config, connection strings, localization resource files and various routing settings used in URL rewrite scenarios. To display data from the element, you use the following syntax where AppSettingKeyName refers to a key you define in web.config:
8
webConfiguration Manager class The WebConfigurationManager class from the System.Web.Configuration namespace provides access to data that is stored in configuration files. It has special support for the appSettings and connectionStrings elements of the web.config file, enabling you to retrieve data from those sections with a single line of code. using System.Web.Configuration;... string fromAddress= WebConfigurationManager.AppSettings.Get(“FromAddress”); bool sendMail = Convert.ToBoolean(WebConfigurationManager.AppSettings.Get(“SendM ailOnError”));
9
Copying your web site During development of your site you use the built-in web server that ships with Visual Web Developer. Although this server is great for local development, you can’t use it in a production environment,because it only listens to requests coming from localhost. To put your site in production,you need to deploy it to a machine that runs IIS (Internet Information Services), Microsoft’s professional web server.
10
Deployment options
11
Copying web site The Copy Web Site option simply creates a copy of all files that make up your site. It can create a copy of the site at different locations, including the local file system, an FTP server, and an IIS server. To copy the files to the local system. This is a great way to create a copy that is detached from the development environment that can be run on your local machine. when you’re creating the copy over a slow FTP connection, you’ll be glad this tool only uploads new and changed files,and leaves unmodified files untouched. You can, of course copy the same set of files to another machine using an FTP program, a USB stick, and so on. The detached local copy enables you to make modifications to a few files first (like web.config) and then upload everything to your host.
12
Publishing web site it allows you to precompile the application, which means all the code in the Code Behind of your ASPX pages, controls, code files in App_Code, and so on are compiled into.NET assemblies; files with a.dll extension in the bin folder of your site. The main benefits of precompiling are source protection (others with access to the server can’t look into your source) and an increased performance the very first time a page is requested. Pages that are not precompiled are compiled on the fly when they are requested the first time, which takes a little bit of time. Remember that regular visitors to your site will never be able to see the source of your application. All they’ll be able to see is the final HTML that gets sent to the browser.
13
Running your site under IIS 1. Install and configure IIS. 2. Install and configure the.NET Framework 4 3. Configure security settings.
14
type on start appwiz.cpl After the installation of iis,you have to make sure that Microsoft.NET FRAMEWORK VERSION 4 IS INSTALLED.
15
Inastalling and configuring ASP.NET IF You have iis and microsoft.NET frramework 4 installed,you have to tell the iis that you have framework 4 on your machine.(it is only required if you install IIS later).
25
Each new IIS installation has a Default Web Site, the site that listens to http://localhost by default. It means that a URL like http://localhost/Login.aspx is mapped to the physical file at C:\BegASPNET\Release\Login.aspx.
26
Application pool You assign a web site “an application pool” an IIS mechanism to isolate and configure one or more IIS web sites in one fell swoop. Two web sites running in different application pools do not affect each other in case of a problem such as a crash.
27
Understanding Security in IIS In order to use resources in your site, such as ASPX files, Code Behind files, the database in the App_Data folder, and the images in your site, your web server needs permissions from Windows to access those resources. This means that you need to configure Windows and grant access to those resources to the account that the web server uses. there are only two scenarios to consider: using the built- in web server or using IIS as your web server.
28
For IIS where IIS is used, things are quite different. By default, an ASP.NET application under IIS runs with a special account created when you installed IIS. This account is called Network Service on Windows Vista, and the original release of Windows Server 2008 and it is called ApplicationPoolIdentity on Windows 7 and Windows Server 2008 R2.
29
NTFS setting for website you’ll need to make changes to the Windows file system, so the web server is allowed to access your resources. This is only necessary when your hard drive is formatted using NTFS and not with FAT or FAT32, the older Microsoft file systems To successfully configure your NTFS file system for the web site, you need to grant the following permissions to the web server accounts
30
Permission to the web server account
32
Moving Data to Remote server Obtain and install SQL server management studio express
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.