zoukankan      html  css  js  c++  java
  • 用 Apache 发布 ASP.NET 网站

    由于服务器需要发布 JSP 、PHP、ASP.NET 几种网站进行测试,Apache 肯定是支持 JSP  和 PHP 。鉴于 Apache 的开放精神 ,ASP.Net 应该也是支持的,于是乎 Google之。配置步骤如下:

    1.下载 ASP.NET 解析模块(mod_aspdotnet )

    下载地址:http://sourceforge.net/projects/mod-aspdotnet/ ,直接安装。在...apachemodules目录下会出现一个名为 mod_aspdotnet.so 的模块。

    2.配置 Apache 使其支持此模块

    创建配置文件 mod_aspdotnet.conf, 保存在 ...apacheconf 目录下,其内容如下:

    [plain] view plain copy
     
    1. # ASP.NET Support  
    2. LoadModule aspdotnet_module modules/mod_aspdotnet.so  
    3.   
    4. AddHandler asp.net asax ascx ashx asmx aspx axd config cs csproj licx rem resources resx soap vb vbproj vsdisco webinfo   
    5.   
    6. <IfModule mod_aspdotnet.cpp>  
    7.     # Mount the ASP.NET example application  
    8.     AspNetMount /aspnet "f:/demo"  
    9.     # Map all requests for /active to the application files  
    10.     Alias /aspnet "f:/demo"  
    11.   
    12.     # Allow asp.net scripts to be executed in the active example  
    13.     <Directory "f:/demo">  
    14.         Options FollowSymlinks ExecCGI  
    15.         Order allow,deny  
    16.         Allow from all  
    17.         DirectoryIndex index.aspx Default.aspx index.html  
    18.     </Directory>  
    19.   
    20.     # For all virtual ASP.NET webs, we need the aspnet_client files  
    21.     # to serve the client-side helper scripts.  
    22.     AliasMatch /aspnet_client/system_web/(d+)_(d+)_(d+)_(d+)/(.*) "C:/Windows/Microsoft.NET/Framework/v$1.$2.$3/ASP.NETClientFiles/$4"  
    23.     <Directory "C:/Windows/Microsoft.NET/Framework/v*/ASP.NETClientFiles">  
    24.         Options FollowSymlinks  
    25.         Order allow,deny  
    26.         Allow from all  
    27.     </Directory>  
    28. </IfModule>  

    注意:下面两句不能换行,且网站本地路径中不能包含中文字符。

    AddHandler asp.net asax ascx ashx asmx aspx axd config cs csproj licx rem resources resx soap vb vbproj vsdisco webinfo

    AliasMatch /aspnet_client/system_web/(d+)_(d+)_(d+)_(d+)/(.*) "C:/Windows/Microsoft.NET/Framework/v$1.$2.$3/ASP.NETClientFiles/$4"

    然后再 httpd.conf 文件末尾添加

    [plain] view plain copy
     
    1. #mod_aspdotnet support  
    2. Include conf/mod_aspdotnet.conf  

    最后重启 Apache 即可。

    3. 测试

    编写测试页default.aspx,放在“f:/demo” 目录下

    输入测试页:http://localhost:8080/aspnet/default.aspx

  • 相关阅读:
    C语言01
    C++面试总结更新
    Python网络爬虫与信息提取02
    Self-Driving Car 01
    Python网络爬虫与信息提取01
    Python-03
    Shell
    Python-05
    Python-04
    Python-02
  • 原文地址:https://www.cnblogs.com/soundcode/p/6905314.html
Copyright © 2011-2022 走看看