hihi,

i'm new to apache. was just wondering whether it is possible to run asp or asp.net on apache. if so, is there any sites i can gather further information.

if not, does this mean only IIS can process asp and asp.net?

Dani AI

Generated

Update for an old thread: the story depends on which "ASP" is meant and on how much work is acceptable to get parity with IIS. For modern apps the recommended route is to use ASP.NET Core (cross‑platform) and run the app as a Kestrel process with Apache as a reverse proxy. That pattern keeps TLS, virtual hosts and static caching in Apache while letting Kestrel serve the .NET app; Microsoft documents this hosting model and explains the forwarded‑headers requirements. (learn.microsoft.com)

Practical Apache example (typical minimal VirtualHost that proxies to a Kestrel app listening on localhost:5000):

<VirtualHost *:80>
  ServerName example.com

  ProxyPreserveHost On
  ProxyRequests Off

  ProxyPass "/" "http://127.0.0.1:5000/"
  ProxyPassReverse "/" "http://127.0.0.1:5000/"

  <Proxy *>
    Require all granted
  </Proxy>
</VirtualHost>

This requires mod_proxy (and mod_proxy_http) enabled in Apache and the app configured to accept forwarded headers (X-Forwarded-Proto / X-Forwarded-For). Use a process manager (systemd) to run the dotnet process so the app starts on boot and restarts on failure. (httpd.apache.org)

Legacy clarification: the old .NET Framework (classic ASP.NET / System.Web) is Windows‑only by design; the community project Mono historically provided a way to run many ASP.NET apps on Apache (mod_mono / XSP), but there are API gaps and compatibility caveats for production workloads. Classic "ASP" (VBScript .asp) is an IIS feature and is generally tied to Windows/IIS. These tradeoffs explain the mixed advice in earlier posts from and . (learn.microsoft.com)

MySQL: .NET apps (Core and Framework) can use MySQL via Connector/NET or the community MySqlConnector and EF Core providers like Pomelo; these libraries are the supported path for database access on Linux hosts. For a beginner needing MySQL + ASP, the lowest‑friction choices are: host legacy ASP/ASP.NET on Windows/IIS, or start new work on ASP.NET Core and deploy on Linux with Apache as reverse proxy. (github.com)

Short notes: keep TLS at Apache (or a load balancer), run Kestrel as a systemd service, enable Forwarded Headers middleware in the app, and only consider Mono/mod_mono for legacy apps that cannot be ported.

Recommended Answers

All 6 Replies

Even though ASP.NET was written specifically for the Windows Platform there has been a really active movement in the Linux community to bring C# and the .NET framework over to their OS as well. This project is called Mono. From what I've read it is indeed possible to run ASP.NET with a C# code base on an Apache Linux based system.

Please realize that this is latest technology and literally hasn't been out yet for more than a couple months. You'll be exploring a new type of system setup. I has and can be done. In fact, I've just installed Fedora Core 2 in hopes of trying out the mono project and possibly ASP.NET in a linux environment as well.

Hope this answers your question. If not, I'll see what I can do, as will others on this board.

Just be aware, that while it does support most of ASP.NET, some parts are lacking, and some parts are missing. My CMS, #Portal, does not run on mono, because of its lacking Mobile device support (the System.Web.Mobile namespace).

But, I'm happy to say I have Mono working great on Mac OS X (BSD Core), with XSP serving ASP.NET Web Pages. I'm sure I could configure mod_mono for Apache, but XSP was just easier ;-).

1) while there are limitations as you said, is there any complications?
2) how about running it on apache windows based?

thanks in advance. just wanted to clarify before i start developing on this platforms. I need to use mySQL and ASP/ASP.Net. I know apache should have no problems with mySQL but not sure it'll be compatible with ASP/ASP.NET.

3) Any suggestions? Or I should just stick to IIS for a beginner.

can i run asp.net pages on linux servers?. and if it is possible then how to create virtual directory on linus server. i am desperate for the solution. please reply fast

Ive not used apache, but the ASP.NET support in Aprelium's Abyss Web Server was good. I think it only runs on Windows, though.

Mono's version of IIS for Linux is called XSP or something i think....

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.