windows下怎么将asp.net应用配置成虚拟主机运行

ylh1223 2005-11-21 03:28:03
我在windows下将asp.net应用配置成虚拟目录成功,但不知怎么配置成虚拟主机,请高人指点!
以下是我的配置:
在本机hosts文件加入了:
192.168.1.203 www.ylh.com

在apache中加入了:
NameVirtualHost 192.168.1.203:8088
<VirtualHost 192.168.1.203:8088>
ServerAdmin ylh@126.com
ServerName www.ylh.com
DocumentRoot "D:/work/OA4.5/oa/OA"
</VirtualHost>

在本机IE地址栏输入 http://www.ylh.com/Login.aspx 无法打开页面
在本机IE地址栏输入 http://192.168.1.203:8088/Login.aspx 也无法打开页面,不知道怎么回事?
...全文
178 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
ylh1223 2005-11-25
  • 打赏
  • 举报
回复
错误提示为:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, ylh811223@126.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


--------------------------------------------------------------------------------

Apache/2.0.55 (Win32) Server at oa.ylh.com Port 8088
ylh1223 2005-11-25
  • 打赏
  • 举报
回复
host文件中 192.168.1.203 www.ylh.com 改为 127.0.0.1 www.ylh.com 也不行
ylh1223 2005-11-25
  • 打赏
  • 举报
回复
to leakey8() :
host文件中加入了: 192.168.1.203 www.ylh.com

Apache的 httpd.conf 中加入了:
Listen 8088
NameVirtualHost *:8088
<VirtualHost *:8088>
ServerName www.ylh.com
DocumentRoot "D:/work/OA4.5/oa/OA"
</VirtualHost>
ping www.ylh.com 时显示IP为192.168.1.203 ,但是在IE中 输入 http://www.ylh.com/Login.aspx 就是找不到文件, 怎么回事?
leakey8 2005-11-24
  • 打赏
  • 举报
回复
刚刚看到一篇类似文章
多二级域名主机开发环境设置说明


第一步 DNS解析实现

找到本机的host文件
一般在 C:/WINNT/system32/drivers/etc

在文件结尾添加:

127.0.0.1 localhost
127.0.0.1 <a href="http://www.site.com" target="_blank">www.site.com</a>
127.0.0.1 home.site.com
127.0.0.1 mail.site.com
127.0.0.1 blog.site.com
127.0.0.1 music.site.com
127.0.0.1 bbs.site.com
127.0.0.1 download.site.com

第二步:apache 设置

打开httpd.conf

以music.site.com为例,其他栏目类似添加

在文件最后加入

1. 保证
Listen 80

2. 打开注释
NameVirtualHost *:80

3. 在末尾添加
<VirtualHost *:80>
ServerAdmin xxxx@msn.com
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/site/music"
ServerName music.site.com
</VirtualHost>
<VirtualHost *:80>
ServerAdmin xxxx@msn.com
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/site/blog"
ServerName blog.site.com
</VirtualHost>

...


重启即可。
在览器中打开 <a href="http://blog.site.com," target="_blank">http://blog.site.com,</a> 试一下
leakey8 2005-11-24
  • 打赏
  • 举报
回复
192.168.1.203
这是什么??你知道吗?这是局域网的IP地址。你能访问到吗?
还有Apache能运行ASP.NET程序??
晕,apache怎么不能运行asp.net程序!??
楼主你的配置好像没错,确定 Listen 8088 ??
ylh1223 2005-11-21
  • 打赏
  • 举报
回复
to moodboy1982(虎落平川被犬欺):
1: 我下载安装了apache支持asp.net的模块,所以可以运行asp.net,而且我也将asp.net应用配置成虚拟目录的方式,也成功了!
2: 我说的是在本地IE访问
moodboy1982 2005-11-21
  • 打赏
  • 举报
回复
192.168.1.203
这是什么??你知道吗?这是局域网的IP地址。你能访问到吗?
还有Apache能运行ASP.NET程序??

24,923

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Apache
社区管理员
  • Apache
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧