How to configure an ASP operating environment

xiaoxiao2021-04-08  355

How to configure an ASP operating environment

1. If your operating system is Windows 98, run Windows98 installation disc. Find the PWS installer in its add-ons / pws directory, run the installation

2. If the operating system is Windows 2000, you can install IIS according to Figure 4.1.1:

Open [Control Panel], find [Add / Remove Programs] → [Add / Delete Windows Components],

Plus [Windows Component Wizard], select [Internet Information Service (IIS)] (in Windows Server 2003, this option is in [Detailed information] of the program server]), insert the installation disk, press [Next] start installation. As shown in 4.1.1:

Figure 4.1.1 Select Installing IIS Services

After the installation is successful, you can configure IIS in accordance with your own requirements. First you need to know that IIS acts as a virtual role during the process we use. That is, we are "pretending" to divide a part of the space of the machine disk to "Server" (actually our website is stored on a dedicated web server). Since we have to access content on the "server" (although it exists on this machine), then we have to access the mode similar to accessing the website.

The default directory of IIS is installed in the system disk: / inetpub / wwwroot, that is, the above virtual directory http://27.0.0.1 is actually executing the physical path on your machine is system disk: / inetpub / Wwwroot content, try to see if the LocalStart.asp in the IIS start page is in the wwwroot directory? Similarly, if there is a B.asp file in wwwroot, you can also access by http://localhost/b.asp or http://127.0.0.1/b.asp.

Note: Although the ASP environment (PWS) can also be configured under Windows 98, we strongly recommend that you use the Windows2000 and its subsequent Web Server (IIS) to configure the ASP environment. The example in this book is also based on the IIS method.

Tip: PWS is the abbreviation of the Personal Web Server, the translation is "Personal Network Server"; and IIS is an abbreviation of Internet Information Server, which is the Internet Information Server. From the literal meaning, you can tell which one of the features will be more powerful.

Tips: Although the default directory is defined in the system disk: / inetpub / wwwroot, it is in general. We still use it directly. Because the month is tired, inevitable we have to operate multiple ASP files, or debug multiple ASP sites, if the file is disconnected in wwwroot, there will be a lot of unnecessary trouble. It is best to build a folder separately in a folder.

At the same time, the default directory of wwwroot can also be changed. Go to [Control Panel] → [Management Tools] → [Internet Service Manager], double-click it, the main interface of [Internet Information Server], find [computer name] in the form, and will appear after the expansion: [Default FTP Site], [Default Web Site], and [Default SMTP Virtual Server]. Click Right-click on the [Default Web Site], select [Properties], you can make IIS's configuration.

Special Note

Here, we focus on several important configurations:

1. [Property] → [Home Catalog], you can modify the default virtual path and the execution permission of the ASP file (other than the virtual directory needs to be changed, etc.). 2. [Property] → [Document], the default document means: if you only fill in index.asp in a virtual directory (if you are wwwroot) as the default document. Then when you enter http: // localhost or http://127.0.0.1, the default access file is index.asp, just like you visit http://www.flash8.net, actually Access an index file in Flash8.NET (such as default.asp or index.asp, etc.).

Now, your configuration has been completed. If your computer is in the LAN, other computers can access your website, just enter http: // your machine name, if you connect to the Internet, others can enter your IP address.

Try a try:

The first ASP program:

As mentioned above, considering the neatness of the virtual directory, and develop a good habit in daily work, we recommend that you create a folder for this ASP program. If we do it for the system disk: / inetpub / project1 /, we also give it a specified virtual directory. Right click on the "default Web site", choose [New] → [Virtual Directory], when IIS will guide you to the page of the [Virtual Directory Create Wizard], ask your alias for your virtual directory. We can give it a name P1, press [Next], in the actual target path, point to the system disk: / inetpub / project1 / all the way "next" to complete the configuration of the new directory.

In the past habits, writing the first project is to show "Hello World" to "advent" on behalf of his work, we don't break this rule. Write a new notebook file (.txt) in the directory of just configured:

<%

Response.write "Hello World My First ASP Program!"

%>

Saved as 1st.asp, then enter http://localhost/1st.asp or http://127.0.0.1/1st.asp test in the browser. The effect is shown in Figure 4.1.2:

Figure 4.1.2 First ASP program

how about it? After reading the demo, is you a feeling of jump? OK, Here We Go ~

Special Note

Don't put how complicated program imagination. As long as we rationally think about the road, then in accordance with this optimal idea to convert to the computer's "implementation method", all the problems will be solved.

转载请注明原文地址:https://www.9cbs.com/read-132740.html

New Post(0)