Configuring Apache for ASP.NET June 25, 2008
Posted by tuse in : ASP.NET, Technical , 3 commentsAs I mentioned in my first post, we will be running an Apache server using WAMP. Apache does not natively support ASP.NET pages. Whenever you preview an ASP.NET page from Visual Studio, it opens the page in the ASP.NET Development Server. However, in order to deploy the page on a network, you would need a server capable of processing ASP code.
So how do we configure Apache server so that it can serve ASP pages? For this, you would need an Apache module. You can get it here
Since our Apache came from WAMP, the default installation path for the module will need to be changed to “C:\wamp\bin\apache\apache2.2.8″ (or wherever your Apache is installed)
Next, you need to modify your httpd.conf file (the configuration file for Apache). To do so, Left Click your WampServer speedometer (the icon which appears in your taskbar whenever Wamp is running) -> goto Apache and there you can see the httpd.conf file. Add the following code anywhere in the file but make sure it does not fall inside the existing <IfModule> </IfModule> tags-
#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
# Mount the ASP.NET /asp application
AspNetMount /SampleASP "C:/wamp/www/SampleASP"
#/SampleASP is the alias name for asp.net to execute
#"c:/SampleASP" is the actual execution of files/folders in that location
# Map all requests for /asp to the application files
Alias /SampleASP "C:/wamp/www/SampleASP"
#maps /SampleASP request to "c:/SampleASP"
#now to get to the /SampleASP type http://localhost/SampleASP
#It'll redirect http://localhost/SampleASP to "c:/SampleASP"
# Allow asp.net scripts to be executed in the /SampleASP example
Options FollowSymlinks ExecCGI
Order allow,deny
Allow from all
DirectoryIndex index.htm index.aspx
#default the index page to .htm and .aspx
# 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"
Options FollowSymlinks
Order allow,deny
Allow from all
#asp.net
Next, in your Wamp www folder (the default folder where all website data is stored), create a folder named sampleASP and paste your ASP Website data there. In case you need to change the folder, modify the entires appropriately in the code snippet (i.e change it from
“C:/wamp/www/SampleASP” to the name you want).
On doing this I got the following error-
The current identity (NT AUTHORITY\SYSTEM) does not have write access to ‘C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files’.
To correct this, create a folder “C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files” and set permission to write to it.
As I have told you,
I am using Visual Studio 2008 Professional with Apache 2.2.8 (WampServer 2.0) on a Windows Vista machine.
One of my buddies on Windows XP did not get this error.
So once this is done, you have successfully configured your Apache to run ASP.NET pages.
As a check you should see a check mark in
‘aspnet_modules’ in the WAMP Speedometer under Apache Modules.
Hello World June 22, 2008
Posted by tuse in : Tools , 2 commentsIf you know nothing about VB.NET and ASP.NET, do not worry.
A month ago, we didn’t know too.
But now I can say that we are decent enough to create a few applications for the Windows platform.
These are the tools you’d need-
- Microsoft Visual Studio - The main Integrated Development Environment (IDE) used to create the applications. A free Express Edition is available directly from Microsoft which is best suited for student developers. You can get it here . We use Visual Studio 2008 Professional (Its a 90 day trial) which comes with the added power of Crystal Reports- something that we will discuss in posts to come.
- MySQL- If you are working with a lot of data you will need to keep it in a structured manner- in a database. We used MySQL. Why? Because its open source and more importantly, its free. Visual Studio comes with native support for SQL Server and certain configurations are needed to connect to a MySQL database. This will be a topic of discussion which will prove to be of a lot of use to many.
- Apache Server- As you might be aware, pages created with ASP.NET are run on a server. For testing on our local computer, we used the Apache server (again open source and free). Since the asp pages are intended to run on Windows Servers only, we did need to tweak a few settings here as well. (Don’t worry, we’ll explain these soon)
- WAMP - Well we didn’t have to bother downloading MySQL and Apache seperately. That is beacuse we used WAMP (Windows Apache MySQL PHP). It is a Windows web development environment which comes with Apache and MySql (and PHP). You can get it here. And yes, its free too.
So I guess once you are done with the downloads we are good to go.
