2011-11-01 5 views
7

1 주일 전부터 Apache 구성으로 모노 구성을 실행하려고했습니다. 나는 사실상 아무 것도 시도하지 않았을 것입니다. 부끄러움없이 변화가 없다는 것을 알았습니다. 문제는 그대로입니다.Mono + apache2 = 서비스 일시적으로 사용할 수 없음 (503)

서버에 연결하려고하면 503 오류가 발생합니다. 서비스 일시적으로 사용할 수 없음 오류 로그를 보면 비어있는 것으로 나타나며 사용 권한 문제가 아닌 것으로 확신합니다. 아파치에 대해

:

Package: apache2 
Priority: optional 
Section: httpd 
Installed-Size: 36 
Maintainer: Debian Apache Maintainers <[email protected]> 
Architecture: amd64 
Version: 2.2.16-6+squeeze4 
Depends: apache2-mpm-worker (= 2.2.16-6+squeeze4) | apache2-mpm-prefork (= 2.2.16-6+squeeze4) | apache2-mpm-event (= 2.2.16-6+squeeze4) | apache2-mpm-itk (= 2.2.16-6+squeeze4), apache2.2-common (= 2.2.16-6+squeeze4) 

모노 소개 : 나는 아래의 구성을 사용하고

Package: mono-apache-server2 
Priority: optional 
Section: httpd 
Installed-Size: 260 
Maintainer: Debian Mono Group <[email protected]> 
Architecture: all 
Source: xsp 
Version: 2.6.5-3 
Replaces: mono-server 
Depends: debconf (>= 0.5) | debconf-2.0, mono-runtime (>= 1.1.8.1), libc6 (>= 2.11) | libc6.1 (>= 2.11) | libc0.1 (>= 2.11), libmono-corlib2.0-cil (>= 2.6.3), libmono-posix2.0-cil (>= 2.4), libmono-security2.0-cil (>= 2.6.7), libmono-system-web2.0-cil (>= 1.9.1), libmono-system2.0-cil (>= 2.6.3), mono-xsp2-base (= 2.6.5-3), perl-modules 

.

<VirtualHost *:80> 
    ServerName myapp.example.com 
    ServerAdmin [email protected] 
    DirectoryIndex index.html index.aspx 
    DocumentRoot /var/www/vhosts/example.com/subdomains/myapp/httpdocs/ 

    # MonoServerPath can be changed to specify which version of ASP.NET is hosted 
    # mod-mono-server1 = ASP.NET 1.1/mod-mono-server2 = ASP.NET 2.0 
    # For SUSE Linux Enterprise Mono Extension, uncomment the line below: 
    # MonoServerPath myapp.example.com "/opt/novell/mono/bin/mod-mono-server2" 
    # For Mono on openSUSE, uncomment the line below instead: 
    MonoServerPath myapp.example.com "/usr/bin/mod-mono-server2" 
    #mod-mono-server2 

    # To obtain line numbers in stack traces you need to do two things: 
    # 1) Enable Debug code generation in your page by using the Debug="true" 
    # page directive, or by setting <compilation debug="true" /> in the 
    # application's Web.config 
    # 2) Uncomment the MonoDebug true directive below to enable mod_mono debugging 
    MonoDebug myapp.example.com true 
    # The MONO_IOMAP environment variable can be configured to provide platform abstraction 
    # for file access in Linux. Valid values for MONO_IOMAP are: 
    # case 
    # drive 
    # all 
    # Uncomment the line below to alter file access behavior for the configured application 
    MonoSetEnv myapp.example.com MONO_IOMAP=all 
    # 
    # Additional environtment variables can be set for this server instance using 
    # the MonoSetEnv directive. MonoSetEnv takes a string of 'name=value' pairs 
    # separated by semicolons. For instance, to enable platform abstraction *and* 
    # use Mono's old regular expression interpreter (which is slower, but has a 
    # shorter setup time), uncomment the line below instead: 
    # MonoSetEnv myapp.example.com MONO_IOMAP=all;MONO_OLD_RX=1 
    MonoApplications myapp.example.com "/:/var/www/vhosts/example.com/subdomains/myapp/httpdocs/" 

    <Location "/"> 
    Order allow,deny 
    Allow from all 
    MonoSetServerAlias myapp.example.com 
    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/javascript 
    </IfModule> 

    ErrorLog /var/www/vhosts/example.com/subdomains/myapp/logs/error.log 
    CustomLog /var/www/vhosts/example.com/subdomains/myapp/logs/access.log combined 

</VirtualHost> 

누구든지 나를 도와 줄 수 있습니까? 사전에

감사합니다, 팀

+0

답변을 수락했는데 아무런 의견도 남기지 않았으므로 그 일을했다고 생각하지 않습니까? – mbx

답변

5

당신이 mod_mono AutoConfiguration feature을 시도 했습니까? 이것은 분명히 Apache/Mono/ASP.NET 스택에서 가장 좋은 방법입니다. 이 기능을 사용하면 가상 호스트의 모든 모노 설정을 정의 할 필요가 없습니다.

<IfModule mono_module> 
    AddType application/x-asp-net .config .cs .csproj .dll .resources .resx .sln .vb .vbproj 
    AddType application/x-asp-net .asax .ascx .ashx .asmx .aspx .axd .browser .licx .master .rem .sitemap .skin .soap .webinfo 

    MonoAutoApplication enabled 
    MonoDebug false 
    MonoServerPath "/usr/bin/mod-mono-server4" 
    MonoSetEnv LANG=fr_FR.UTF-8 
    MonoUnixSocket "/tmp/.mod_mono" 

    <IfModule dir_module> 
     DirectoryIndex Default.aspx 
    </IfModule> 

    <DirectoryMatch "/(bin|App_Code|App_Data|App_GlobalResources|App_LocalResources)/"> 
     Order deny,allow 
     Deny from all 
    </DirectoryMatch> 

    <Location "/Mono"> 
     Order deny,allow 
     Deny from all 
     Allow from 127.0.0.1 ::1 
     SetHandler mono-ctrl 
    </Location> 
</IfModule> 

가장 중요한 지시어는 "MonoAutoApplication"입니다 : 여기

는 (이 데비안 배포판과 호환되어야 맥 OS X 10.7.2와 리눅스 우분투 11.04에) 내 mod_mono.conf 파일입니다 하나. 당신이 볼 수 있듯이

<VirtualHost *:80> 
    ServerName www.monorules.fr 
    DocumentRoot "/Library/WebServer/Documents/MonoRules" 
</VirtualHost> 

, 가상 호스트는 단순한 표현으로 감소 : 그리고 여기 샘플 가상 호스트입니다. mod_mono.conf 파일에 정의 된 설정은 모든 가상 호스트에서 공유됩니다.
이 솔루션의 유일한 단점은 ASP.NET 사이트의 한 인스턴스 만 다시 시작하도록 허용하지 않는다는 것입니다 (Microsoft IIS에서와 같이). Mono 제어판 ("위치"절 참조)을 사용하여 프로세스를 다시 시작하면 모든 ASP.NET 응용 프로그램이 다시 시작됩니다.

+0

감사합니다. 이것은 나를 위해 일했다. – Reinaldo

1

mod 모노가 올바르게 설치되어 있고 apache2에서 활성화되어 있으면 다음 구성이 가상 호스트에서 작동합니다.

<VirtualHost *:80> 
ServerName myapp.example.com 
    ServerAdmin [email protected] 
    DirectoryIndex index.html index.aspx 
    DocumentRoot /var/www/vhosts/example.com/subdomains/myapp/httpdocs/ 

AddMonoApplications myapp.example.com "/:/var/www/vhosts/example.com/subdomains/myapp/httpdocs/" 
MonoServerPath myapp.example.com "/usr/bin/mod-mono-server2" 

<Directory /var/www/vhosts/example.com/subdomains/myapp/httpdocs/> 
    MonoSetServerAlias myapp.example.com 
    SetHandler mono 
    AddHandler mod_mono .aspx .ascx .asax .ashx .config .cs .asmx 
    <FilesMatch "\.(gif|jp?g|png|css|ico|xsl|wmv|zip)$"> 
     SetHandler None 
    </FilesMatch> 
    Options Indexes FollowSymLinks MultiViews 
    AllowOverride All 
    Order allow, deny 
    Allow from all 
    DirectoryIndex index.aspx 
</Directory> 
</VirtualHost> 
+0

고마워요! 또 다른 질문은 예를 들어 DNSADRESS/mvctest/public_html에 액세스 할 때 응용 프로그램을 작동시키는 방법입니까? –

관련 문제