21
IST346: Lab Last Update: 6/22/2010 3:26 PM L10 – WEB SERVICES O VERVIEW In this lab you will explore how setup and configure Web services on the Windows and Linux platforms. L EARNING O BJECTIVES Upon completion of this lab, you should be able to Configure Internet Information Services on the Windows Platform. Setup a Windows Server for remote file publishing. Configure Apache, PHP and MySQL on the Linux Platform Setup an configure a LAMP application on Linux L AB B REAKDOWN This lab consists of 2 parts: 1. Setting up and configuring Web services on Windows 2. Setting up and configuring Web services on Linux R EQUIREMENTS Before you start this lab you will need: 1. You must complete the previous lab prior to working on this lab. 2. These virtual machines: a. Win2008 (Windows Server 2008) – acting as the server (domain, file, web) Logon as Administrator b. Win7 (Windows 7) – acting as a workstation. Logon as any domauin user (titupp, for example) c. Centos5 (Centos Linux 5) - acting as a web server, logon as root this will P ART 1 – M AKING DNS WORK FOR YOU We would like win2008 to be our primary web server www.ad.fauxco.com and Centos5 to be our Blog blog.ad.fauxco.com. Add these CNAMES using the wwwDNS utility in Server Manager on Win2008. For example: Page 1

Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

Embed Size (px)

Citation preview

Page 1: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

L10 – WEB SERVICES

OVERVIEW

In this lab you will explore how setup and configure Web services on the Windows and Linux platforms.

LEARNING OBJECTIVES

Upon completion of this lab, you should be able to

Configure Internet Information Services on the Windows Platform. Setup a Windows Server for remote file publishing. Configure Apache, PHP and MySQL on the Linux Platform Setup an configure a LAMP application on Linux

LAB BREAKDOWN

This lab consists of 2 parts:

1. Setting up and configuring Web services on Windows2. Setting up and configuring Web services on Linux

REQUIREMENTS

Before you start this lab you will need:

1. You must complete the previous lab prior to working on this lab.2. These virtual machines:

a. Win2008 (Windows Server 2008) – acting as the server (domain, file, web) Logon as Administrator

b. Win7 (Windows 7) – acting as a workstation. Logon as any domauin user (titupp, for example)c. Centos5 (Centos Linux 5) - acting as a web server, logon as root this will

PART 1 – MAKING DNS WORK FOR YOU

We would like win2008 to be our primary web server www.ad.fauxco.com and Centos5 to be our Blog blog.ad.fauxco.com. Add these CNAMES using the wwwDNS utility in Server Manager on Win2008. For example:

Page 1

Page 2: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

Add these Two cnames, and then make sure they resolve correctly from another host (for example you could use nslookup from the Win7 command prompt).

PART 2 – CONFIGURING WEB SERVICES ON W INDOWS

OVERVIEW

In this first part we will configure web services on Windows. The primary HTTP server on the windows platform is Internet Information Services, or IIS. IIS is a powerful and highly configurable web platform; I encourage you to read more about IIS by visiting http://learn.iis.net/

The goal for this part of the lab will be to configure IIS on your Win2008 virtual machine. We will setup the web server, and then share out the main folder where the web server is running so that client computers (in this case the Win7 virtual machine) can publish files to the website. Once the server-end is configured, we will test the configuration on the workstation.

2.A INSTALLING THE IIS ROLE ON THE WIN2008 SERVER

On the Win2008 virtual machine, logged on as Administrator, install the IIS role. I will not provide instructions how to do this. We’ve installed enough roles where you should know how to do this by now. If you need specific instructions for how to do this, please visit:

http://learn.iis.net/page.aspx/29/installing-iis-70-on-windows-server-2008/

Page 2

Page 3: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

IMPORTANT: Be sure to install the ASP.NET as part of the web services role.

Once you have your web services installed, it’s time to check that you have IIS installed correctly,

1. logon to your Win7 virtual machine as domain user titupp (Tally Itupp) 2. Open up the internet explorer web browser

Page 3

Page 4: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

3. Enter the url http://www.ad.fauxco.com press enter and you should see the IIS welcome page!

IMPORTANT: If this is not working, it’s time to use the troubleshooting skills you’ve learned so far. You might want to try these out anyways just to get a feel for the process. Remember, use the outside-in approach:

Is the service required for HTTP to work, DNS working? Use nslookup for this Does the server respond to pings? Use ping for this In the web service port open and available? Use nmap for this. Check the firewall on the server.

Once you know for certain the web server is up and running you may move on to 1.b

2.B OUR ACTIVE D IRECTORY SECURITY CONFIGURATION FOR WEB PUBLISHING

In this next step, we will setup the file structure and security necessary to facilitate web publishing for this particular example. What we’re going to do is make an Active directory group, and then give that group permissions to write files into a file share that will also serve as our website.

On the Win2008 virtual machine, logged on as Administrator:

1. Create a user group called web-publishers-group in the Active Directory Users and Computers Utility. (Or using the command line, of course)

Page 4

Page 5: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

2. Add the users tally itupp and bob enweave to this group, like so:

3. Create a folder called website in the C:\shares folder

4. Set the security on this folder. Break security inheritance on the c:\shared\website folder. (we did this in the File sharing labs) Bring up the Security tab under the Properties dialog. Click on Advanced and then Edit. You will see this dialog:

Page 5

Page 6: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

And then clear the checkbox titled Include inheritable permissions from this objects parent.

And copy the permission entries.

Click Ok until you’re back at the Security dialog. Like this:

Page 6

Page 7: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

You should now be able to edit the access controls. Click edit and change the existing permissions:Everyone and Users should have these permissions:

(this allows anonymous users to visit the website. If everyone is not there, add it.)and the web-publishers-group and Administrators should have these permissions:

(this allows admins and web publishers to copy files to the share) When you’ve got it right, your access control list should looks like this:

Click Ok until all dialogs are closed. You have now shared this folder so that people in the web-publishers-group can place content on the website.

Page 7

Page 8: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

2.C CONFIGURE IIS TO USE OUR WEBSITE FOLDER, AND PUBLISH FILES.

In this next step we will configure IIS (the web server service) to use the folder we created in the previous step as the default location of the website. Then, in the final step we will publish files to our website from the Win7 workstation.

On the Win2008 virtual machine, logged on as Administrator:

1. Open the Internet Information Services Manager utility under Server Manager. NOTE: If you’re not seeing it then you need to restart the Server Manager Utility.

.2. Browse the connections until you have selected the Default Web Site.

3.

Page 8

Page 9: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

4. Click on Basic Settings to change the location of the default folder for the website. Currently it is set to %SystemDrive%\inetpub\wwwroot you will change it to c:\shares\website like so:

5. Click Ok when done.6. Finally restart the website. Click back on Default Web Site and then click the restart link under manage

website

Your website is ready to receive files for publishing. Time to publish files!

2.D PUBLISH WEBSITE

From your Win7 virtual machine logged on as titupp (Tally Itupp)

1. Browse to the folder \\Win2008.ad.fauxco.com\shares\website (Click start run and type in the shared folder name)

2. Download the website.zip example website package file from the place where you got this lab. Place the .zip file on your desktop in your Win7 virtual machine.

3. Double-click to open the website.zip file you should see files in the folder.4. Copy the contents to \\Win2008.ad.fauxco.com\shares\website

a. Click in Zip file folder.b. Press Ctrl+A to highlight all files c. Drag to Shared website folder.d. Drop to copy files

5. IMPORTANT: If you cannot copy files, check your steps in 2.B

Page 9

Page 10: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

6. Open internet explorer and visit http://web.ad.fauxco.com you should see the Fauxco.com website:

IMPORTANT: If it does not work, check your install of IIS, did you enable the ASP.NET role service? Did you change IIS to use the proper directory? Did you copy the files directly into the \\Win2008.ad.fauxco.com\shares\website folder from Win7? Also sometimes the file contents get cached try refreshing the page a couple of times.

NOTE: In the next section we will get the Blog working and configure the apache server to handle both websites blog.ad.fauxco.com and webmail.ad.fauxco.com

Page 10

Page 11: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

Page 11

Page 12: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

PART 3 – WEB SERVICES ON L INUX

OVERVIEW

In this next part we will configure web services on Linux. We will configure the LAMP stack on the Centos5 virtual machine and then configure a popular blog application wordpress. The end game is to get wordpress to talk to your active directory so that your users can logon to the application using their existing accounts in Active Directory.

3.A INSTALLING THE LAMP ROLES ONTO CENTOS5

Next we will install the LAMP (Linux, Apache, MySQL, PHP) <roles into the Centos5 Linux server. You can read this blog for specific steps on how to do this:

From the Terminal Window of the Centos5 virtual machine logged in as root:

1. Type this command to install the required packages from the internet: yum install httpd php mysql mysql-server php-mysql this will install the required LAMP components using the yum package manager.

2. Make sure the MySQL database server and the Apache web server will launch at startup, type:chkconfig mysqld on and thenchkconfig httpd on

3. And then re-start the Apache and MySQL servers, with:service httpd restart and then service mysqld restart

4. Set the MySQL admin (root) password to SU2orange!, type:mysqladmin -u root password 'SU2orange!'

5. Finally write a test.php script to verify everything is working. By default the Apache web server stores files in the path /var/www/html, so let’s create the document there, type:nano /var/www/html/test.php

6. This will open the nano editor. Inside the editor type:<?php phpinfo(); ?> and then press ctrl+x to exit, and y to save and enter. (do not put a space between phpinfo and the parentheses)

7. Verify the test.php file exists, type:ls –l /var/www/html/ to list the files in the folder (that’s a lowercase “L” not a “one”). You should see the test.php file that you created.

Page 12

Page 13: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

8. Now open up the Firefox browser on the centos5 virtual machine and visit:http://blog.ad.fauxco.com/test.php (for example:

Important: You must make sure the test.php page works before you can continue.

2.B INSTALLING THE WORD PRESS BLOG SOFTWARE

Once you have LAMP configured it’s time to install your first LAMP application – Wordpress.

These instructions to explain how to install wordpress: http://codex.wordpress.org/Installing_WordPress

Here are some more step-by-step instructions, from the Terminal Window (logged in as root):

1. Create the wordpress database in mysql. Type:mysqladmin create wordpress –p This will prompt you for the MySQL root password, enter SU2orange!If you don’t see an error, then your database was created. Time to install the blog software.

2. We will download wordpress to /var/www/html/ so first type, cd /var/www/html/ to change into the website folder.

3. Next, download the Wordpress tarball package using the wget utility:wget http://wordpress.org/latest.tar.gzWhen the download is complete you should see a ’latest.tar.gz’saved message.

4. Once it’s downloaded, you can extract the tarball with, type:tar –zxvf latest (then press the TAB key to complete NOT ENTER) if you cannot find the file, try wordpress in place of latest.This will extract the files from the tarball to the folder called wordpress we don’t want the files in the a

Page 13

Page 14: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

folder named wordpress … we want the folder to say blog. So let’s rename the folder. Type:mv wordpress blog

5. At this point if you type ls –l you will see the blog folder, the latest.tar.gz file and our test.php script. You can delect the So we need to move the files out of the wordpress folder and back into the root web folder. Type: rm latest.tar.gz To clean things up. This will move all the files out of the wordpress folder into the current folder (the root web folder).

6. The next thing you need to do is change the permissions and ownership on the files so that you can configure wordpress via a web browser.Change the file owner to apache for all files in the blog folderchown apache:apache –R blogThen give write permissions to the folder itself:chmod a+w blog

7. Next go back to your Firefox browser on the centos5 virtual machine and visit:http://blog.ad.fauxco.com /blog If you’ve done everthing correctly to this point, you should see:

8. Click on the Create a Configuration File button. This will start the wordpress setup:

Page 14

Page 15: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

9. Click Let’s Go. And then fill out the next form as follows:

And then click Submit.

10. At the final screen click to finish the word press install.11. You are now prompted for a blog title, email User name and Password. Enter the information as follows,

using your actual netid in place of yournetid of course.

12. When you’re ready, click . (NOTE: It might take a few minutes to install, so be patient).

Page 15

Page 16: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

2.D CONFIGURING WORD PRESS TO AUTHENTICATE TO ACTIVE D IRECTORY

Cool. Your blog is up and running. Of course we would like to use the users in Active Directory, rather than have each person in Fauxco.com maintain 2 sets of accounts. There’s a word press plug-in for this. Let’s get the plug-in:

1. Logon to wordpress with username admin and password SU2ornage! (NOTE: If you lost the URL to the login page, it’s http://blog.ad.fauxco.com/blog/wp-admin)

2. From inside word press, logged in as admin click on Plugins Add New in the search box, type: simple ldap login and click Search Plugins. You should see:

3. Click on Install Now link next to simple LDAP login and then activate the plug-in.4. Once the plugin is activated, you can go to Settings Simple LDAP login to configure it.5. Enter this configuration information. (It should be a blast from the LDAP past!)

6. Use the make sure you Update Options before you use the Test Settings area to try out your settings. (For, example try to log-in as titupp, or benweave) When you know it works, you will see a message at the bottom “The test succeesed. This account is able to login.”

2.E PUTTING IT ALL TOGETHER

1. Go back to the Win7 virtual machine.

Page 16

Page 17: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

2. Open internet explorer and go to the site http://www.ad.fauxco.com You should see this:

3. Click on the blog hyperlink, and you should be directed to the blog page:

4. Click on the Log In link (or if you can’t find it, type: http://blog.ad.fauxco.com/blog/wp-admin).Log on to the blog using the account for Tally Itupp: user titupp password SU2orange!

Page 17

Page 18: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

Yes, believe it or not you will be able to log in to the blog using an Active Directory account. Welcome to the power of Directory Services!!!!

5. Notice it says In the upper-right corner of the page! This is because we entered this information in Active Directory in a previous lab and word press is using it from the directory.

6. Type up a quick post for review in the quick press window., for example:

And when you’re ready click Submit for Review.7. Log out and then log back in as admin see if you can figure out how to approve Tally’s post and publish it

so that it appears on the main page like this:

Page 18

Page 19: Overview - Syracuse Universityclasses.ischool.syr.edu/.../lab-web-services.docx  · Web viewIn this lab you will explore how setup and configure Web services on the Windows and Linux

IST346: Lab Last Update: 11/16/2010 8:39 PM

PART 3 – RUNNING THE LAB CHECKER SCRIPT.

This lab will be checked/ graded with a lab-checker script. Similar to previous labs, you will download this script to your Win2008 virtual machine and then run it. It will verify you have performed the steps outlined in the lab

1. Logon to your Win2008 VM as Administrator. (If you’re not already)2. Make sure your Centos5 VM is powered on and your Wordpress blog is running.3. Download the script to the Documents folder. Save as L06.ps1 4. Click on Windows Powershell in the Windows start menu. This will open the powershell command

prompt.5. Execute the lab checker by typing .\Documents\L06.ps1

Page 19