1. 필수 소프트웨어 설치
yum -y install httpd httpd-devel make glib2-devel libpng-devel libjpeg-devel giflib-devel libtiff-devel libX11-devel gcc* fontconfig-devel bison gettext bzip2 libtool automake autoconf wget unzip |
-- mono : Mono is a free and open source project led by Xamarin (formerly by Novell and originally by Ximian) to create an Ecma standard-compliant, .NET Framework-compatible set of tools including, among others, a C# compiler and a Common Language Runtime.
-- XSP : XSP is a simple, standalone webserver written in C# that hosts ASP.NET's System for Linux and other Unix operating systems
-- mod_mono : mod_mono is a module for the Apache HTTP Server that allows for hosting of ASP.NET pages and other assemblies on multiple platforms by use of the Mono development platform
-- libgdiplus :
[root@mono proc]# cd /opt [root@mono opt]# mkdir mono [root@mono opt]# cd /tmp [root@mono tmp]# mkdir mono [root@mono tmp]# cd mono [root@mono mono]# wget http://download.mono-project.com/sources/mono/mono-3.4.0.tar.bz2 [root@mono mono]# wget http://download.mono-project.com/sources/xsp/xsp-2.10.2.tar.bz2 [root@mono mono]# wget http://download.mono-project.com/sources/mod_mono/mod_mono-2.10.tar.bz2 [root@mono mono]# wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.tar.bz2 [root@mono mono]# tar -xjf mono-3.4.0.tar.bz2 [root@mono mono]# tar -xjf xsp-2.10.2.tar.bz2 [root@mono mono]# tar -xjf mod_mono-2.10.tar.bz2 [root@mono mono]# tar -xjf libgdiplus-2.10.tar.bz2 [root@mono mono]# ls -al 합계 78652 drwxr-xr-x. 6 root root 4096 2014-04-09 15:25 . drwxrwxrwt. 13 root root 4096 2014-04-09 15:21 .. drwxrwxrwx. 6 1000 users 4096 2011-01-14 07:43 libgdiplus-2.10 -rw-r--r--. 1 root root 1962898 2011-02-15 05:39 libgdiplus-2.10.tar.bz2 drwxrwxrwx. 4 1000 users 4096 2011-01-14 07:48 mod_mono-2.10 -rw-r--r--. 1 root root 259321 2011-02-15 05:39 mod_mono-2.10.tar.bz2 drwxr-xr-x. 19 1000 1000 4096 2014-04-01 05:29 mono-3.4.0 -rw-r--r--. 1 root root 77992708 2014-04-01 05:27 mono-3.4.0.tar.bz2 drwxrwxrwx. 11 1000 users 4096 2011-04-15 04:54 xsp-2.10.2 -rw-r--r--. 1 root root 284801 2011-04-15 03:54 xsp-2.10.2.tar.bz2 |
[root@mono mono]# cd libgdiplus-2.10 [root@mono libgdiplus-2.10]# ./configure --prefix=/opt/mono [root@mono libgdiplus-2.10]# make; make install; |
[root@mono libgdiplus-2.10]# cd ../mono-3.4.0 [root@mono mono-3.4.0]# ./configure --prefix=/opt/mono --with-libgdiplus=/opt/mono [root@mono mono-3.4.0]# make; make install; ##### 모노설치에러 ############################################## mkdir -p -- /usr/lib/mono/xbuild/Microsoft/Portable/v4.0 /usr/bin/install -c -c -m 644 targets/Microsoft.Portable.Common.targets /usr/lib/mono/xbuild/Microsoft/Portable/v4.0/Microsoft.Portable.Common.targets /usr/bin/install: cannot stat `targets/Microsoft.Portable.Common.targets': No such file or directory 참조 : http://stackoverflow.com/questions/22844569/build-error-mono-3-4-0-centos http://smdn.jp/programming/mono/build_install/mono-3.4/ cd /tmp/mono/mono-3.4.0/mcs/tools/xbuild/targets [root@mono targets]# vi Microsoft.Portable.Common.targets <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="..\Microsoft.Portable.Core.props" /> <Import Project="..\Microsoft.Portable.Core.targets" /> </Project> ~ [root@mono targets]# chown 1000:1000 Microsoft.Portable.Common.targets 다시설치 |
[root@mono mono-3.4.0]# cd ../xsp-2.10.2 [root@mono xsp-2.10.2]# ./configure --prefix=/opt/mono [root@mono xsp-2.10.2]# make; make install; |
[root@mono xsp-2.10.2]# cd ../mod_mono-2.10 [root@mono mod_mono-2.10]# ./configure --prefix=/opt/mono --with-mono-prefix=/opt/mono [root@mono mod_mono-2.10]# make; make install; [root@mono mod_mono-2.10]# mv /etc/httpd/conf/mod_mono.conf /etc/httpd/conf.d/ |
[root@mono mod_mono-2.10]# cd /etc/httpd/
[root@mono httpd]# vi ./conf/vi httpd.conf - 맨 하단에 아래와 같이 VirtualHost 추가
NameVirtualHost 111.111.111.111:80
#<VirtualHost 111.111.111.111:80>
# ServerAdmin webmaster@dummy-host.example.com # DocumentRoot /www/docs/dummy-host.example.com # ServerName dummy-host.example.com # ErrorLog logs/dummy-host.example.com-error_log # CustomLog logs/dummy-host.example.com-access_log common #</VirtualHost> <VirtualHost *:80> ServerAdmin dev@hlmc.co.kr DocumentRoot /var/www.monotest.co.kr ServerName www.monotest.co.kr ErrorLog logs/www.monotest.co.kr-error_log CustomLog logs/www.monotest.co.kr-access_log common MonoServerPath www.monotest.co.kr "/opt/mono/bin/mod-mono-server4" MonoDebug www.monotest.co.kr true MonoSetEnv www.monotest.co.kr MONO_IOMAP=all MonoApplications www.monotest.co.kr "/:/var/www/www.monotest.co.kr" <Location "/">
Allow from all Order allow,deny MonoSetServerAlias www.monotest.co.kr 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/java </IfModule> </VirtualHost> [root@mono httpd]# cd /var/www
[root@www]# mkdir www.monotest.co.kr
[root@www]# cd www.monotest.co.kr
[root@www.monotest.co.kr]# vi HellowMonoDotNet.aspx
|
[root@mono mod_mono-2.10]# service httpd restart
웹브라우저 확인(호스트 변조 후) - http://www.monotest.co.kr/HellowMonoDotNet.aspx |
설치시 디버깅사항 정리 실제 해결은 |