1 / 32

Deployment of web Site

Deployment of web Site. 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. Avoiding hardcoded setting.

sukey
Download Presentation

Deployment of web Site

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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. • <appSettings> element that enables you to store data in a key/value pair using <add> elements.

  6. <appSettings> • The <appSettings> 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: • <appSettings> <add key=“FromAddress” value=”nkniazi@iba.edu.pk” /> </appSettings> • The <appSettings> element is placed outside the <system.web> element in the web.config file, yet still within the parent <configuration> element. • Obviously, you need a way to access the data in <appSettings> 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 <appSettings> element in web.config, connection strings, localization resource files and various routing settings used in URL rewrite scenarios. To display data from the <appSettings> element, you use the following syntax where AppSettingKeyName refers to a key you define in web.config: <%$ AppSettings:AppSettingKeyName %>

  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”); <add key=”SendMailOnError” value=”true” /> boolsendMail = Convert.ToBoolean(WebConfigurationManager.AppSettings.Get(“SendMailOnError”));

  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).

  16. 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.

  17. 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.

  18. 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.

  19. 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.

  20. 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

  21. Permission to the web server account

  22. Moving Data to Remote server • Obtain and install SQL server management studio express

More Related