我有一个项目被从github拉到我的/ home分区,并按照惯例做了/ var分区的符号链接。 它看起来如何: / home / vagrant / github / whois-dreyfus – >回购实际项目 / var / www / whois-dreyfus – >符号链接我用于Apache 我有Apache 2.2.22和Passenger 4.0.56安装在一个stream浪者的箱子里,并运行在远处的服务器上。 问题是,当通过我的私人networking访问它时,整个资源库都显示而不是索引。 这意味着如果说我有192.100.93.88指向Apache的索引页面 , 192.100.93.88/whois-dreyfus另一方面显示回购而不是项目的索引页。 此外,我已经使用Webrick在本地机器上testing了这个项目,所以我相信这个问题是来自web服务器。 那么,我如何运行我的rails应用程序? 这个问题是类似的这个线程,但我找不到任何答案导致我的问题。 这是我的configuration文件: /etc/apache2/apache2.conf中 # Load the passenger module for Apache LoadModule passenger_module /opt/passenger/passenger-4.0.56/buildout/apache2$ <IfModule mod_passenger.c> PassengerRoot /opt/passenger/passenger-4.0.56 PassengerDefaultRuby /home/vagrant/.rvm/gems/ruby-2.2.0/wrappers/ruby </IfModule> 在/ etc / apache2的/启用的站点- […]
免责声明:我已经阅读了大量的post在这里,在stackoverflow和其他网页,我不能拿出一个解决scheme,所以希望这会有所帮助。 我们使用nginx和HAProxy在Passenger上运行Rails应用程序。 乘客:4.0.7 Nginx:1.4.1 该应用程序运行良好,但时常,请求花费太长的时间完成: #nginx access.log xxxx – – [19 / Mar / 2015:01:07:19 +0100]“GET / HTTP / 1.0”499 0“ – ”“runscope-radar / 2.0” 请求花费很长时间才能完成,nginx返回一个499,HAProxy将其转换为504.大约30分钟后,服务器恢复正常,但错误不断重现。 我很确定它与HAProxy没有任何关系,因为卷到机器上的本地主机也会返回超时。 服务器上没有什么特别的东西(根据htop,4核心的CPU使用率从来没有超过10%,从8GB到大约只有1GB,loadavg一直在0.1以下)。 我将ulimit设置为65535。 nginx的configuration文件是: user www-data www-data; worker_processes 1; worker_rlimit_nofile 20000; events { worker_connections 768; } http { passenger_root /opt/passenger/passenger-4.0.7; passenger_ruby /usr/bin/ruby1.8; include mime.types; default_type application/octet-stream; sendfile on; tcp_nopush […]
我想知道什么是让用户上传他们的SSL证书的最佳方式。 我有一个基于rails / passenger / nginx的多租户应用程序,我需要每个用户使用他自己的域名和他的SSL证书。 那么这个问题最好的办法是什么? 我不想上传证书,每次上传新证书时都要在每台服务器上重新加载nginx,这是一个很好的解决scheme。
我有一个rails应用程序通过capistrano在aws ec2实例上部署,并且在服务器上也安装了nginx客户端。 每当我尝试使用提供的DNS或公共IP访问我的应用程序时,我所得到的只是浏览器加载了一段时间而没有响应,甚至没有从nginx的错误页面。 这里是我的nginxconfiguration(/ etc / nginx / sites-enabled / default) server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; server_name <public ip>; passenger_enabled on; rails_env production; root /home/ubuntu/myapp/current/public; # redirect server error pages to the static page /50x.html error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } 在运行命令“sudo nginx”时,这是我得到的回应: […]
我有一个Rails应用程序,并希望在特定位置的基本Nginx的基本authentication,现在我这样做 location / { passenger_enabled on; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-FORWARDED_PROTO https; proxy_redirect off; } location /somelocation { auth_basic "Restricted"; #For Basic Auth auth_basic_user_file /usr/local/etc/nginx/.htpasswd; #For Basic Auth passenger_enabled on; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-FORWARDED_PROTO https; proxy_redirect off; } 有没有更好的方法来做到这一点?
背景 Ubuntu 15.10 Apache / 2.4.10(Ubuntu) 模块相关性全部启用: mod_rewrite的 mod_proxy的 mod_proxy_http GitLab社区版8.0.3 GitLab docroot:/ opt / gitlab / embedded / service / gitlab-rails / public 我以这种方式安装GitLab: https ://about.gitlab.com/downloads/#ubuntu1404 问题 在我的服务器上,我有一个运行Apache2(exemple-site.com)的网站。 我有GitLab与捆绑的nginx(exemple-gitlab.com) 我有1个服务器,1个IP和多个FQDN。 像这样,我所有的域名都指向GitLab。 所以exemple-gitlab.com指向GitLab,但exemple-site.com也指向GitLab,也指向其他所有FQDN。 解决方法 我想我必须(而且我试过): 禁用捆绑的nginx并configurationapache2的gitlab(很难做到这一点) 将绑定的nginxconfiguration为apache2的反向代理(很难做到) MAJ:事实上问题是Apache和捆绑的nginx运行在同一个IP上,并且有相同的端口(80)。 而且我不想在81端口上运行一个网站,只有80端口。 我更喜欢为我的所有PHP网站使用apache2,我不介意gitlab是否使用apache2或捆绑的nginx,我只需要使用我的每个网站的所有FQDN,而不是所有的FQDN redirectinf到gitlab。 理解 我不明白如何omnibus或铁路或反向代理工作。 我试过在/etc/gitlab/gitlab.rb禁用捆绑的nginx nginx['enable'] = false # For GitLab CI, use the following: ci_nginx['enable'] […]
我曾在不同的地方看到,使用Ruby通过克隆的rbenv git仓库从源代码编译的Ruby,然后通过RubyGems安装Rails来获取最新版本。 但是,据我所知,这在Debian中并不是最佳实践,他们build议从apt-get获取所有内容 ,因为稍后更新Debian可能会导致问题。 所以,我迷失在这里了,是否应该坚持使用Debian APT提供的Rails软件包? (我知道这是Rails 4.1,我不介意那些shiny的新东西综合症,但我怎么能保证它通过Debian获得安全修复?) 我无法相信通过rbenv从源代码编译Ruby,通过RubyGems安装乘客,独angular兽和rails对于生产服务器来说足够稳定,这真的是人们如何configuration生产环境?
我正在服务一个Rails应用程序在一个sub-uri像https://projects.mydomain.com/app1/ 但我的资产没有加载。 这里是我的nginxconfiguration: location ~ ^/app1(/.*|$) { root /srv/www/app1/current/public; passenger_base_uri /app1; passenger_app_root /srv/www/app1/current; passenger_document_root /srv/www/app1/current/public; passenger_enabled on; } location ~ ^/(assets)/ { root /srv/www/app1/current/public; gzip_static on; expires max; add_header Cache-Control public; } 该应用程序已加载,所有URL / PATH前缀为/ app1 /,但资源未加载。 https://projects.mydomain.com/app1/assets/application-123456.css不起作用 当我尝试没有前缀的资产path时,我可以看到资产存在: https://projects.mydomain.com/assets/application-123456.css工作 任何想法 ? 更新: 增加了error_log /var/log/nginx/error.logdebugging; 当然这是一个编辑的摘录: 2015/12/18 11:15:44 [debug] 27187#0: *1 http process request line […]
我已经安装了最新版本的Kibana4 ElasticSearch堆栈。 日志正在从Ruby上运行的远程应用程序源汇集。 我想search由ruby创build的多行exception。 在kibana中,我们可以search错误并打印附近的行吗? 在kibanasearch栏中的例子,我们可以input类似“未捕获的exception”+5行? (类似于grep -c20) 或者,我可以在kibana界面上使用类似的逻辑创build一个filter/ json查询?
我尝试安装Rails + Passenger + Nginx + Modules,但安装程序开始编译Nginx时出现错误: sh ./configure –prefix='/opt/nginx' –with-http_ssl_module –with-http_gzip_static_module –with-http_stub_status_module –with-cc-opt=-Wno-error –with-ld-opt='' –with-pcre='/tmp/passenger.1x6s546/pcre-8.34' –add-module='/usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.24/src/nginx_module' –with-http_geoip_module –with-http_limit_conn_module –http_limit_req_module –with-http_log_module 而乘客安装后,它开始与Nginx它会引发错误: error: ./configure: error: invalid option "–with-http_limit_conn_module" 什么可能是一个原因?