???????
???????????в??????????????????ò????????????????????C#????Java??????й??????????????????????????????????????????????????????????????????????C#????Java????????C#???????????????????????????????
????????????.NET????????????????????????????????ASP.NET??????????о?????????飬?????????.NET?·??????????????
????.NET???????????????????????????????????????????????????????????????б?????????????????????.NET?????????????????????淶????????????????????Э??.NET Framework??????????.NET????????????????δ?е????????.NET??????????????????????????????????????.NET????????????????飬??????????.NET???????????????.NET???????????????????????
????????
?????????????????????д??????Linux???????汾CentOS????????????????·???????????????????Linux??????????????????????б???????????????????????Mono??Web????м??????й??????Jexus???漰??????????????????
????????????CentOS_6.4_64bit
????.NET????Mono_4.0.4.1
????Web????м????Jexus_5.6.5
?????????MySQL_5.1.73
???????
??????????????????????ASP.NET??ó?????Linux?????в??????????????????ASP.NET?????Linux???????????????
????Web??ó???
?????????Web??ó??????ASP.NET MVC 4????????????ò????ADO.NET Entity Framework 6?????????????src/demo???????????
????????????
????????????
????С?????CentOS?????????黷?????????????t??п??????????????????????VMWare????????????顣??????????????????????ú??????????????????????????????????????á?
?????????????????ASP.NET???????????????????????????????????????????????裬??????????????????????????ASP.NET??ò????
??????????Linux??????
??????????????????Mono????????????Linux??????????Linux?????????????????????????????????????
???????????????????????????????????VMWare??????????????????????????VMWare????????????????????????????NAT????????????????????????????????NAT????? 1?????


????? 1 VMWare???????????????????

????????VMnet8???????IP????? 2?????


????? 2 ????VMnet8???????IP???

???????Linux????????DHCP???????IP?????????????????
????[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
??????????????????????£?
????DEVICE=eth0
????HWADDR=00:0C:29:F5:09:30
????TYPE=Ethernet
????UUID=74b949f0-57bb-4baa-a5f2-2c97fb533a8b
????ONBOOT=yes
????NM_CONTROLLED=yes
????BOOTPROTO=dhcp
???????????????????????????Ч??
????[root@localhost ~]# service network restart
?????????????????????????
????[root@localhost ~]# ping yilin.cnblogs.com
????PING yilin.cnblogs.com (42.121.252.58) 56(84) bytes of data.
????64 bytes from 42.121.252.58: icmp_seq=1 ttl=128 time=77.7 ms
????64 bytes from 42.121.252.58: icmp_seq=2 ttl=128 time=78.1 ms
????64 bytes from 42.121.252.58: icmp_seq=3 ttl=128 time=77.5 ms
????????????
????[root@localhost ~]# yum –y update
???????Mono??????????????
????[root@localhost ~]# yum -y install wget glib2-devel libtiff libtiff-devel libjpeg libjpeg-devel giflib giflib-devel libpng libpng-devel libX11 libX11-devel freetype freetype-devel fontconfig fontconfig-devel libexif libexif-devel gcc-c++ gettext unzip zip
???????????GDI+???
???????Mono???????????????????GDI+?????????????libgdiplus?????????????Linux????????????????????????????????Windows??????libgdiplus???????????????????Linux?????·??????а????????????????????????????????????????????
????[root@localhost ~]# cd /usr
????[root@localhost usr]# wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.tar.bz2
???????libgdiplus????????
????[root@localhost usr]# tar jxvf libgdiplus-2.10.tar.bz2
????????libgdiplus??????·??????????????·???????????????????????????????Mono??Jexus??MySQL?????????????????????
????[root@localhost usr]# cd libgdiplus-2.10
????[root@localhost libgdiplus-2.10]# ./configure --prefix=/usr/apollo/hostd/mono/
????????libgdiplus???
????[root@localhost libgdiplus-2.10]# make
???????libgdiplus?????
????[root@localhost libgdiplus-2.10]# make install
??????????Mono
????Mono??Linux????.NET Framework??????.NET?????????Linux???????????????????????Mono????????
????[root@localhost libgdiplus-2.10]# cd /usr
????[root@localhost usr]# wget http://download.mono-project.com/sources/mono/mono-4.0.4.1.tar.bz2
???????Mono????????
????[root@localhost usr]# tar jxvf mono-4.0.4.1.tar.bz2
????????Mono???·????
????[root@localhost usr]# cd mono-4.0.4
????[root@localhost mono-4.0.4]# ./configure --prefix=/usr/apollo/hostd/mono
????????Mono????????????????С????С???????????????????????
????[root@localhost mono-4.0.4]# make
???????Mono??
????[root@localhost mono-4.0.4]# make install
?????????Mono?汾?????Mono????????????????μ?汾??????Mono??????????
????[root@localhost mono-4.0.4]# cd /usr/apollo/hostd/mono/bin/
????[root@localhost bin]# ./mono -V
????Mono JIT compiler version 4.0.4 (Stable 4.0.4.1/5ab4c0d Fri Oct 30 06:56:35 CST 2015)
????Copyright (C) 2002-2014 Novell?? Inc?? Xamarin Inc and Contributors. www.mono-project.com
????TLS:           __thread
????SIGSEGV:       altstack
????Notifications: epoll
????Architecture:  amd64
????Disabled:      none
????Misc:          softdebug
????LLVM:          supported?? not enabled.
????GC:            sgen
?????塢???Jexus
????Jexus??????????Linux?????ASP.NET Web????м??????????Windows????IIS????????Jexus??????????????????Linux??????ASP.NET???????????????????????Jexus???????
????[root@localhost ~]# cd /usr
????[root@localhost usr]# wget http://www.linuxdot.net/down/jexus-5.6.5.tar.gz
???????Jexus???????
????[root@localhost usr]# tar zxvf jexus-5.6.5.tar.gz
???????Jexus???·??:
????[root@localhost usr]# cd jexus-5.6.5
????[root@localhost jexus-5.6.5]# vi install
????#!/bin/sh
????SRC_DIR=$(cd $(dirname $0);pwd)
????DAT_DIR=${SRC_DIR}/data
????JWS_DIR='/usr/apollo/hostd/jexus'
????…
???????Jexus??
????[root@localhost jexus-5.6.5]# sudo ./install
???????Jexus????mono·?????????
????[root@localhost jexus-5.6.5]# cd /usr/apollo/hostd/jexus
????[root@localhost jexus]# vi jws
????#!/bin/sh
????JWS_HOME=$(cd $(dirname $0);pwd)
????export LANG="zh_CN.UTF-8"
????export PATH=/usr/bin:${JWS_HOME}/../mono/bin:$PATH
????export LD_LIBRARY_PATH=/usr/lib:${JWS_HOME}/../mono/lib:$LD_LIBRARY_PATH
????…
???????Jexus????????Jexus???????????
????[root@localhost jexus]# ./jws start
????????Jexus?????????????????????????У???
????[root@localhost jexus]# vi /etc/rc.d/rc.local
????touch /var/lock/subsys/local
????/usr/apollo/hostd/jexus/jws start
????????????????????
????[root@localhost jexus]# chmod +x /etc/rc.d/rc.local
???????????????
???????????????
????[root@localhost jexus]# cd /usr/apollo/
????[root@localhost apollo]# mkdir webapps
????[root@localhost apollo]# cd webapps/
????[root@localhost webapps]# mkdir default
????[root@localhost webapps]# cd default/
????[root@localhost default]# touch index.html
????[root@localhost default]# vi index.html
????<html>
????<head>
????<title>ASP.NET?????????</title>
????<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
????</head>
????<body>
????ASP.NET???????????????????棬?????????????????????Linux????
????</body>
????</html>
???????Jexus????????
????[root@localhost default]# cd /usr/apollo/hostd/jexus/siteconf
????[root@localhost siteconf]# vi default
????######################
????# Web Site: Default
????########################################
????port=80
????root=/ /usr/apollo/webapps/default
????hosts=*    #OR your.com??*.your.com
????…
????????????80????
????[root@localhost siteconf]# vi /etc/sysconfig/iptables
????# Firewall configuration written by system-config-firewall
????# Manual customization of this file is not recommended.
????*filter
????:INPUT ACCEPT [0:0]
????:FORWARD ACCEPT [0:0]
????:OUTPUT ACCEPT [0:0]
????-A INPUT -m state --state ESTABLISHED??RELATED -j ACCEPT
????-A INPUT -p icmp -j ACCEPT
????-A INPUT -i lo -j ACCEPT
????-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
????-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
????-A INPUT -j REJECT --reject-with icmp-host-prohibited
????-A FORWARD -j REJECT --reject-with icmp-host-prohibited
????COMMIT
????????iptables??????????????Ч??
????[root@localhost siteconf]# /etc/init.d/iptables restart
????????Jexus????
????[root@localhost siteconf]# /usr/apollo/hostd/jexus/jws restart
???????????????????http://ip:port/index.html?????????


????? 3 ASP.NET??????????Linux??

????????????
????Linux???????????????MySQL??????????MySQL????????
????[root@localhost siteconf]# cd /usr
????[root@localhost usr]# wget http://downloads.mysql.com/archives/get/file/mysql-5.1.72-linux-x86_64-glibc23.tar.gz
???????MySQL???????????????????????????
????[root@localhost usr]# tar zxvf mysql-5.1.72-linux-x86_64-glibc23.tar.gz -C /usr/Apollo
????[root@localhost usr]# cd apollo
????[root@localhost apollo]# mv mysql-5.1.72-linux-x86_64-glibc23 data
??????mysql????????????????????
????[root@localhost apollo]# cd data
????[root@localhost data]# cp support-files/my-medium.cnf /etc/my.cnf
??????mysql???????????[client]???[mysqld]???м???????????У???
????[root@localhost data]# vi /etc/my.cnf
????[client]
????#password       = your_password
????port            = 3306
????socket          = /tmp/mysql.sock
????default-character-set = utf8
????# Here follows entries for some specific programs
????# The MySQL server
????[mysqld]
????port            = 3306
????socket          = /tmp/mysql.sock
????skip-locking
????key_buffer_size = 16M
????max_allowed_packet = 1M
????table_open_cache = 64
????sort_buffer_size = 512K
????net_buffer_length = 8K
????read_buffer_size = 256K
????read_rnd_buffer_size = 512K
????myisam_sort_buffer_size = 8M
????basedir = /usr/apollo/data
????datadir = /usr/apollo/data/data
????character-set-server = utf8
????collation-server = utf8_general_ci
????…
????????mysql?鼰????????趨??????????
????[root@localhost data]# groupadd mysql
????[root@localhost data]# useradd -g mysql mysql
????[root@localhost data]# chown -R mysql .
????[root@localhost data]# chgrp -R mysql .
????[root@localhost data]# chown -R root .
????[root@localhost data]# chown -R mysql data
??????????????
????[root@localhost data]# scripts/mysql_install_db --user=mysql
????????mysql????
????[root@localhost data]# bin/mysqld_safe --user=mysql &
?????????????MySQL????????????????????????Linux??????????????????
????????root???????
????[root@localhost data]# bin/mysqladmin -uroot password 11111111
????????mysql??????????????
????[root@localhost data]# cp support-files/mysql.server /etc/rc.d/init.d/mysqld
????[root@localhost data]# chmod 700 /etc/init.d/mysqld
????[root@localhost data]# chkconfig --add mysqld
????[root@localhost data]# chkconfig --level 345 mysqld on
????????????????????????MySQL????????Ctrl + C???????service?????????MySQL????
????[root@localhost data]# service mysqld start
??????mysql??????????????????У???????β???????????д???
????[root@localhost data]# vi /etc/profile
????...
????PATH=$PATH:/usr/apollo/data/bin
????export
?????????????????????????????????Ч??
????[root@localhost data]# source /etc/profile