<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>apache aspx &#8211; LPC影子技术分享</title>
	<atom:link href="https://www.mudbest.com/tag/apache-aspx/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.mudbest.com</link>
	<description>行影不离,忘之却步.</description>
	<lastBuildDate>Mon, 01 Oct 2012 07:28:38 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>
	<item>
		<title>让apache2.2支持aspx的web server(%windows%)</title>
		<link>https://www.mudbest.com/%e8%ae%a9apache2-2%e6%94%af%e6%8c%81aspx%e7%9a%84web-serverwindows/</link>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Wed, 25 Apr 2012 08:42:05 +0000</pubDate>
				<category><![CDATA[分享]]></category>
		<category><![CDATA[apache aspx]]></category>
		<category><![CDATA[apache net]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=1057</guid>

					<description><![CDATA[在平时都是php的项目里，普通配置apache就够用了，突然来了一个.net的aspx应用程序网站，很坑的让a ... <a title="让apache2.2支持aspx的web server(%windows%)" class="read-more" href="https://www.mudbest.com/%e8%ae%a9apache2-2%e6%94%af%e6%8c%81aspx%e7%9a%84web-serverwindows/" aria-label="阅读 让apache2.2支持aspx的web server(%windows%)">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p>在平时都是php的项目里，普通配置apache就够用了，突然来了一个.net的aspx应用程序网站，很坑的让apache支持aspx，以下则是过程。</p>
<p>首先在apache官方下载win32的apache<br />
http://httpd.apache.org/download.cgi#apache22</p>
<p>在官方Modules专区下载aspx的扩展<br />
http://httpd.apache.org/modules/#mod_aspdotnet</p>
<p>下载完成后，直接安装至apache目录：如d:/server/apache2.2，则安装目录就是d:/server/apache2.2。<br />
安装完成后，你会发现在你的apache的Modules目录里有一个mod_aspdotnet.so的文件。这就代表需要的东西都齐了，剩下就是配置apache2了，使它能顺利支持aspx应用程序类的web网站。<span id="more-1057"></span></p>
<p><strong>在apache的配置文件httpd.conf的Modules加载项最下面增加如下代码：</strong><br />
去掉#Include conf/extra/httpd-vhosts.conf的注释，启用多域名。</p>
<pre class="brush: plain; title: ; notranslate">
#加载asp.net模块
LoadModule aspdotnet_module &quot;modules/mod_aspdotnet.so&quot;
#如果mod_aspdotnet加载成功
&lt;IfModule mod_aspdotnet.cpp&gt;
              AddHandler asp.net asax ascx ashx asmx aspx axd config cs csproj licx rem resources resx soap vb vbproj vsdisco webinfo
              # For all virtual ASP.NET webs, we need the aspnet_client files
              # to serve the client-side helper scripts.
              AliasMatch ^/(?i)aspnet_client/system_web/(\d+)_(\d+)_(\d+)_(\d+)/(.*) &quot;C:/WINNT/Microsoft.NET/Framework/v$1.$2.$3/ASP.NETClientFiles/$4&quot;
              
              &lt;Directory &quot;C:/WINNT/Microsoft.NET/Framework/v*/ASP.NETClientFiles&quot;&gt;
                            Options FollowSymlinks
                            Order allow,deny
                            Allow from all
              &lt;/Directory&gt;
&lt;/IfModule&gt;
</pre>
<p><strong>然后在httpd-vhosts.conf增加</strong></p>
<pre class="brush: plain; title: ; notranslate">
&lt;VirtualHost *:80&gt;
	&lt;IfModule mod_aspdotnet.cpp&gt;
			# 加载 ASP.NET 应用，当第一个参数为“/”时为整个虚拟主机都需要支持asp.net；也可以设置为虚拟目录，只要加上虚拟目录名即可，如AspNetMount /dotnet &quot;D:\Apache\Apache2\htdocs\dotnet&quot;
			AspNetMount / &quot;D:\web\aspx&quot;
	
			# 设置应用asp.net的虚拟目录，当整个虚拟主机都需要支持asp.net时不要设
			#Alias /dotnet &quot;$Apache_home\htdocs\dotnet&quot;
	
			# 允许 asp.net scripts 执行以下目录
			&lt;Directory &quot;D:\web\aspx&quot;&gt;
						  Options FollowSymlinks ExecCGI
						  Order allow,deny
						  Allow from all
			&lt;/Directory&gt;
	&lt;/IfModule&gt;
	ServerAdmin hkshadow@sina.com
	DocumentRoot &quot;D:\web\aspx&quot;
	ServerName aspx.mudbest.com
	ErrorLog &quot;logs/aspx.mudbest.com-error.log&quot;
	CustomLog &quot;logs/aspx.mudbest.com-access.log&quot; common	
&lt;/VirtualHost&gt;
</pre>
<p><strong>这个设置是没有配置虚拟主机的设置，Apache默认的主机根目录是htdocs，你在应用中要把$Apache_home改成Apache安装目录。</strong></p>
<p><strong>增加测试页面 index.aspx</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;script runat=&quot;server&quot;&gt;
&lt;/script&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;; &gt;
&lt;head runat=&quot;server&quot;&gt;
    &lt;title&gt;Hello World! - mod_aspdotnet&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
    &lt;div&gt;
        &lt;% Response.Write(&quot;&lt;h1&gt;Hello World!&lt;/h1&gt;&quot;)%&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>试运行看看结果？<br />
^-^ -> hello word&#8230;<br />
说明你的配置是正确的，现在你可以在Apache中使用ASP.Net了。</p>
<p><strong>* 注意：由于apache本身对于url的目录和文件名是大小写敏感的，所以asp.net的虚拟目录必须要注意大小写，否则访问的时候不会出错，不过将会找不到任何的文件，就像访问一个空的目录一样。除了虚拟目录名外，由于其它的aspx文件是mod_aspdotnet模块载入的，所以又仍然是非大小写敏感的。</strong></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
