Tag: apache2

允许子域指向计算机的Apache2配置:端口

我拥有域名“peterlee.com.cn”,我在我的域控制面板中添加了一个A Record: RR Destination IP TTL rs.peterlee.com.cn 10.50.10.75 1 hour 我有一个运行于10.50.10.75:9051的RoR(Ruby on Rails)项目,这意味着用户可以通过http://10.50.10.75:9051访问我的RoR应用程序 我想让用户通过http://rs.peterlee.com.cn访问它,所以我添加了以下VirtualHost文件/站点: ServerName rs.peterlee.com.cn DocumentRoot /usr/website/myapp/current/public PassengerEnabled off ProxyPass / http://127.0.0.1:9051/ ProxyPassReverse / http://127.0.0.1:9051/ RackEnv production RailsEnv production RewriteEngine On # Redirect all requests to the maintenance page if present RewriteCond %{REQUEST_URI} !\.(css|gif|jpg|png)$ RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f RewriteCond %{SCRIPT_FILENAME} !maintenance.html RewriteRule ^.*$ /system/maintenance.html [L] […]

HTTP请求从Web服务器分派到CGI / FastCGI进程

为了更好地了解在Web应用程序中如何处理HTTP请求,像Apache这样的Web服务器如何向其中一个虚拟主机发送请求? 无论框架(Rails / PHP / Java)如何,执行的初始程序是什么? 如果有人可以列举Rails的例子(我知道Rails),我将不胜感激。 提前致谢!

在Rails中,我应该启用serve_static_assets吗?

我目前正在使用Apache代理瘦(使用这篇文章 ) 我的静态资产都不起作用(例如样式表,javascripts)。 Apache是​​否应该为它们提供服务,还是必须在config/environments/production.rb启用config.serve_static_assets ? 如果Apache应该为他们服务,那么我可能做错了什么? 这是我的Apache配置: ServerName example.com ServerAlias www.example.com DocumentRoot /home/r/public_html/example/public RewriteEngine On BalancerMember http://127.0.0.1:5000 BalancerMember http://127.0.0.1:5001 BalancerMember http://127.0.0.1:5002 # Redirect all non-static requests to thin RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://thinservers%{REQUEST_URI} [P,QSA,L] ProxyPass / balancer://thinservers/ ProxyPassReverse / balancer://thinservers/ ProxyPreserveHost on Order deny,allow Allow from all # Custom log file locations ErrorLog /home/r/public_html/example/log/error.log […]

Passenger和Apache2显示文件目录结构而不是应用程序

我在passenger-3.0.9和apache2上设置了rails app。 但是当通过apache2执行rails时,即http / localhost,它会显示rails app文件结构。而不是运行应用程序。 我的日志是 [2011年11月12日星期六21:20:36] [通知] Apache / 2.2.17(Ubuntu)Phusion_Passenger / 2.2.11配置了Suhosin-Patch的PHP / 5.3.5-1ubuntu7.3 – 恢复正常操作 ServerName localhost DocumentRoot /var/www/project_name Options Indexes FollowSymLinks -MultiViews AllowOverride all Order allow,deny allow from all

使用乘客运行Rails 3.0和Rails 3.1应用程序(使用不同的rvm gemsets)

我只是按照这些指示安装了一个新的rvm gemset并在我的本地机器上安装了rails-3.1.0.rc2。 起初我得到一个乘客错误,说rake-0.9.2 gem无法加载,但我发现这提醒我运行“$ passenger-install-apache2-module”。 安装好了提示我将以下内容添加到我的Apache配置文件(/etc/apache2/httpd.conf)中: LoadModule passenger_module /Users/robs/.rvm/gems/ruby-1.9.2-p180@rails-3.1/gems/passenger-3.0.7/ext/apache2/mod_passenger.so PassengerRoot /Users/robs/.rvm/gems/ruby-1.9.2-p180@rails-3.1/gems/passenger-3.0.7 PassengerRuby /Users/robs/.rvm/wrappers/ruby-1.9.2-p180@rails-3.1/ruby 但是,不同的gem集中已有三条线: LoadModule passenger_module /Users/robs/.rvm/gems/ruby-1.9.2-p180@rails-3.0/gems/passenger-3.0.7/ext/apache2/mod_passenger.so PassengerRoot /Users/robs/.rvm/gems/ruby-1.9.2-p180@rails-3.0/gems/passenger-3.0.7 PassengerRuby /Users/robs/.rvm/wrappers/ruby-1.9.2-p180@rails-3.0/ruby 如果我留下两组线都没有注释(@ rails-3.1 gemset是最后一个),并重新启动Apache,我的Rails 3.0应用程序将无法启动。 我发现自己必须注释掉rails 3.1 gemset行,重新启动Apache,然后运行“$ rvm use ruby​​-1.9.2-p180@rails.3.0”。 如果我想运行Rails 3.1应用程序,我必须做相反的事情。 有没有办法让两者都能在没有这些额外步骤的情况下同时运行?

无法上传乘客应用程序behing apache

无法在apache后面的乘客应用程序中上传8.4 MB文件。 通过scp传输相同的文件需要4.1分钟。 错误回溯: [pid = 10222 file = \ text / apache2 / Hooks.cpp:727 time = 2010-05-18 07:13:14.842]:mod_passenger中出现意外错误:接收HTTP上传数据时出错:对等方重置连接(104) Backtrace:在’int Hooks :: handleRequest(request_rec *)’中的’boost :: shared_ptr Hooks :: receiveRequestBody(request_rec *,const char *)’(Hooks.cpp:1084)中(Hooks.cpp:459) 注意:用户没有取消或任何东西。 他在火狐上:-) 日志中看到的其他错误包括: [pid = 16593 file = ext / apache2 / Hooks.cpp:727 time = 2010-05-23 23:06:12.156]:mod_passenger中出现意外错误:浏览器看起来没有完成文件上传:它说它会上传6610086 \ _字节,但发送610155字节后关闭了连接。 用户可能在浏览器中单击了“停止”或他的Interne \ t连接已停止。 Backtrace:在’int […]

无法启动Phusion Passenger看门狗?

我在Ubuntu 10.04上使用Apache2完成了Phusion Passenger设置。 每当我重新启动Apache服务器时,我收到以下错误消息,并且Rails应用程序未运行。 [error] *** Passenger could not be initialized because of this error: 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 ‘PassengerRoot’ directive is set to the wrong value. Please reinstall Phusion […]

使用apache2(或nginx + apache2)配置gitlab

我已经在带有LAMP的Ubuntu14.04服务器中安装了GitLab。 我知道GitLab已经设计用于基于nginx的服务器,但是这个服务器的网络应用程序已经安装在apache2上,我需要它们。 我尝试按照本教程安装GitLab。 我使用了gitlab_7.7.1-omnibus.5.4.1.ci-1_amd64.deb包。 我最终遇到的问题与一些评论的人有关(错误502)。 我尝试通过评论关注此链接 ,看看我是否能找到任何相关信息,但它似乎与我的案例无关。 我一直在寻找通过apache2配置nginx的替代方法,但我找不到任何东西。 这是我在/var/log/gitlab/nginx/gitlab_error.log找到的日志条目: 2015/01/30 19:32:27 [error] 995#0: *3 connect() to unix:/var/opt/gitlab /gitlab-rails/sockets/gitlab.socket failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: mygitlab.com, request: “GET / HTTP/1.1”, upstream: “http://unix:/var/opt/gitlab/gitlab- rails/sockets/gitlab.socket:/”, host: “localhost:8080” 似乎上游套接字配置存在问题。 gitlab-ctl status输出: run: logrotate: (pid 4465) 1488s; run: log: (pid 826) 5087s run: nginx: (pid […]

Web应用程序无法启动乘客错误(Apache2) – 引用不存在的Ruby补丁

使用最新版本的RVM从p247更新到Ruby 2.0.0(P353)的最新补丁后,我遇到了问题。 这是我原始问题的链接,我遇到了旧补丁的丢失的RVN环境文件,该文件已不在我的系统中。 RVM已得到纠正,问题就消失了。 错误:执行rvm upgrade命令后缺少RVM环境文件 – Passenger 4.0.23 我继续使用我的Passenger Enterprise帐户中的gem文件安装了最新版本的Passenger 4.0.29。 我能够安装passenger-install-apache2-module。 但是,当我尝试启动应用程序时,我收到了另一个错误。 An error occurred while starting up the preloader. It exited before signaling successful startup back to Phusion Passenger. Please read this article for more information about this problem. Raw process output: /Users/server1/.rvm/gems/ruby-2.0.0-p353@LightBeCorp_Rails4Ruby2/gems/json-1.8.1/lib/json/ext/parser.bundle: [BUG] Segmentation fault ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13] […]

VPS apache config – 添加最新的乘客gem后,命令’PassengerDefaultRuby’无效

曾经在我的vps中有这个ruby列表: ruby-1.9.2-p320 [ i686 ] =* ruby-1.9.3-p194 [ i686 ] ruby-1.9.3-p374 [ i686 ] ruby-1.9.3-p392 [ i686 ] 今天我在ruby 2.0上的这个vps上安装了一个新的应用程序,所以我将2.0添加到rvm : ruby-1.9.2-p320 [ i686 ] ruby-1.9.3-p194 [ i686 ] ruby-1.9.3-p374 [ i686 ] ruby-1.9.3-p392 [ i686 ] =* ruby-2.0.0-p247 [ i686 ] 安装了passenger和passenger-apache-module ,说明添加这些行: LoadModule passenger_module /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/buildout/apache2/mod_passenger.so PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19 PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.0.0-p247/ruby 到/etc/apache2/apache2.conf并重启apache,重启后我收到此错误 : Syntax error […]