您的位置:首页 > 运维架构 > Apache

关于用apache发布asp.net网站的详细配置步骤

2011-11-17 08:41 627 查看
 
应用软件:apache_2.2.4、mod_aspdotnet-2.2.0.2006

发布环境:windows XP(测试)、windows 2003 server

配置步骤:

一、安装apache2.2.4和mod_aspdotnet-2.2.0.2006(必须安装)
安装完毕后,测试,在浏览器出入127.0.0.1回车

出现it works字样,成功。

二、打开安装目录中httpd.conf文件,尾部添加

#Asp.net

LoadModule aspdotnet_module "modules/mod_aspdotnet.so"

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

<IfModule mod_aspdotnet.cpp>

    # Mount the ASP.NET example application

    AspNetMount /wwwroot "f:/wwwroot"

    # Map all requests for /active to the application files

    Alias /wwwroot "f:/wwwroot"

    # Allow asp.net scripts to be executed in the active example

    <Directory "f:/wwwroot">

        Options FollowSymlinks ExecCGI

        Order allow,deny

        Allow from all

        DirectoryIndex index.aspx

    </Directory>

    # For all virtual ASP.NET webs, we need the aspnet_client files

    # to serve the client-side helper scripts.

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

    <Directory "C:/Windows/Microsoft.NET/Framework/v*/ASP.NETClientFiles">

        Options FollowSymlinks

        Order allow,deny

        Allow from all

    </Directory>

</IfModule>

其中,f:/wwwroot 是你机子上网站的根目录,例如使用vs编译器写C#WEB程序,网站写好后,通过Build/Publish发布到该目录内。/wwwroot是通过Apache来访问的路径,访问格式为在浏览器地址栏输入http://xxx.xxx.xxx.xxx/wwwroot/Default.aspx

 

 

 

 

 

 

 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息