Use Apache2+mono 3.2.8 to configure the ASP. 14.04 in Ubuntu 4.0 Web site

Source: Internet
Author: User

The article assumes that you have installed the Apache2+mono 3.2.8+mysql, if not installed please self-degree Niang, the article has a lot, but about apache2 and mono in Ubuntu 14.04 LTS configuration article is very few, so record down.

This article is not a step-by-step tutorial, but rather an understanding of apache2 and mono.

In Ubuntu 14.04 lts apache2 Configuration directory and the previous version somewhat different, the most obvious is not httpd.conf this configuration file, the following is the configuration directory

apache2.conf:apache2 's main configuration file

conf-available: all available configuration files

CONF.D: This directory is empty after initial installation of Apache2

conf-enabled:apache2-enabled configuration file

mods-available and mods-enabled: separately available components and enabled components

ports.conf:apache2 Server Global port configuration file

sites-available and sites-enabled: available sites and enabled sites, respectively

Using commands

sudo vi apache2.conf
Go to edit/view apache2.conf file (This is Apache2 's main profile), there is a description, apache2 configuration file is divided into several configuration files (in the directory of the Tablets), open apache2.conf file will find the following code:

Includeoptional mods-enabled/*.loadincludeoptional mods-enabled/*.confinclude ports.conf

At the bottom of the apache2.conf configuration file, there are two more lines

Includeoptional conf-enabled/*.confincludeoptional sites-enabled/*.conf

This is apache2 all the configuration files under Ubuntu 14.04 lts.

The commands to enable/disable components (mods) and enable/disable configuration files are

sudo a2enmod xxxsudo a2dismod xxxsudo a2enconf xxx.confsudo a2disconf xxx.conf
Remember to restart the APACHE2 service after operation

sudo service apache2 restart

to enable a different port configuration site under Apache2

1, selected as 81 port for example port, with VI open ports.conf

sudo vi ports.conf
Add monitoring for 81 ports,


2. Add a new site configuration file

Enter the/etc/apache2/site-available directory, copy the 000-default.conf to a new file xxx.conf, and enter VI edit as shown in


Note the 81 port of the file header,

ServerAdmin: Your e-mail address

DocumentRoot: The root directory of your site, it is recommended to put under/VAR/WWW, and change the permissions that are consistent with other files. You can also place a file on a different disk and create a soft link to the Web site folder under/var/www.

Use

ln--help
View how to use the Create link command.

Use

sudo a2ensite xxx

To enable a newly configured website, restart Apache2

sudo service apache2 restart

Configure Mono

Mono is run as a component of apache2, opens the/etc/apache2/mods-enabled folder, discovers Mod_mono.load and mod_mono.conf files, and if not, enables Mono_mono components with commands. When using mono, the XSP components must be installed with mono and the official explanations are as follows:

The Mod_mono module runs within an Apache process and passes all the requests to ASP. Applications to an external mono Process that actually hosts your ASP. Applications. The external ASP. NET host is called "Mod-mono-server" and was part of the XSP module.

Must download and install the Mod_mono and XSP components of mono. Mod_mono contains the actual Apache module, and xSP contains the actual ASP hosting engine, both is available from OU Rdownload page.


Mono is configured in two ways:

1, Autoconfiguration (not recommended, the situation is too simple, if you want to use please refer to autoconfiguration)

2, manual configuration, open mod_mono.conf, to edit the following


The points to be explained

1, AddType best according to my configuration, this is from the automatic configuration of the files copied from

2, Monoautoapplication disabled, at the same time, it is best to disable Mod_mono_auto components, command as follows

sudo a2dismod Mod_mono_auto


3, set alias alias, this is very important, Because in the apache2.conf, the sites-enabled in the configuration file loading time is later than the load time on the mods-enabled, so when loading the mods-enabled is not aware of the monoapplication corresponding virtual path (this is a bit of a mouthful, anyway The official explanation, referring to the URL: http://www.mono-project.com/docs/web/mod_mono/in manual mod_mod configuration section unlike the first Example, this example ... The beginning of the paragraph)

4, if use net2.0 please change "include/etc/mono-server4/mono-server4-hosts.conf" to "include/etc/mono-server2/ Mono-server2-hosts.conf "


For more information on Mono, please refer to the official mono document, but this document is not compatible with Ubuntu 14.04 LTS configuration for reference only.

Remember to restart apache2 after changing the configuration.


Mono Connect MySQL

This is relatively simple and requires installing a MySQL and MySQL connector/net, referring to the documentation

MySQL | Mono

Install MySQL connector/net reference installing connector/net on Unix with Mono.


Use Apache2+mono 3.2.8 to configure the ASP. 14.04 in Ubuntu 4.0 Web site

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.