linux上搭建asp网站

1、需要安装一些依赖包
yum –y update
yum -y install gcc gcc-c++ bison pkgconfig glib2-devel gettext make libpng-devel libjpeg-devel libtiff-devel libexif-devel giflib-devel libX11-devel freetype-devel fontconfig-devel cairo-devel
2.centos6.5上(尽量不要去更改包的版本,坑很多)
cd /usr/local/src
(1)Nginx安装包:下载地址:http://nginx.org/en/download.html
wget http://nginx.org/download/nginx-1.12.2.tar.gz
tar zxvf nginx-1.12.2.tar.gz
cd nginx-1.12.2.tar.gz
./configure --prefix=/opt/nginx --with-http_stub_status_module --with-http_ssl_module
make && make install

(2)Libgdiplus下载
wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.9.tar.bz2
tar -jxvf libgdiplus-2.10.9.tar.bz2
cd libgdiplus-2.10.9
./configure --prefix=/opt/mono
make && make install
echo “/opt/mono/lib” > /etc/ld.so.conf.d/mono.conf
ldconfig

(3)Mono下载:官网:http://download.mono-project.com/sources/mono
wget http://download.mono-project.com/sources/mono/mono-3.2.3.tar.bz2
tar –jxvf mono-3.2.3.tar.bz2
cd mono-3.2.3
./configure --prefix=/opt/mono
make && make install //此处时间较长

echo export PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig:$PKG_CONFIG_PATH>>~/.bash_profile

echo export LD_LIBRARY_PATH=/opt/mono/lib:$LD_LIBRARY_PATH>>~/.bash_profile

echo export PATH=/opt/mono/bin:$PATH>>~/.bash_profile
source ~/.bash_profile
输入 mono -V 如有mono版本信息,则安装成功
linux上搭建asp网站_第1张图片
(4)xsp从github上下载最新的3.0版本
yum –y intall git
git clone https://github.com/mono/xsp.git
cd xsp
./autogen.sh
./configure --prefix=/opt/mono
make && make install
3、配置nginx
vim /opt/nginx/conf/nginx.conf
server {
listen 80;
server_name 192.168.159.128;
location / {
root /data/web;
index login.aspx Login.aspx index.html index.htm;
fastcgi_index Login.aspx; //asp页面根据实际名称进行修改
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
}

4、配置fastcgi_params增加下面两行
vim /opt/nginx/conf/fastcgi_params
fastcgi_param PATH_INFO “”;
fastcgi_param SCRIPT_FILENAME d o c u m e n t r o o t document_root documentrootfastcgi_script_name;
5、启动:
1、重启nginx:
/opt/nginx/sbin/nginx -s reload
2、启动 fastcgi_mono服务器
mkdir -p /data/web //然后将页面上传到此文件下
nohup fastcgi-mono-server4 /applications=/:/data/web /socket=tcp:127.0.0.1:9000 &
6、centos7
版本为:mono-5.20.1.27.tar.bz2 libgdiplus-6.0

你可能感兴趣的:(linux)