简体   繁体   English

IIS7和经典ASP及其应用程序和路径

[英]IIS7 and Classic ASP and Applications and Paths

I yesterday received a zip file containing an old asp site from 2005. Its came in a folder called ivx . 昨天我收到了一个包含2005年旧asp站点的zip文件。它位于一个名为ivx的文件夹中。

I've unzipped ivx to c:\\inetpub\\wwwroot and then created an application in IIS called ivxapp and pointed it to c:\\inetpub\\wwwroot\\ivx . 我已经将ivx压缩到c:\\inetpub\\wwwroot ,然后在IIS创建了一个名为ivxapp的应用程序,并将其指向c:\\inetpub\\wwwroot\\ivx Now when I type http://localhost/ivxapp , I am able to access the index page. 现在,当我输入http://localhost/ivxapp ,我可以访问索引页面。

My problem is, whoever designed that site, designed it when IIS5 or IIS6 was around. 我的问题是,由谁设计那个网站,都是在IIS5或IIS6出现时设计的。 He's used paths like <a href=""/new_posts.asp"">more...</a> which leads to http://localhost/new_posts.asp and not http://localhost/imagevertex/new_posts.asp 他使用了<a href=""/new_posts.asp"">more...</a>这样的路径,该路径指向http://localhost/new_posts.asp而不是http://localhost/imagevertex/new_posts.asp

The whole site is some 21000 lines of code and contains many many references like this. 整个站点大约有21000行代码,并包含许多类似的参考。 Then comes the problem with <!--#include virtual = "/common/adminverify.asp" --> 然后出现<!--#include virtual = "/common/adminverify.asp" -->

Instead of having to manually edit the entire code, do you know a way to get things going? 您不必手动编辑整个代码,而是知道一种使事情顺利进行的方法吗?

This site worked perfectly well on a production server. 该站点在生产服务器上运行良好。 Right now it's on my local machine on Windows 7 64 home premium. 现在,它在Windows 7 64家庭高级版上的本地计算机上。

Yes, you need to give this site a root-URL of its own, and not run it in a subdirectory of your localhost. 是的,您需要为该站点提供一个自己的根URL,而不要在本地主机的子目录中运行它。

This is more of a web-administration question, but what you need to do is either run it under "localhost" directly, or add a domain-name to your network to run this site under. 这更多的是网络管理问题,但是您需要做的是直接在“ localhost”下运行它,或者将一个域名添加到您的网络中以在下面运行此站点。 The easiest for you right now is probably the first option. 目前最方便的选择可能是第一选择。

If you aren't running a different site under localhost already: 如果您尚未在localhost下运行其他站点:

Go to the IIS manager and click the 'localhost' site. 转到IIS管理器,然后单击“本地主机”站点。 On the right side of the IIS interface you can change the basic settings. 在IIS界面的右侧,您可以更改基本设置。 Point the physical path to the ivx directory. 将物理路径指向ivx目录。 You can reach the site directly on http://localhost . 您可以直接在http://localhost上访问该站点。

If you are already running a site under localhost you need to keep: 如果您已经在本地主机下运行站点,则需要保留以下内容:

Now, if you -are- already running a site on your localhost, the second easiest option is to run the ivx site under localhost, but on a different port. 现在,如果您已经在本地主机上运行站点,则第二个最简单的选择是在本地主机下但不在其他端口上运行ivx站点。 To accomplish that, click on the current ivx site in IIS, change the path in the same way as descibed above, and after that click on "bindings" in IIS, and change the PORT for the ivx site to something other than 80, for example 81. 为此,请单击IIS中的当前ivx站点,以与上述相同的方式更改路径,然后单击IIS中的“绑定”,然后将ivx站点的PORT更改为80以外的其他值,示例81。

The ivx site will then run on http://localhost:81 , your current localhost will still run on http://localhost . 然后,ivx站点将在http://localhost:81 ,您当前的本地主机仍将在http://localhost上运行。

The hard way: adding a host to your network or PC: 困难的方法:将主机添加到网络或PC:

The last option is to add a new hostname for the site to your network. 最后一个选项是将站点的新主机名添加到您的网络。 You can add an A-record in your DNS for the ip-address of your server or add a host name to your HOSTS file in Windows on your server ("server" in the sense of the machine that runs the site, which can also be your local machine) You can add a made-up name to the ip-address of the server, and in IIS' bindings add that name under "host name". 您可以在DNS中为服务器的ip地址添加A记录,也可以在服务器上Windows的HOSTS文件中添加主机名(在运行该站点的机器的意义上为“服务器”,您可以在服务器的IP地址上添加一个虚构名称,并在IIS的绑定中将该名称添加到“主机名”下。 this way you can run two different sites on the same machine, the "host name" seeting in IIS will make sure that calls to that specific hostname will reach the correct site. 这样,您可以在同一台计算机上运行两个不同的站点,IIS中出现的“主机名”将确保对特定主机名的调用将到达正确的站点。 Adding it to the DNS of your network, or the HOST file in Windows will make sure the name is resolved to the correct machine (your webserver). 将其添加到网络的DNS或Windows中的HOST文件中,将确保名称解析为正确的计算机(您的网络服务器)。

This last option is a little tricky of you've never done something like this before, but the first option works just as well. 最后一个选项有些棘手,因为您以前从未做过这样的事情,但是第一个选项同样有效。

Good luck! 祝好运!

Erik 埃里克

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM