unicorn

rails deployment using nginx & unicorn: 403 forbidden error

大兔子大兔子 提交于 2019-12-04 20:08:25
I have just setup a VPS (Centos 6.3) and deploy my app using capistrano. The VPS runs nginx & unicorn. I'm getting a 403 Forbidden error when visiting the server: this line appears in /var/log/nginx/error.log: *5 directory index of "/var/www/current/public/" is forbidden, client: xxxxx, server: xxx, request: "GET / HTTP/1.1", host: "xxxx" However, if I add the index.html to my rails app in ./public, everything works without problem. This makes me think that the routes aren't working. I have also set the permissions for all folders of /var/www using chmod -R 755 * (probably not the best idea in

Unicorn Memory Usage filling up almost all the RAM

梦想与她 提交于 2019-12-04 17:53:23
问题 There are essentially 3 problems here: 1) Unicorn seems to be steadily filling up all the RAM, causing me to remove workers manually. 2) Unicorn seems to be spawning additional workers for some reason, although I have specified a fixed number of workers (7 of them). This is partly causing the RAM buildup, which also is causing me to remove workers manually. 3) Zero downtime deployment is unreliable in my case. Sometimes it picks up the changes, sometimes I get gateway timeouts. Each deploy

Rails, Mongoid & Unicorn config for Heroku

淺唱寂寞╮ 提交于 2019-12-04 15:13:58
问题 I am using Mongoid 3, with Rails 3.2.9 and Unicorn for production. Would like to setup a before_fork & after_fork for the connection to mongodb, found the following code for active record: before_fork do |server, worker| # Replace with MongoDB or whatever if defined?(ActiveRecord::Base) ActiveRecord::Base.connection.disconnect! Rails.logger.info('Disconnected from ActiveRecord') end end after_fork do |server, worker| # Replace with MongoDB or whatever if defined?(ActiveRecord::Base)

Unicorn service upstart script throws “-su: bundle: command not found”

余生颓废 提交于 2019-12-04 14:46:52
I recently created a VPS on DigitalOcean to host a rails app. I followed their guide to setup Unicorn with my application. https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-unicorn-and-nginx-on-ubuntu-14-04 A problem occurred when I ran sudo service unicorn_appxyz start . The error given was -su: bundle: command not found I traced the init.d script and pasted the evaluated server start up command in terminal and it works fine when executed under the user joe (the user which rbenv is install and the owner of the app). The evaluated command is su - joe -c cd /home

Acceptor pooling and load balancing in Erlang?

丶灬走出姿态 提交于 2019-12-04 12:01:48
问题 From http://www.erlang.org/doc/man/gen_tcp.html#accept-1: It is worth noting that the accept call does not have to be issued from the socket owner process. Using version 5.5.3 and higher of the emulator, multiple simultaneous accept calls can be issued from different processes, which allows for a pool of acceptor processes handling incoming connections. (Q1) Does it mean that we can have Unicorn-style load balancing in Erlang? (Q2) If so, are there any existing servers or libraries making use

Unicorn Eating Memory

こ雲淡風輕ζ 提交于 2019-12-04 10:47:41
问题 I have a m1.small instance in amazon with 8GB hard disk space on which my rails application runs. It runs smoothly for 2 weeks and after that it crashes saying the memory is full. App is running on rails 3.1.1, unicorn and nginx I simply dont understand what is taking 13G ? I killed unicorn and 'free' command is showing some free space while df is still saying 100% I rebooted the instance and everything started working fine. free (before killing unicorn) total used free shared buffers cached

区块链手机未来该走向何方?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 06:01:44
近期,王思聪和罗永浩被列为“失信执行人”后,波场CEO在微博上高调发声,称帮王思聪还债,同时愿意出百万人民币一年聘请罗永浩担任波场创业精神代言人。这种所谓“不要脸”的蹭热度,反而着实让人觉得波场已经失去了原本的战斗力。与此同时,OKEx首席战略官徐坤在微博邀约其加盟,称罗永浩曾表示“一定会做区块链手机”,OKEx可对此进行内部孵化或者投资。 2018年5月,罗永浩做客王峰十问时提到“一定会做区块链手机”,同时提及的还有“智能手机是一个烂熟的行业”,且行业遇到创新瓶颈。 然而,徐坤的这种邀约也被视为蹭热度。去年年初,多家国产智能手机厂商宣布推出区块链手机的消息也被质疑蹭热度,带给大家的是,区块链手机究竟功能如何?让人值得思考。 2018年初,国内区块链风潮从不眠不休的微信社群席卷至而来,经历空气币、山寨币肆虐、94定性叫停首次代币公开发行等风波,如今,高层定调让区块链回归风口。新技术的发展常给行业带来新方向,应运而生又曾昙花一见的区块链手机,这一次是否会有新的发展走向? 第一款区块链手机 2018年年初,伴随着国内区块链风潮,国内手机厂商相继发布区块链手机,以糖果创世版s11、长虹r8、联想S5为首。数月后,htc也宣布将发布区块链手机HTC Exodus。有趣的是这些手机厂商均称自己的手机产品为第一款区块链手机。 据官网介绍,SUGAR糖果手机“创世版”于1月17日发布

How to configure nginx + Unicorn to avoid timeout errors?

孤者浪人 提交于 2019-12-04 04:05:28
I have a Rails (v3.2.13, Ruby 2.0.0) application running on nginx + Unicorn (Ubuntu 12.04). All is working well, except when an admin user is uploading users (thousands) via a CVS file. The problem is that I have set timeout to 30 seconds and the import process takes much more time. So, after 30 seconds I get an nginx 502 Bad Gateway page (Unicorn worker is killed). The obvious solution is to increase timeout, but I don't want this because it'll cause another problems (I guess), because it's not a typical behavior. Is there a way to handle this kind of problems? Thanks a lot in advance. PS:

Rails 404 error for Stylesheet or JavaScript files

天大地大妈咪最大 提交于 2019-12-04 02:11:32
问题 Rails can't load (404 error) CSS & JS files on production but has no problem loading them in development. I'm using Capistrano for deployment and running Rails 3. My path on development is /www/myapp but my path on production is /www/myapp/current . The application itself seems to work fine, so the issue seems to be isolated to CSS/JS files. I tried setting the RAILS_ROOT variable to /www/myapp/current in environments/production.rb but it did not make any difference, the files still don't

Rails shows IP as 127.0.0.1 when accessed from private NIC, but Nginx shows the correct IP. Public IP gets forwarded fine

怎甘沉沦 提交于 2019-12-04 02:08:05
We are running a Rails application on Unicorn + Nginx. The server has two NICs that we use. eth0 handles requests for the public internet, and eth2 handles requests from our private network. When a request comes through eth0 , the nginx logs show the public IP, and the Rails logs also show this IP. However, when a request comes through eth2 , the nginx logs show the private IP correctly (e.g. 192.168.5.134 ), but the Rails logs show 127.0.0.1 . So it seems like public requests on eth0 get their X-Forwarded-For header set correctly, but this isn't happening for requests on eth2 . Our nginx