ASP Lesson #2 - Get Started with Personal Webserver
Now you who have read my lesson #1 will wonder why my lesson #2 will be about the software Microsoft Personal Webserver
and not about ASP? It depends on that most people dont have access to a working Webserver. Now I will explain how to setup
PWS and make the common settings.
Because that ASP can't be run local in a simple webbrowser, the ASP files must be put within a Web Server....and I suppose
most of you reading this don't want to stay online doing the examples and other things. I'm thinking about you who got a
modem connection. I will now show you how you can run ASP-Pages local on your own HD.
What is PWS?
PWS stands for Personal Webserver and it's a light edition of Microsoft's standard software for common webservers(Microsoft Internet Information Server).
PWS is allthough a software that is free and that was made for one main reason. That common people can simultate a part
of their HD to be a webserver.
Perhaps you're asking yourself why this is needed? Since ASP is pages that must be generated/executed by a webserver before
they can be read by a webbrowser. To do this, we use PWS to simulate the webserver and generate the HTML code out of the
ASP files.
Where can I get PWS?
PWS is freeware. There is mainly three ways to obtain PWS:
* | Windows 98-CDROM. If you use Windows 98, the software PWS is on the Windows 98 CD-Rom. |
* | Internet. If you use Windows 95 you have to download PWS from http://www.microsoft.com. |
* | Other. Since PWS is freeware and is a quite common and popular software it usually comes with
many computer magazines that you can buy in any store. |
Install PWSWhen you have PWS installation files all you have to do is to install the software.
The hard part of this is to configure the software correct and to use PWS.
After you have run Setup.exe make sure that you choose the Custom Installation so that you may choose install path and
other options. You'll only need a few of them. Make sure that these components are beeing installed before you continue:
* | Common Programfiles | * | Microsoft Data Access Components 1.5 | * |
Personal Webserver(PWS) | * | Transaction Server | These for dots are the only ones you
need to use ASP. The other settings is up to you to choose if you need. When this is ready, just install the software.
Cofigure PWS
When the installation is finished there will be a folder in the root of c:\ which is called Inetpub ( if you didn't changed this in the installation ).
In this folder there will be a lot of other folders. The main folder we are going to use is the one called wwwroot. c:\Inetpuv\wwwroot\
In this folder you can create all the folders that will contain all your projects. It's beacause in wwwroot the ASP files
will be virtually simulated on your virtually webserver. Theres is allthough a little problem. You have to star the webserver
before all this is going to work for you. I will teach you that now.
Lets start PWS. You should have a shortcut to it in your start menu. It can also be in the lower right corner in Windows.
You should see a software window split into two frames. Take a little look in the right one, there should be a quite big
button which is labeled start. Click it!
After a few seconds the button will change it self into a stopp button, this means that your webserver now have been started.
This is a good sign, if this happens, your server should be working.
Let us now configure your read and write properties for your server. In the left frame there should be a couple of icons.
Lower left you will see an icon named Advanced. Click it! You will now see a list with information of different folders. Here is where you choose which folders
have write persmission or not. You can only change properties for folders under the folder wwwroot.
Start, without exiting PWS, the Explorer in Windows and open the folder wwwroot. Now create a folder named ASP ( or whatever you like to ). Now return to PWS.
Click the button ADD. Choose browse and choose the folder you just created. Tap the folder you created and click OK.
In the next field it says: New Virtual Directory, change it to ASP ( or whatever your new directory was named ). In this field you will find three options that you can choose from. It is, Read, Execute and Scripts. Make sure all theese options are marked and then click the OK button. You have now
made the folder: c:\inetpub\wwwroot\asp\ is a virtual folder that have Read, Execute and Scripts rights. If you don't do
this you won't be able to run any ASP code from this directory.
If you would like to add more folders under the wwwroot directory you simply just create them in the Explorer, and then
give them Read, Execute and Scripts rights in PWS.
Use PWS
Ok, now create a simple file in you ASP directory named: Default.asp. Open it in notepad and add this code:
This file is executed on my personal webserver.
Save the file and then start your webbrowser. To open the file you can't just type the url ( c:\inetpub\wwwroot\asp\default.asp ).
If you do so the file will be executed, but all the asp code will not be treated. To access this and all other files under
the wwwroot directory do like this:
http://localhost/ And then the name on the folder you want to open. Or the file you wich to view, in this case ASP.
http://localhost/asp You don't have to write default.asp. Why not? Since this is a filename that the webserver
will be searching for, it's called the index file. The index file for HTML is Index.htm/l. Now I have teached you how
to setup a webserver for you asp files. In the next lesson I will teach you what this guide actually is about: ASP! End of ASP Lesson #2
|