'windows'에 해당되는 글 1건

  1. 2008.12.25 windows rails deploy issue


Could not reliably determine the server's fully qualified domain name, using 123.456.789.123 for ServerName
윈도우상에서 한동안 이런 아파치2.2의 에러와 함께 레일스 도메인이 애플리케이션과 맵핑되지 않는 문제가 있었는데, 어느새 풀렸다. 솔직히 왜 이러는건지는 잘 모르겠다;

차후 문제를 위해 기록해둔다

httpd.conf 파일에

기본 포트를 설정하고
Listen 80

module을 로드한다

LoadModule deflate_module modules/mod_deflate.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule rewrite_module modules/mod_rewrite.so

가상호스트 설정은

<VirtualHost *:80>
    ServerAdmin sirius@abc.com
    DocumentRoot "C:/web_apps/myapp/public"
    #ServerName www.mydomain.net
    ServerAlias mydomain.net

    <Directory "C:/web_apps/myapp/public">
      options FollowSymLinks
      AllowOverride None
      Order allow,deny
      Allow from all
    </Directory>
     
    <Proxy balancer://mongrel_cluster>
     BalancerMember http://127.0.0.1:4001
     BalancerMember http://127.0.0.1:4002
    </Proxy>
   
    RewriteEngine On

    # Uncomment for rewrite debugging
    #RewriteLog logs/your_app_deflate_log deflate
    #RewriteLogLevel 9
    # Check for maintenance file and redirect all requests
    RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
    RewriteCond %{SCRIPT_FILENAME} !maintenance.html
    RewriteRule ^.*$ /system/maintenance.html [L]
    RewriteRule ^/$ /index.html [QSA]

   # Rewrite to check for Rails cached page
   RewriteRule ^([^.]+)$ $1.html [QSA]
  
   # Redirect all non-static requests to cluster
   RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
   RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
  
   # Deflate
   AddOutputFilterByType DEFLATE text/html text/plain text/xml
   BrowserMatch ^Mozilla/4 gzip-only-text/html
   BrowserMatch ^Mozilla/4\.0[678] no-gzip
   BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  
   # Uncomment for deflate debugging
   #DeflateFilterNote Input input_info
   #DeflateFilterNote Output output_info
   #DeflateFilterNote Ratio ratio_info
   #LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
   #CustomLog logs/your_app_deflate_log deflate

    ErrorLog "C:/apache/logs/error.log"
</VirtualHost>

[Deploying Rails Applications 참고]

mongrel_rails로 서비스를 등록하여 관리한다

mongrel_rails service::install -N MyApp_4001 -p 4001 -e production
mongrel_rails service::install -N MyApp_4002 -p 4002 -e production

p.s
간혹, 예전 apache 버전이 완전히 지워지지 않아 문제 생기는 것도 있다.
방화벽도 확인 바람!

위 책에 나온걸 보면 윈도우는 리눅스에 비해 성능은 대략 반정도 된다고 하더라

• Change how you use sessions. How are sessions managed in your
application? The P-Store, or file-based store, can often be slow.
Consider moving your session store into your database, or investigate
other session-storing mechanisms.
• Go through your development logs, and make sure you’re not
making unnecessary calls to your database. Simply adding an
:include to a finder can really help an application’s performance,
and it is often missed.
• Use fragment, action, and page caching as much as you can. Since
Ruby is slow on Windows, you want to make as much use of page
caching as you possibly can so that Rails is never invoked.
• Ensure that nothing is interfering with the process. Certain security
auditing software, quota managers, and virus scanners can
drastically reduce the amount of requests you can handle. Watch
your performance monitor for any spikes when testing your
application.

윈도우 레일즈 성능 최적화 부분만 따왔다.

Posted by Ssirius

카테고리

전체 (93)
Programming (13)
Digital Nomad (2)
Projects (8)
Sound (14)
Travel (45)
Think (9)

달력

«   2018/09   »
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            

티스토리 툴바