Tuesday, April 25, 2017

host asp.net on linux host

1- install xsp, asp.net standalone webserver
$ sudo apt-get install mono-xsp

2- create a directory call asp.net and create the following file

$ sudo mkdir asp.net
$ cd asp.net

- for debug purpose, Web.Config

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>



- time.aspx
<%@ language="C#"%>
<%@ Import namespace="System.IO" %>

<!DOCTYPE html>
<html>
<body>
     <h1>ASP Pages</h1>
     <p>The time is <%= DateTime.Now.ToLongTimeString()  %>
</p>
</body>
</html>



3- run xsp to start the standalone webserver
$ xsp

4- to access it use the following url
http://server-ip-address:9000/time.aspx


No comments:

Post a Comment