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 Elegant Universe
레일스)
윈도우에서 attachment_fu 를 이용하여 이미지를 업로드하였을때, 파일 사이즈에 따른 문제가 있었다. 가령, 20kb 이상의 이미지가 업로드 되지 않는 것이다.
에러 메시지를 찾아보면 "Size is not in the list" 이렇게 나오는데,
솔루션은, size parameter을 분명하게 써주어야한다

has_attachment  :content_type => :image, :size => 0.kilobytes..5.megabytes

여기서, 최소 사이즈를 0 킬로바이트로 꼭 명시해주어야 한다는것.
이렇게 안하면, 안되더라;

다른 이슈들: http://hamptoncatlin.com/2007/attachment_fu-gotchas

Posted by Elegant Universe

가을의 선유

2008. 11. 28. 01:06


from 준현
Posted by Elegant Universe
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/version.rb:237:in `initialize': undefined method `collect' for #<Gem::Version::Requirement:0x371b2d8> (NoMethodError)


젬을 업뎃안해서 생기는 문제
gem update --system
Posted by Elegant Universe

아나..
flex의 module과 FABridge, swfobject를 같이 쓰게 되었다.
그러다가, flex의 moduleevent가 안먹는거다.  자세히말하면, ModuleEvent.Ready가 dispatch가 안됨...

private var imInfo:IModuleInfo;
private function getModule(url:String) :void
{
    imInfo = ModuleManager.getModule("aaa.swf");
    imInfo.addEventListener(ModuleEvent.READY, funcReady);
    imInfo.load()
}
private function funcReady(e:ModuleEvent) :void
{
   var obModule:Object;
   e.target.removeEventListener("ready", funcReady);
   obModule = iModuleInfo.factory.create();
  
   Alert.show(obModule.toString());
}

구글링 하다가 플렉스 자체의 버그라는 글도 있었는데, 그건 아니었고,
이건 http://www.joshuaostrom.com/2008/08/14/flex-modules-watch-your-scope/
모듈 scope를 전역으로 설정하라는 글이었는데 모듈이 로드될 때, ModuleInfo의 내부 리스너가 소멸되는게 이유다. 여기서의 추정은 가비지 컬렉션 때문이라고..

어쨌든, 뻘짓하다가 다른 프로젝트를 열어서, 위에거 갖다붙이고 그냥 로컬에서 모듈테스트해보니 잘 작동하였다-.-
흠, 그렇다면, swfobject와의 문제가 있는듯? 자바스크립트와 무언가가 엉킨 것 같은데.. 그면 swfobject의 작동은 어케 되냐
index.template.html 파일이 주범인가? 안에 자바스크립트로 통신하는 부분이 있는데 어떠케 영향을 준건가?
흠 이해가 안되.

이부분 잘 모르겠다.

아 이런이런 해결

문제는 멍청하게도 경로를 잘못 찍었다. 아....
Posted by Elegant Universe
흠. sql을 좀 까먹었다.
mysql에는 top 이 안먹어서, Limit으로 쓰인다 하더라. 실험 꽤하다가 드뎌 찾아냄;

테이블에서 id가 아닌 특정 행수에 있는 행을 찾고자 할 때 쓰인다

select * from (select * from [tables] limit 0,특정행수) t order by id desc limit 0,1

Posted by Elegant Universe

내 사랑... 선유.

2008. 10. 9. 02:38



가을의 선유.
Posted by Elegant Universe

rails form_tag, select

2008. 10. 1. 03:47

form_for 과 form_tag 가 약간 호환이 안되다 싶은데, api를 보면,
form_tag의 select는
select_tag(name, option_tags = nil, options = {})
이렇게 나와있다.

즉,
<%= select 'category', nil, {} %>와 같이 중간의 옵션태그를 빼먹지 말고 써줘야, 연동이 된다.
Posted by Elegant Universe

카테고리

전체 (118)
Programming (15)
Digital Nomad (2)
Projects (7)
Sound (14)
Travel (69)
Think (9)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

달력

«   2024/05   »
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 31

글 보관함