views:

454

answers:

9

For a developer with a Java background, I am interested in exploring software development using the ASP.NET tools/platform as well.

Java web applications (.jsp and servlets) can run on many server platforms.

Question: Will a .NET web application be able to run in a Linux based server? Considering the scenario of not being able to use a Windows server for hosting a web app.

+1  A: 

For ASP.NET on Linux, check out Mono.

That said, thousands of sites run on Windows Server without any issues. A poorly-configured server with any OS will be vulnerable; Linux won't save you from a poor admin.

So I guess my "best practice" for deplying an ASP.NET app would be to use Windows Server 2008 (likely Web edition). And hire a good administrator.

dahlbyk
thank you so much
lakshmanan
what about antivirus problem.. windows requires antivirus software.. i think so that will increase cost of the server side area..am i right ?
lakshmanan
Most "server" editions of anti-virus products are more expensive than their "desktop" editions, often several times more, mainly due to the expected usage. I'd recommend AVG (www.avg.com), ESET (www.eset.com), or Computer Associates (www.ca.com).
devstuff
A: 

You can use Mono to run ASP.NET applications on Apache/Linux, however it has a limited subset of what you can do under Windows. As for "they" saying Windows is more vulnerable to attack - it's not true. IIS has had less security problems over the last couple of years that Apache, but in either case it's all down to the administration of the boxes - both OSes can be easily secured. These days the attack points are not the OS or web server software, but the applications themselves.

blowdart
do you mean like... Linux servers can also be vulnerable to attacks ???
lakshmanan
anything could be vulnerable. nothing is secure unless it's turned off and disconnected from the network
blowdart
A: 

There is the Mono Project from Novell that will allow you to run ASP.Net on Apache.

http://www.mono-project.com/Main_Page

Jared
+9  A: 

It depends what specific .NET technologies you're using. The Mono Project provides an Apache module (mod_mono) for running ASP.NET sites, and from what I gather it works well.

Mono doesn't support all the .NET APIs, though - notably WPF (and possibly WCF too, I can't remember) - but it does provide good support for much else of the framework.

If you're starting from scratch and particularly want to target non-Windows servers, then ensuring your project works with Mono would be a good goal to aim for. However, if you need particular APIs or language features that are not supported by Mono, then you will need to use a Windows server for deployment. It's a design-time/architectural choice that should make up front.

alastairs
fyi, the mono project maintainer has an answer in this question as well.
Joel Coehoorn
+1  A: 

Yes we can. get familiar with Mono Project and read this article to get started.

dde
A: 

Now a days .Net is run in multiple platforms,like linux ,Mac os etc. but mono is not fully platform independent ,Because to deploy .NET in another OS required third party software.so it is not like java platform independent.

Mono is running in different platform ,because of JIT is there in different os.

Mono is not fully success in moonlight(silver light in .NET) .Not only Research is going on.

Mono uses XSP2 server or apache . some of the big companies are using this project,Some of the robotic project are also running on mono.

For more details http://www.mono-project.com/Main_Page.

anishmarokey
A: 

The Mono project is your best option. However, it has a lot of pitfalls (like incomplete API support in some areas), and it's legally gray (people like Richard Stallman have derided the use of Mono because of the possibility of Microsoft coming down on Mono by using its patent rights, but that's another story).

Anyway, Apache supports .NET/Mono through a module, but the last time I checked the version supplied with Debian, it gave Perl language support only; I can't say if it's changed since, perhaps someone else can correct me there.

Ben
+2  A: 

You might want to consider this guide that helps Windows developers port their code to Mono/Linux:

http://mono-project.com/Guide:_Porting_ASP.NET_Applications

miguel.de.icaza
A: 

I can speak from experience. Even if your ASP.net website only uses .NET libraries supported by Mono you are going to have a hard time getting it to run if its anything beyond Hello World.

You won't have to re-write much code but you will spend hours/days/weeks dealing with little issues with mod_mono/xsp/apache configuration and file permissions and error handling and all the little things that go into a large website. (Be prepared to spend a lot of time asking questions on serverfault :) )

The problem is that a lot of people don't use Mono for ASP.net websites and so there aren't as many people reporting bugs so a lot of things that are minor bugs go un-fixed for a long time.

thelsdj