CentOS上搭建Nginx+Mono运行asp.net环境配置教程
安装步骤:
一、获取开源相关程序:
1、利用CentOS Linux系统自带的命令安装、升级所需的程序库:
sudo -s
LANG=C
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel bison pkgconfig glib2-devel gettext make
2、下载程序源码包:
Nginx安装包:下载地址:
mkdir -p /down
cd /down
wget
Mono下载:官网:(请下载最新版)
wget
libgdiplus下载:(请下载最新版)
wget
xsp下载:(请下载最新版)
wget
pcre下载(Nginx所需的pcre库):(请下最新版)
wget
二、安装编译Nginx:
1、安装安装Nginx所需的pcre库:
cd /down
tar zxvf
cd pcre-8.21/
./configure
make && make install
cd ../
2、创建www用户和组
/usr/sbin/groupadd www
/usr/sbin/useradd -g www www
mkdir -p /data0/web
chmod +w /data0/web
chown -R www:www /data0/web
3、安装Nginx
tar zxvf
cd nginx-1.1.11/
./configure --user=www --group=www --prefix=/opt/nginx --with-http_stub_status_module --with-http_ssl_module
make && make install
cd ../
4、开放80端口:
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
启动nginx
/opt/nginx/sbin/nginx
在浏览器上输入访问地址 (根据个人本机地址页定),正常会看到默认nginx页面
三、安装编译Mono
1、安装libgdiplus:
cd /down
tar -jxvf 2
cd libgdiplus-2.10
./configure --prefix=/opt/mono
make && make install
echo "/opt/mono/lib" > /etc/.d/
ldconfig
2、安装Mono:
tar –jxvf 2
cd mono-2.10.7
./configure --prefix=/opt/mono
make && make install //此处时间较长
echo export PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig:$PKG_CONFIG_PATH>>~/_profile
echo export LD_LIBRARY_PATH=/opt/mono/lib:$LD_LIBRARY_PATH>>~/_profile
echo export PATH=/opt/mono/bin:$PATH>>~/_profile
source ~/_profile
输入 mono -V 如有mono版本信息,则安装成功.
3、安装XSP:
cd /down
tar –jxvf 2
./configure --prefix=/opt/mono
make && make install
四、配置Nginx
vi /opt/nginx/conf/
server {
listen 80;
server_name localhost;
location / {
root /data0/web;
index ;
fastcgi_index ;
fastcgi_pass ;
include fastcgi_params;
}
}
五、配置fastcgi_params增加下面两行:
vi /opt/nginx/conf/fastcgi_params
fastcgi_param PATH_INFO "";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
六、启动:
1、重启nginx:
/opt/nginx/sbin/nginx -s reload
2、启动 fastcgi_mono服务器
fastcgi-mono-server2 /applications=/:/data0/web /socket=tcp: &
七、测试:
新建一个 web项目上传至 /data0/web目录下,测试运行。
-
如何理解Javascript的caller,callee,call,apply区别
在提到上述的概念之前,首先想说说javascript中函数的隐含参数:argumentsarguments该对象代表正在执行的函数和调用它的函数的参数。[function.]arguments[n]参数function:选项。当前正在执行的Function对象的名字。n:选项。要传递给Function对象的从0开始的参数值...
-
如何理解Javascript的caller,callee,call,apply区别
在提到上述的概念之前,首先想说说javascript中函数的隐含参数:argumentsarguments该对象代表正在执行的函数和调用它的函数的参数。[function.]arguments[n]参数function:选项。当前正在执行的Function对象的名字。n:选项。要传递给Function对象的从0开始的参数值...
-
SQl常用增删改查模板
篇一:SQl常用增删改查SQL常用增删改查语句增加现在有一张表,表(Test)里面有三个字段,分别为sno,sname,age。举例用一条增加SQL语句,插入一条数据进库。语句:Insertinto表名value(‘数据1’,’数据2’,’数据3’)具体操作:Insertintotestvalues('test','te...
-
asp.net 操作INI文件读写类实例代码
操作INI文件读写类实例代码复制代码代码如下:usingSystem;usingropServices;using;using;namespaceCommon{//////INI文件读写类。///publicclassINIFile{publicstringpath;publicINIFile(stringINIPath){path=INIPath;}[DllImport("kernel32")]privatestaticex...
相关文章
- 分享SAT阅读练习题:Reading Comprehension Test 14
- 我的英语演讲稿living at present is my top concern
- Linux Mint Cinnamon下使用vino-server配置桌面共享的方法
- 提示operating system not found的解决方法
- Unit 13 Lesson50 Standing Room Only说课稿
- 托福英语写作范文:Examinations exert a pernicious influence on educat
- Unit six Opening and Closing Ceremonies口译材料
- 七年级上 Unit One Topic One Section A说课材料
- An Exciting Sports Meeting英语作文
- Is a Test of Spoken English Necessary英语四级作文