Presentation is loading. Please wait.

Presentation is loading. Please wait.

CONFIGURING WINDOWS SERVER MIS 424 Professor Sandvig.

Similar presentations


Presentation on theme: "CONFIGURING WINDOWS SERVER MIS 424 Professor Sandvig."— Presentation transcript:

1 CONFIGURING WINDOWS SERVER MIS 424 Professor Sandvig

2 Overview In this exercise you will: 1. Log onto Windows Server 2. Create a new application pool 3. Create a new web application 4. Open Sql Server Management Studio 5. Create a new Sql Server database 6. Create a new Sql Server user 7. Assign the user to the database 8. Read your database from web page

3 Steps You will be provided with an instance of Windows Server 2008 hosted by on Amazon EC2 cloud The next two slides display how an instance is launched from Amazon’s console

4 Amazon Web Service Console

5 Select instance type

6 Instance Each instance is assigned a public IP address The following slide shows the instance management page

7 Instance Management

8 Next step is to get the instance password

9 Instance management

10 Password Amazon generates a private key for each account. The private key is used to decrypt the password (next slide)

11 Password

12 Ta-da!

13 Login Login to your instance using Remote Desktop Your IP address and password are on the next page

14 Login Passwords PersonIPusernamepassword Zak52.26.27.211Administrator;w2AERmyC8@ Chris52.26.29.83Administrator tZ)cKM=H4i Lindsey52.26.80.27AdministratorLFwWYV;ibd Alastair52.26.83.25Administrator;HszTDR==S$ Ryan52.26.77.0AdministratorChivDyNrD3$ Alex52.26.20.118Administratorn4@*4yVCRMi Hayley52.26.47.120AdministratorF5ZcRU.Yq- Jason52.26.62.131Administratorn@*33-M4d$W Alicia52.26.83.45AdministratorT5&*8v=cm6 Daniel52.26.83.253AdministratorULxxtxDYF7 Taylor52.26.70.144Administrator*sTMkgNcPH-

15 View IIS Default By default Windows hides file extensions Developers need to see file extensions. Navigate to the IIS root web folder Change folder options to show file extensions

16 Permissions While in the IIS root folder, check folder permissions. Which permissions are assigned to anonymous web users?

17 View default web page Open browser on your local machine and view IIS default web page Address is IP address of your instance

18 Modify default web page Use Notepad to edit the default web page

19 Create ASP.NET Application You will now use IIS to create a new ASP.NET application.

20 Create a ASP.NET Application Create a new folder named mis424Application

21 Create ASP.NET Application Search for IIS using Windows search Open IIS 7.0 Manager

22 Create a new application pool Your application is important so provide it with its own application pool

23 New Application pool Give the application pool the same name as the application folder Change framework to 4.0

24 Create new Application Right click on your new folder and convert it to an application Select your new application pool

25 Test your application Use Notepad to create a file default.aspx with the following code: void page_load() { lblMessage.Text = ".NET Version: " + System.Environment.Version.ToString() + " Application Pool: " + Request.ServerVariables["APP_POOL_ID"] ; } ASP.NET Test

26 View new File

27 Database You have now configured an ASP.NET application The next step is to create a new SQL server database and link to it from your web application.

28 Create a new database Open Sql Server Management Studio on the remote server

29 Connect to Sql Server Management Studio will automatically select your database server Click “Connect”

30 Create new database Name your new database “customers”

31 Create a new table (as shown)

32 Create new table You will be connecting an.aspx page to your database so make sure that all the names match the sample Sql Server is case sensitive custID is an identity field custID is the primary key Table name is tblCustomers

33 Add some data

34 Permissions Permissions are needed to access the database You will create a new user named Webguest For security reasons Webguest has only limited permissions In the following steps you will: 1. Configure Sql Server to allow Sql server authentication 2. create a new Sql Server user 3. Assign user permissions to your database

35

36 Allow Sql Server Authentication Using Sql Server Management Studio right-click on the database server (top folder) and and select Properties Click on Security Change authentication mode

37 Restart Database In Management Studio right- click on server and select restart

38 Add new Sql Server user

39 Add Sql user Username: Webguest Password: guest22 Turn off “enforce password policy”

40 Assign user to customers database Open Customers database Open Security Right-click “Users” Select “New User

41 Assign Roles on Database Username and Login name is “Webguest” Assign limited roles: datareader and datawriter

42 Test login Create a second connection to database in SSMS. Login to server using Sql Server Authentication You now have two connections to database. One as an admin, one as Webguest

43 Test permissions Try to view, add, update, and delete data Try to add a new table

44 Connect Web to Database Create a new file crud.aspx using this code Replace data source with your database name from Sql Server Studio Read Sql Server table {margin:10px auto; background-color:#fff;} td {padding:5px;} body {background-color:#ccc;} Read Sql Server <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="custID" DataSourceID="SqlDataSource1"> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=win-vuc09id4k05;Initial Catalog=customers;User ID=Webguest;Password=guest22" DeleteCommand="DELETE FROM [tblCustomers] WHERE [custID] = @custID" InsertCommand="INSERT INTO [tblCustomers] ([name]) VALUES (@name)" ProviderName="System.Data.SqlClient" SelectCommand="SELECT [custID], [name] FROM [tblCustomers]" UpdateCommand="UPDATE [tblCustomers] SET [name] = @name WHERE [custID] = @custID">

45 Test CRUD

46 Email links Email your Amazon cloud links to Professor Sandvig: 1. default.aspx 2. Crud.aspx

47 Summary Today you have: 1. Logged onto Windows Server 2. Created a new application pool 3. Created a new web application 4. Used Sql Server Management Studio to: a. Create a new database b. Create a new user c. Assign the user to the database d. Log in as the new user 5. Read your database from an.aspx application

48 Other things you could do: Create your own Amazon EC2 instance (free but requires a credit card) Copy your MIS 324 / MIS 424 assignments to Amazon Setup a CMS Download Microsoft Web Platform Installer Select a CMS (see next page)

49 Web Platform Installer

50 Finished


Download ppt "CONFIGURING WINDOWS SERVER MIS 424 Professor Sandvig."

Similar presentations


Ads by Google