Asp. Net Configuration Guide in Linux

Source: Internet
Author: User
Asp. Net Configuration Guide in Linux-Linux Enterprise Application-Linux server application information. For details, see the following section. This article describes how to set up Asp on a Linux operating system. before reading this article, you must first determine that you have installed the Linux operating system and Mono Runtime. If you need mod_mono, you must first install and prepare Apache. For Mono installation and configuration, see here.
XSP

XSP is a lightweight Web server. It is a pure. Net application written in 100% C # code. Of course, it is completely open source code. XSP uses the class in the System. Web namespace to execute Asp. Net execution tasks. It can also run on Windows (using Microsoft. Net Framework ).

Relatively speaking, the installation and preparation of XSP are relatively simple. Its source code package is in: XSP web server 1.0

After downloading the package, run the tar zxfv xsp-1.0.tar.gz to decompress it. A directory named xsp-1.0 is generated under the current directory and compiled in the following order:

./Configuration
Make
Make install

After compilation, go to the "serversubdirectory". You can see that there is an executable file named xsp.exe, which is the main program of xsp.

Next we can perform the test work, there is a subdirectory named test under the xsp-1.0 directory, there are a lot of aspx files below, these are the test page that comes with the package, after entering the test directory, run:

Mono/... xsp directory.../server/xsp.exe

The following prompt is displayed:
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.
It indicates that the xsp has been listening on port 8080 (port 8080 by default). If you want to disable the server, press Enter.
Now you can open a Web browser and enter:

Http: // address of your server: 8080/

If everything works, you can see the test homepage.
XSP also has some Parameter options. Enter the -- help parameter to view the list and description of these options. Here is a brief introduction:

-- Port
Set the port number for XSP server listening. The default value is 8080. If XSP is the only WEB server on your server, you can set it to 80.

-- Adress
Set the IP address that the XSP server listens to. The default value is 0.0.0.0, indicating that requests are accepted on all addresses.

-- Root
Set the root directory of the website. The default directory is the current directory.

-- Appconfigfile
Configure the XSP configuration file. The configuration file is an XML file. You can "package" These Parameter options.

-- Appconfigdir
Set the XSP configuration file directory. If you cannot complete the configuration in a file (almost impossible), you can write the configuration information to multiple files, and xsp will read all the extensions in this directory. webapp configuration file.

-- Applications
Set the virtual directory of XSP. Multiple virtual directories can be set on an XSP server. The format is virtual directory name: real path. If there are multiple directories, separate them with semicolons.

-- Nonstop
Press enter to disable the server.

-- Version
Displays the XSP version number.

-- Verbose
Print some additional information for debugging.

Apache Mono module

The XSP mentioned above is a lightweight server, so this should be considered as a heavyweight (in fact, it is not unique, Apache is only a proxy request function here, the main processing is actually transferred to mod_mono). The Apache Mono module is a plug-in module of the Apache server, allowing the Apache server to support Asp.. Net application.

Mod_mono is downloaded from Apache Mono module 1.0. the download is also as follows:

./Configuration
Make
Make install

After compilation, you can prepare the apache server. Find your apache configuration file, which is usually located at:/etc/httpd/conf/httpd. conf, open the file using the vi editor, and add the following to the file:

LoadModule mono_module modules/libmod_mono.so
Alias/virtual directory name "real path"
MonoApplications "/virtual directory name: real path"

SetHandler mono


If your mono and xsp are not installed in the standard path, you need to add some additional parameters:

MonoExecutablePath: Set the mono execution path

MonoServerPath sets the path of the mod-mono-server.exe file. Note that this file is in the XSP software package. Therefore, set this file to the XSP path.

You can set these parameters, and set other Parameter options to the default value.

Now you can restart the Apache server and find the path of your apachectl command, which is usually in the/usr/sbin directory and then use:

Apachectl restart

Then you can open your browser and enter the server address and virtual directory to verify that the configuration is successful.
Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.