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目錄下,測試運行。
相關文章
-
Unit six Opening and Closing Ceremonies口譯材料
Unit six Opening and Closing CeremoniesLesson 1女士們,先生們,上午好!我很榮幸地代表戴比爾斯公司歡迎你們來到美麗的大連參加“中國鑽石節”。//藉此機會我想介紹一下出席大會的代表們(介紹代表們的名字、職位和簡要 -
託福英語寫作範文:Examinations exert a pernicious influence on educat
We might marvel at the progress made in every field of study, but the methods of testing a person’s knowledge and ability remain as primitive as ever they were. It really is extraordinary that after -
Linux Mint Cinnamon下使用vino-server配置桌面共享的方法
南溪縣屬於四川省宜賓市。位於四川省南部,東鄰江安縣,西接翠屏區,南靠長寧縣,北連自貢市富順縣。轄2個街道、8個鎮、5個鄉。南溪區,位於四川省南部長江上游,東鄰江安縣,西接翠屏區,南靠長寧縣,北連自貢市富順縣。距宜賓市區、 -
我的英語演講稿living at present is my top concern
ladies and gentleman,good evening!it's my great honor to present this speech name is Peace and I am from class 1 of Teaching Chinese as a foreign language. My topic today is "Living at Present is -
Unit 13 Lesson50 Standing Room Only說課稿
各位領導老師:大家好我說課的題目是國中英語第三冊第50課,本課爲口語閱讀課,整個說課我將分三部分進行講述,即教材分析、教學環節的設計、教學程序。 一、教材分析(一)教材的地位和作用:第50課以詳實準確的數據圍繞本單元 -
提示operating system not found的解決方法
提示operating system not found的解決方法提示operating system not found怎麼辦?如今很多用戶選擇使用u盤裝系統,因爲這樣既方便又快速,省去光盤刻錄的.麻煩,不過也不是每一次都那麼順利,安裝過程中有些用戶也難免 -
七年級上 Unit One Topic One Section A說課材料
一、說教材1. 教材分析仁愛版國中英語教材共六冊,每冊由四個模塊組成,每個模塊由單元----話題----功能---任務構成,編寫思路清晰,符合學生的認識發展規律.八年級英語下冊Unit 7 Topic 1 SectionA講述了讓學生學習 -
Is a Test of Spoken English Necessary英語四級作文
A test of spoken English will be included as an optional component of College English Test . Some people argue that it is absolutely necessary to hold a test of spoken English in China because we have -
An Exciting Sports Meeting英語作文
在平平淡淡的學習、工作、生活中,大家總免不了要接觸或使用作文吧,寫作文是培養人們的觀察力、聯想力、想象力、思考力和記憶力的重要手段。相信寫作文是一個讓許多人都頭痛的.問題,以下是小編爲大家收集的An Exciting S -
分享SAT閱讀練習題:Reading Comprehension Test 14
SAT閱讀練習題:Reading Comprehension Test 14Much of what goes by the name of pleasure is simply an effort to destroy consciousness. If one started by asking, what is man? what are his needs? how can he