Set up software and verify that it works correctly:
Setting up Personal Web Server for ASP
How do you set up the software and verify that it works correctly?
Microsoft Personal Web Server (PWS) allows you to run ASP scripts on in an "Eweb" programming environment.
On a computer running Windows 2016 Server or Windows 10, you should install Microsoft Internet Information System (IIS) version 7 or higher. As indicated in the lesson titled "Asp Course Requirements", you will need Microsoft Edge, Chrome or Firefox to run the installation program.
Installation Process
Click the link below to see the sequence of installation screens and the choices you should make during the installation of Personal Web Server. Installing Personal Web Server.
Creating a Virtual Directory
A virtual directory is an alias for a directory path on your web server. Virtual directories allow you to view your Web site independently of your computer's directory structure (For example: A virtual directory named
C:\Inetpub\wwwroot\myprojects
can be viewed in your web browser as http://localhost/myprojects/).
To create a virtual directory, follow the steps below.
Open Windows Explorer and create a new directory under the Inetpub\wwwroot\ directory on your hard drive.
Next, open Personal Web Manager, and click the icon labeled "Advanced" on the bottom left corner. You will see a screen shown below:
Select the Directory Home.
Click the "Add..." button and the "Browse..." button. Find and select the directory you created in step 1. In the Alias window, type the name of the directory you selected. You can give it any name you wish, but we recommend using the same name as the directory to avoid confusion.
Advice on Checking Boxes
In the Access area, make sure the boxes labeled "Read" and "Scripts" has a checkmark, and the box labeled "Execute" is unchecked.
Click OK. The directory will appear in the Virtual Directories list.
You can now view this directory in your web browser by typing in the path; you can not navigate or "Browse" to it. You are now ready to create and save a test ASP script in your new directory and attempt to view it.
Testing an ASP File
Before you go on to create ASP scripts, you need to be sure PWS can access them. To test if ASP is working correctly, you need to create a basic script with a little ASP code. Using Windows Notepad, create an ASP script with the following code (or copy it from the code below and paste it into Notepad):
<HTML>
<HEAD>
<TITLE>Web Server Test</TITLE
</HEAD>
<BODY>
Hello World! The time is <% =Time %>.
</BODY>
</HTML>
Save the document as test.asp in the virtual directory you created above.
Start your web browser, and enter the URL http://localhost/mydir/test.asp, where mydir is replaced with the name of the virtual directory you have created. If ASP is working, you will see the following text on the screen:
Hello World! The time is hh:mm:ss.
where hh:mm:ss represents the current time. Click your browser's Refresh or Reload button, and the time will be updated. View the source of the page. The code you will see is:
<HTML>
<HEAD>
<TITLE>Web Server Test</TITLE>
</HEAD>
<BODY>
Hello World! The time is hh:mm:ss.
</BODY>
</HTML>
As you can see, ASP has correctly interpreted the ASP "Time" object and returned the current time for display in the web browser.
You are now ready to run ASP scripts on your computer.
122
Final Steps
You have been supplied skeleton code for the course project in the course resources download asp-scripts.zip. Create a virtual directory on your machine to hold the course project files. Next, unzip the files into this directory. Test the functionality of the project by viewing the .asp or .htm files in your browser. You are now ready to create and run ASP scripts, view the results of exercises, try out the code samples, and run the course project Web site. The next module starts the course by explaining server-side scripting and Active Server Page technology and syntax.