ASP.net This article will describe how to build a asp.net service on a Linux operating system, before reading this article, readers must first determine that they have installed the Linux operating system, Mono Runtime, if you need to use Mod_mono, You also need to first complete the installation and configuration of Apache. Mono installation and configuration please refer to here.
xSP
XSP is a lightweight Web server that is written in 100% C # code Pure. NET application. Of course, it is also completely exposed to the source code. XSP uses classes under the System.Web namespace to perform asp.net tasks, and it can also run on Windows (using the Microsoft. Net Framework).
In contrast, XSP installation and configuration is relatively simple, its source code package download address is: XSP Web Server 1.0
After downloading the package, execute: Tar zxfv xsp-1.0.tar.gz to complete the decompression, will generate a directory called xsp-1.0 in the current directory, after entering the directory, compile in the following order:
./configuration
Make
Make install
After compiling and entering the server subdirectory, you can see that there is an executable file named Xsp.exe, which is the main program of XSP.
The next step is to test the xsp-1.0 directory with a subdirectory named Test, followed by a number of ASPX files, which are the test pages that come with the package, and, after entering the test directory, perform the following:
Mono/...xsp Directory .../server/xsp.exe
Join See the following message:
Adding Applications '/:. ' ...
Registering Application:
Host:any
Port:any
Virtual Path:/
Physical path:/
Listening on port:8080
Listening on address:0.0.0.0
Root Directory:/
Hit return to stop the server.
Indicates that XSP has been listening on port 8080 (default is 8080) and hit enter if you want to shut down the server.
You can now open a Web browser and enter directly:
http://the address of your server: 8080/
If everything is normal, you can see the test home page.
XSP also has some parameter options, and you can see a list and description of these options by entering--help parameters. Here's a simple introduction:
--port
Set XSP server listener port number, default is 8080, if XSP is the only Web server on your server, you can set it to 80.
--adress
Sets the IP address that the XSP server listens to, by default 0.0.0.0, which indicates that the request is accepted at all addresses.
--root
Sets the root directory of the Web site, which defaults to the current directory.
--appconfigfile
Sets the configuration file for the XSP. A configuration file is an XML-formatted file that can be packaged and configured with these parameter options.
--appconfigdir
Sets the configuration file directory for the XSP. If you can't finish the configuration in a file (almost impossible), you can write the configuration information to multiple files, and XSP will read all the configuration files with the. webapp extension in this directory.
--applications
Sets the virtual directory for the XSP. A XSP server can set up multiple virtual directories, in the form of a virtual directory name: The true path, if there are multiple, separated by semicolons.
--nonstop
Hit enter does not shut down the server.
--version
Displays the version number of the XSP.
--verbose
Print out some additional information, mainly used to adjust the trial.
Apache Mono Module
The XSP described earlier is a lightweight server, then this should be counted as a heavyweight (in fact also not where to go, Apache here is just a proxy request function, the main processing is actually turned to Mod_mono), Apache Mono Module is an add-on to the Apache server that allows the Apache server to support asp.net applications.
Mod_mono is downloaded at Apache Mono Module 1.0 and is also available after downloading:
./configuration
Make
Make install
After compiling, you can configure the Apache server to find your Apache profile, typically located in:/etc/httpd/conf/httpd.conf, using the VI Editor to open the file, and add in the file:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service