Ubuntu + apache2 + mono + mvc3

Source: Internet
Author: User
Tags speling

After studying for a few days, I found that most of the Chinese tutorials on the Internet were "residual spectrum" due to the software version. I did not solve the problem. I finally succeeded in one time by referring to a foreign language, record it according to your own operation steps.

1. Install Virtual Machine Vmware

2. Install ubuntu-12.04.1-desktop-amd64.iso (or ubuntu-12.04.1-dvd-i386.iso, depending on your CPU)

After installation, go to Ubuntu

1. Query IP Address: ifconfig (use CTRL + ALT + T to open the terminal). The address obtained in this article is 192.168.80.129.

2. Set the root password: sudo passwd Root

3. install remote control software

1. Install SSH: sudo apt-Get install OpenSSH-Server

2. Download putty and winscp for Windows

4. Install apahe2: sudo apt-Get install apache2

After installation, go to The apache2 Directory: CD/etc/apache2

Ls to list the files and find that there is mod-available. Open mod_mono.conf: sudo Vim/etc/apache2/mod-available/mod_mono.conf. The content is blank.

5. Install mono and Its Apache components:

wget http://badgerports.org/directhex.ppa.ascsudo apt-key add directhex.ppa.ascsudo apt-get install python-software-propertiessudo add-apt-repository 'deb http://ppa.launchpad.net/directhex/ppa/ubuntu lucid main'sudo apt-get update
sudo apt-get install mono-complete mono-apache-server4 libapache2-mod-mono

6. Configure the web in/SVR/www/Default

1.cd /srv

cd /srvsudo mkdir wwwcd wwwsudo mkdir default

sudo chown -R www-data:www-data /srv/www

sudo chmod -R g+rw /srv/www/default/Up
cd /etc/apache2/sites-availablesudo vi mono-default
Paste:
<VirtualHost *:80>  ServerName my-mono-server.somewhere.com  ServerAdmin web-admin@my-mono-server.somewhere.com  DocumentRoot /srv/www/default  MonoServerPath my-mono-server.somewhere.com "/usr/bin/mod-mono-server4"  MonoDebug my-mono-server.somewhere.com true  MonoSetEnv my-mono-server.somewhere.com MONO_IOMAP=all  MonoApplications my-mono-server.somewhere.com "/:/srv/www/default"  <Location "/">    Allow from all    Order allow,deny
CheckSpelling on MonoSetServerAlias my-mono-server.somewhere.com SetHandler mono SetOutputFilter DEFLATE SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary </Location> <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript </IfModule></VirtualHost>

Save: {Press ESC}: ZZ and make it a symbolic link (you can also edit it using VI)

cd /etc/apache2/sites-enabledsudo rm 000-defaultsudo ln -s /etc/apache2/sites-available/mono-default 000-mono
2. sudo  –u www-data mozroots -- import  sync sudo  mv  /var/www/index.html /srv/www/default

sudo  vi  /Srv/www/default/index.html can be modified at will and saved (: WQ)Sudo/etc/init. d/apache2 restart is currently used Http: // <ip>/index.html. Visit and check it out. The preliminary success! 

7. Now you can release a webform project and try it out.

Create a basic. Net project in vs2010. After the project is released, copy it to/SVR/www/ultultusing winscp. (The contents are displayed in the "" directory, and web.configdirectly deletes the original index.html under "default".

After accessing sudo/etc/init. d/apache2 restart, the first formal project can run.

8. Publish the mvc3 Project

Create an mvc3 basic project in vs2010, set the attributes of several referenced DLL before release, and set copy local option to true:

System. Web. helpers, system. Web. MVC, system. Web. Routing, system. Web. webpages

After the release, copy several dynamic libraries under Program Files \ Microsoft ASP. NET \ ASP. NET web pages \ V1.0 \ assemblies to the release bin directory:

System. Web. webpages. Deployment. dll, system. Web. webpages. Razor. dll, and system. Web. Razor. dll

 

Use winscp to copy to/SVR/www/default (delete original project)

Sudo/etc/init. d/apache2 restart!

Supplement:

1. Case sensitivity issues may cause webpage or images to be inaccessible

<Location "/"> Add: checkspelling on

Copy: sudo CP/etc/apache2/mod-available/speling. Load/etc/apache2/mod-enabled/speling. Load

2. Edit 000-mono

Sudo VI/etc/apache2/sites-enabled/000-mono

 

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.