{"id":422,"date":"2008-10-30T12:43:07","date_gmt":"2008-10-30T11:43:07","guid":{"rendered":"http:\/\/www.galhano.com\/blog\/?p=422"},"modified":"2008-10-30T12:43:07","modified_gmt":"2008-10-30T11:43:07","slug":"how-to-make-apache-run-aspnet-aspnet-20","status":"publish","type":"post","link":"http:\/\/galhano.com\/blog\/?p=422","title":{"rendered":"How to make Apache run ASP.NET \/ ASP.NET 2.0"},"content":{"rendered":"<p><span style=\"color: #000000;\">Artigo interessante de Ohad&#8217;s Blog<\/span><\/p>\n<p><span style=\"color: #000000;\">Link: <\/span><a href=\"http:\/\/weblogs.asp.net\/israelio\/archive\/2005\/09\/11\/424852.aspx\"><span style=\"color: #000000;\">http:\/\/weblogs.asp.net\/israelio\/archive\/2005\/09\/11\/424852.aspx<\/span><\/a><\/p>\n<p><!--more--><\/p>\n<p><span style=\"color: #ff0000;\"><strong>Even worked with ASP.NET 2.0 Site !<\/strong><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; color: navy; font-family: Arial;\">Following are the instruction to make Asp.Net work under apache:<\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"color: navy; mso-list: l0 level1 lfo6;\"><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\"><strong>\u00e2\u20ac\u201c Install <\/strong><a href=\"http:\/\/www.apache.org\/dist\/httpd\/binaries\/win32\/apache_2.0.54-win32-x86-no_ssl.msi\" target=\"_blank\"><strong>Apache 2.0.54<\/strong><\/a><\/span><\/span><strong> <\/strong><\/p>\n<p class=\"MsoNormal\" style=\"color: navy; mso-list: l0 level1 lfo6;\"><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\"><strong>\u00e2\u20ac\u201c Install <\/strong><a href=\"http:\/\/www.apache.org\/dist\/httpd\/mod_aspdotnet\/mod_aspdotnet-2.0.0.msi\" target=\"_blank\"><strong>Mod_AspDotNet<\/strong><\/a><\/span><\/span><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><\/span><\/p>\n<p class=\"MsoNormal\" style=\"color: navy; mso-list: l0 level1 lfo6;\"><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\"><strong>\u00e2\u20ac\u201c Add\u00c2 at the end of\u00c2 C:\\Program Files\\Apache Group\\Apache2\\conf\\httpd.conf the following lines<\/strong><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"color: navy; mso-list: l0 level1 lfo6;\"><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\"><span style=\"color: #009f00;\">#asp.net<\/span><br \/>\nLoadModule aspdotnet_module &#8220;modules\/mod_aspdotnet.so&#8221; <\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"color: navy; mso-list: l0 level1 lfo6;\"><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\">AddHandler asp.net asax ascx ashx asmx aspx axd config cs csproj licx rem resources resx soap vb vbproj vsdisco webinfo<br \/>\n<\/span><\/span><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\"><br \/>\n&lt;IfModule mod_aspdotnet.cpp&gt;\u00c2<br \/>\n<\/span><\/span><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\">\u00c2  <span style=\"color: #009f00;\"># Mount the ASP.NET \/asp application<br \/>\n<\/span>\u00c2  AspNetMount \/SampleASP &#8220;c:\/SampleASP&#8221;<br \/>\n\u00c2  <span style=\"color: #009f00;\">#\/SampleASP is the alias name for asp.net to execute<br \/>\n\u00c2  #&#8221;c:\/SampleASP&#8221; is the actual execution of files\/folders\u00c2  in that location <\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"color: navy; mso-list: l0 level1 lfo6;\"><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\">\u00c2  <span style=\"color: #009f00;\"># Map all requests for \/asp to the application files<br \/>\n<\/span>\u00c2  Alias \/SampleASP &#8220;c:\/SampleASP&#8221;<br \/>\n\u00c2  <span style=\"color: #009f00;\">#maps \/SampleASP request to &#8220;c:\/SampleASP&#8221;<br \/>\n\u00c2  #now to get to the \/SampleASP type <\/span><a href=\"http:\/\/localhost\/SampleASP\"><span style=\"color: #009f00;\">http:\/\/localhost\/SampleASP<\/span><\/a><span style=\"color: #009f00;\"><br \/>\n\u00c2  #It&#8217;ll redirect <\/span><a href=\"http:\/\/localhost\/SampleASP\"><span style=\"color: #009f00;\">http:\/\/localhost\/SampleASP<\/span><\/a><span style=\"color: #009f00;\"> to &#8220;c:\/SampleASP&#8221;<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"color: navy; mso-list: l0 level1 lfo6;\"><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\">\u00c2 <span style=\"color: #009f00;\"> # Allow asp.net scripts to be executed in the \/SampleASP example<br \/>\n<\/span>\u00c2  &lt;Directory &#8220;c:\/SampleASP&#8221;&gt;<br \/>\n\u00c2 \u00c2 \u00c2  Options FollowSymlinks ExecCGI<br \/>\n\u00c2 \u00c2 \u00c2  Order allow,deny<br \/>\n\u00c2 \u00c2 \u00c2  Allow from all<br \/>\n\u00c2 \u00c2 \u00c2  DirectoryIndex index.htm index.aspx<br \/>\n\u00c2 \u00c2  <span style=\"color: #009f00;\">#default the index page to .htm and .aspx<br \/>\n<\/span>\u00c2  &lt;\/Directory&gt; <\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"color: navy; mso-list: l0 level1 lfo6;\"><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\">\u00c2  <span style=\"color: #009f00;\"># For all virtual ASP.NET webs, we need the aspnet_client files<br \/>\n\u00c2  # to serve the client-side helper scripts.<br \/>\n<\/span>\u00c2  AliasMatch \/aspnet_client\/system_web\/(\\d+)_(\\d+)_(\\d+)_(\\d+)\/(.*) &#8220;C:\/Windows\/Microsoft.NET\/Framework\/v$1.$2.$3\/ASP.NETClientFiles\/$4&#8221;<br \/>\n\u00c2  &lt;Directory &#8220;C:\/Windows\/Microsoft.NET\/Framework\/v*\/ASP.NETClientFiles&#8221;&gt;<br \/>\n\u00c2 \u00c2 \u00c2  Options FollowSymlinks<br \/>\n\u00c2 \u00c2 \u00c2  Order allow,deny<br \/>\n\u00c2 \u00c2 \u00c2  Allow from all<br \/>\n\u00c2  &lt;\/Directory&gt;<br \/>\n<\/span><\/span><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\">&lt;\/IfModule&gt;<br \/>\n<\/span><\/span><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\"><span style=\"color: #009f00;\">#asp.net<\/span> <\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"color: navy; mso-list: l0 level1 lfo6;\"><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><\/span><strong><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\">\u00e2\u20ac\u201c Create a directory c:\\SampleASP and insert in it the index.aspx<\/span><\/span> <\/strong><\/p>\n<p class=\"MsoNormal\" style=\"color: navy; mso-list: l0 level1 lfo6;\"><strong><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\">\u00e2\u20ac\u201c Restart apache server :<br \/>\n\u00c2 \u00c2  Start-&gt;<\/span><\/span><span style=\"color: #000000;\"><span style=\"color: windowtext;\">\u00c2 <\/span><\/span><span style=\"font-size: x-small; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\">Apache HTTP Server 2.0.54 -&gt;<br \/>\n\u00c2 \u00c2  Control Apache Server -&gt; Restart<\/span><\/span><\/strong><\/p>\n<p class=\"MsoNormal\" style=\"color: navy; mso-list: l0 level1 lfo6;\"><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; font-family: Arial;\"><strong>\u00e2\u20ac\u201c Open Explorer and navigate to <\/strong><a title=\"http:\/\/localhost\/SmartASP\/index.aspx\" href=\"http:\/\/localhost\/SampleASP\/index.aspx\"><strong>http:\/\/localhost\/SampleASP\/index.aspx<\/strong><\/a><strong> <\/strong><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; color: navy; font-family: Arial;\"><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-size: x-small; color: #000080; font-family: Arial;\"><span style=\"font-size: 10pt; color: navy; font-family: Arial;\">If everything worked fine you should get a nice asp.net page working.<\/span><\/span><\/p>\n<p><a href=\"http:\/\/www.apache.org\/dist\/httpd\/mod_aspdotnet\/mod_aspdotnet-2.0.0.msi\"><\/a><strong>\u00c2 \u00e2\u20ac\u201d index.aspx \u00e2\u20ac\u201d<\/strong><\/p>\n<p>&lt;%@ Page Language=&#8221;VB&#8221; %&gt;<br \/>\n&lt;html&gt;<br \/>\n\u00c2 \u00c2  &lt;head&gt;<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;link rel=&#8221;stylesheet&#8221;href=&#8221;intro.css&#8221;&gt;<br \/>\n\u00c2 \u00c2  &lt;\/head&gt;\u00c2<br \/>\n\u00c2 \u00c2  &lt;body&gt;\u00c2<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;center&gt;\u00c2<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;form action=&#8221;index.aspx&#8221; method=&#8221;post&#8221;&gt;\u00c2<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;h3&gt; Name: &lt;input id=&#8221;Name&#8221; type=text&gt;\u00c2<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  Category:\u00c2  &lt;select id=&#8221;Category&#8221; size=1&gt;\u00c2<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;option&gt;One&lt;\/option&gt;<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;option&gt;Two&lt;\/option&gt;<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;option&gt;Three&lt;\/option&gt;<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;\/select&gt;\u00c2<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;\/h3&gt;\u00c2<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;input type=submit value=&#8221;Lookup&#8221;&gt;\u00c2<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;p&gt;\u00c2<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;% Dim I As Integer<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  For I = 0 to 7 %&gt;<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;font size=&#8221;&lt;%=I%&gt;&#8221;&gt; Sample ASP.NET TEST&lt;\/font&gt; &lt;br&gt;<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;% Next %&gt;\u00c2<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;\/form&gt;\u00c2<br \/>\n\u00c2 \u00c2 \u00c2 \u00c2 \u00c2 \u00c2  &lt;\/center&gt;\u00c2<br \/>\n\u00c2 \u00c2  &lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Artigo interessante de Ohad&#8217;s Blog Link: http:\/\/weblogs.asp.net\/israelio\/archive\/2005\/09\/11\/424852.aspx<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"close","ping_status":"close","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,4],"tags":[170],"class_list":["post-422","post","type-post","status-publish","format-standard","hentry","category-apache","category-aspnet","tag-aspnet","author-admin"],"_links":{"self":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=422"}],"version-history":[{"count":0,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/422\/revisions"}],"wp:attachment":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=422"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}