我混淆了我应该在哪里有一个脚本轮询一个Rails应用程序内的Aws Sqs。 如果我在web应用程序中使用线程,可能会使用cpu周期来永久地侦听此队列,然后影响性能。 如果我保留一个单一的英雄工人dynamic,它每月34.50美元。 为单一队列调查支付这个价格是否合理? 或者使用工作人员不是这样吗? 脚本代码: queue = AWS::SQS::Queue.new(SQSADDR['my_queue']) queue.poll(:idle_timeout => 20) do |msg| # code here end 我需要帮助!! 谢谢
我正试图在Bluehost上build立一个Rails网站,而且我在path助手方面遇到了麻烦。 由于我不想猴子补丁Rails,我试图通过.htaccess来解决这个问题。 这是一个场景: 我在public_html/engradado www.engradado.com上托pipewww.engradado.com ,指向rails_apps/engradado/public 我正在通过这个public_html/.htaccess文件重写www.engradado.com指向www.engradado.com/engradado : # BlueHost.com # .htaccess main domain to subdirectory redirect # Copy and paste the following code into the .htaccess file # in the public_html folder of your hosting account # make the changes to the file according to the instructions. # Do not change this line. RewriteEngine […]
我在Ruby on Rails 3.2.8中有一个应用程序,我在端口3037上使用passenger-Nginx作为Web服务器,使用ProxyPass和ProxyPassReverse与Apache2和SSL连接。 我的问题是,加载铬或Firefox时,CSS和JavaScript文件不加载。 我有一个来自Register.com的SSL证书,我用这种方式在VirtualHost中configuration了它: 这是在80端口的VirtualHost中 ServerName mydomain.com ServerAlias www.mydomain.com DocumentRoot /home/mydomain/ PassengerEnabled off ProxyPass / http://0.0.0.0:3037/ ProxyPassReverse / http://0.0.0.0:3037/ RewriteEngine on ReWriteCond %{SERVER_PORT} !^443$ RewriteCond %{REQUEST_URI} !(\.js|\.css)$ [NC] RewriteRule \.(gif|jpg|jpeg|jpe|png|css|js)$ – [S=1] RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] 这是在我的文件从SSL端口443: <Proxy *> Allow from localhost </Proxy> ServerName mydomain.com ServerAlias www.mydomain.com DocumentRoot /home/mydomain/ ErrorLog /var/www/logs/www.mydomain.com/ssl_error_log.log CustomLog /var/www/logs/www.mydomain.com/ssl_access_log.log […]
我的Ruby on Rails网站正在抛出零星的502错误。 它运行在Nginx上,与Passenger一起安装,托pipe在运行Ubuntu 10.04的服务器上。 看来错误变得越来越稀疏,但是它们仍然造成了一个问题。 我猜测它与缓冲区大小有关,但我不确定。 我知道有同样问题的人还有其他一些问题,但是这似乎很奇特。 在此先感谢您的任何帮助或build议。 我可以给你任何你可能需要的规格或版本号。 #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { passenger_root /usr/local/rvm/gems/ruby-1.9.3-p362/gems/passenger-3.0.18; passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.3-p362/ruby; include mime.types; default_type application/octet-stream; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; gzip on; #buffer size proxy_buffers 8 16k; proxy_buffer_size […]
这是我的设置:我有一个Apache服务器运行一些虚拟主机,他们每个人都使用PHP。 我现在有一个我想安装到其中一个站点的子目录的rails应用程序(一个子域将作为一个后退足够)。 从我读到目前为止,只要我安装libapache2-mod-passenger默认情况下所有的网站将使用乘客,而不是PHP。 有没有办法解决这个问题,禁止在每个站点configuration文件中设置PassengerEnabled off指令?
很久以前,我使用Helicon Zoo feed安装了Redmine 2.1.2.stable。 它一直在努力(减去多分钟的应用程序池预热时间)。 什么是升级到最新版本的最好方法? Feed最近一次更新时间为2013年1月29日,目前为2.2.2,但是我无法在WebPI中find任何升级设施。 使用SQLlite存储,如果它很重要。 谢谢!
我对这个问题的位置感到困惑,但基本上我把nginx代理websocket连接到一个后端ruby瘦服务器,后者在Ruby on Rails应用程序中用websocket-rails模块来连接服务。 除了可能所有的套接字都没有closures以外,其他所有的工作都可以正常工作,所以瘦服务器相对较快地耗尽了文件描述符。 我正在使用nginx 1.4.2,这是我的configuration: map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen my.ip.num.ber:80; server_name admin3.mydomain.com; root /home/apps/mydomain/current/public; try_files $uri/index.html $uri @admin3.mydomain.com; access_log /var/log/nginx/admin3.access.log combined; error_log /var/log/nginx/admin3.error.log error; location /websocket { proxy_redirect off; proxy_pass http://localhost:3008; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header […]
我试图将passenger_root和passenger_ruby添加到我的nginx.conf文件中,但是当我尝试并重新启动NGINX时,我收到消息: Starting nginx: nginx: [alert] Unable to start the Phusion Passenger watchdog because its executable (/usr/lib/phusion-passenger/agents/PassengerWatchdog) does not exist. This probably means that your Phusion Passenger installation is broken or incomplete, or that your 'passenger_root' directive is set to the wrong value. Please reinstall Phusion Passenger or fix your 'passenger_root' directive, whichever is applicable. (-1: […]
目前我真的没有必要惹上乘客或卡皮斯特拉诺。 我只是想在端口3000启动时运行rails。我试图复制节点的这个教程,尽可能多地运行rails: 我在/etc/init.d/中有一个railsup脚本,如下所示: #!/bin/sh export PATH=$PATH:/usr/local/bin case "$1" in start) cd /root/rails_app; /usr/local/rvm/gems/ruby-2.0.0-p247/bin/rails server -d -p 3005 ;; # starting other stuff *) 我也把它包含在update-rc.d 我得到它的工作,但只有我手动运行脚本 – 它似乎并没有启动时运行。 ../bin/rails在启动时是不可用的吗? 我想有一些关于ruby path \ rvm \ rails的东西,我不知道? 有没有办法使用crontab的@reboot呢?
我在configurationnginx服务我的Rails应用程序的静态文件时遇到了一些麻烦, 我是指应用的public/文件夹中的所有文件,而不仅仅是Rails资产pipe道中的文件。 看来我能够把事情做大部分工作,但我不知道如何把所有东西放在一起。 我的应用程序安装在服务器( /dashboard )的子目录中,而不是Web根目录。 这里是我的各种configuration文件的摘录: config.ru : map Dashboard::Application.config.relative_url_root || "/" do run Rails.application end environments / production.rb : config.relative_url_root = "/dashboard" config.assets.prefix = "/dashboard/assets/" nginx.conf : location /dashboard/ { root /srv/XXX/dashboard/public; location /dashboard/assets/ { gzip_static on; expires max; add_header Cache-Control public; } try_files $uri @unicorn; error_page 500 502 503 504 /500.html; client_max_body_size […]