Articles of apache 2.2

无法启动Phusion乘客看门狗

我试图通过使用命令在Apache2服务器上安装Passenger(mod_rails) 1. gem install passenger 2. passenger-install-apache2-module 乘客得到安装,我将下面的行添加到我的configuration文件 LoadModule passenger_module /home/ec2-user/.rvm/gems/ruby-1.9.2-p290/gems/pass enger-3.0.11 / ext / apache2 / mod_passenger.so PassengerRoot /home/ec2-user/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.11 PassengerRuby /home/ec2-user/.rvm/wrappers/ruby-1.9.2-p290/ruby 一旦我完成了所有这些步骤,我开始访问Apache2服务器 。 我得到以下乘客错误: [错误] ***乘客无法初始化,因为这个错误:无法启动Phusion乘客看门狗,因为它的可执行文件(/ usr / lib / phusion-passenger / agents / PassengerWatchdog)不存在。 这可能意味着您的Phusion Passenger安装被破坏或不完整,或者您的“PassengerRoot”指令被设置为错误的值。 请停止使用Phusion Passenger,或者修复您的“PassengerRoot”指令,以适用者为准。 得到这个错误之后,我再次用这些步骤re-installed Passenger ,但是这个问题仍然是一样的。 感谢您解决此问题的帮助。

在没有HTTPS的情况下访问启用了SSL的站点时,Apache会发送纯文本响应

我从来没有遇到过这样的事情。 我试图简单地redirect页面到HTTPS版本,如果它确定HTTPSclosures,而是显示一个HTML页面,而不是实际redirect; 甚至更奇怪,它显示为文本/平原! VirtualHost声明(sorting): ServerAdmin [email protected] DocumentRoot "/path/to/files" ServerName example.com SSLEngine On SSLCertificateFile /etc/ssh/certify/example.com.crt SSLCertificateKeyFile /etc/ssh/certify/example.com.key SSLCertificateChainFile /etc/ssh/certify/sub.class1.server.ca.pem <Directory "/path/to/files/"> AllowOverride All Options +FollowSymLinks DirectoryIndex index.php Order allow,deny Allow from all </Directory> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule .* https://example.com:6161 [R=301] 页面输出: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> […]

如何使Apache返回400错误的自定义页面格式错误的主机头?

我想我所要求的有点难以理解,所以我正在努力简化它。 我需要我的服务器有一个自定义的400错误页面,当它收到一个格式错误的主机头的请求。 我最想要的是ErrorDocument 400 \somepage.php 我可以通过访问一个页面,如http:\\myserver\bla%bla ,生成400错误,这将会去我的脚本罚款。 同样,我可以将\somepage.php部分更改为Test text ,Apache将返回该文本。 但是,如果400错误是由于主机头格式错误造成的,它将使用文本而不是网页。 任何人都可以解释这一点,并给我一个工作的解决scheme之前,我把我所有的头发? (已经失去了很多这个!)。

Apache不调用智能HTTP CGI

我正在build立一个git–http-backend和Smart HTTP的git服务器,但是Apache似乎没有调用Smart HTTP CGI: $ curl http://localhost/repo/myproject.git/info/refs?service=git-receive-pack 2ddf56592a0f55456b8c42dc9f2cb9289f083f53 refs/heads/1.0.x 55079bb13d9af8a9164ad0d24b654cbfe119bc7e refs/heads/master 这是我的configuration: <VirtualHost *:8000> ServerName localhost DocumentRoot /opt/local/apache2/htdocs/repo SetEnv GIT_PROJECT_ROOT /opt/local/apache2/htdocs/repo SetEnv GIT_HTTP_EXPORT_ALL ScriptAlias /repo/ /usr/libexec/git-core/git-http-backend/ AliasMatch ^/repo/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /opt/local/apache2/htdocs/repo/$1 AliasMatch ^/repo/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /opt/local/apache2/htdocs/repo/$1 ScriptAliasMatch \ "(?x)^/repo/(.*/(HEAD | \ info/refs | \ objects/(info/[^/]+ | \ [0-9a-f]{2}/[0-9a-f]{38} | \ pack/pack-[0-9a-f]{40}\.(pack|idx)) | \ git-(upload|receive)-pack))$" \ /usr/libexec/git-core/git-http-backend/$1 <Directory "/usr/libexec/git-core/"> Options […]

HTTPS比HTTP慢50倍以上

我有一个网站,使用https传输一个JavaScript文件到客户端。 该网站是getsimpleapps.com 。 事实certificate,这个文件的加载速度比http(380ms)下的速度慢了52倍(20.08s – 29.08s)。 该网站的主页共享与javacript文件相同的缓慢。 http://getsimpleapps.com https://getsimpleapps.com 我最近已经从dreamhost切换到了linode,并且破解了让SSL在新服务器上工作,直到它成功。 我没有做任何疯狂的configuration。 linode运行Ubuntu 12.04,该站点位于(LAMP)堆栈的顶部。 我对堆栈溢出社区的问题是:如何解决我的服务器上的SSL和HTTPS问题? 我知道堆栈溢出散布着有关HTTPS缓慢的问题,但没有给出真正的解决scheme。 Ubuntu的教程或configuration指南将是理想的。 文件:/etc/apache2/sites-enabled/getsimpleapps.com <VirtualHost *:80> ServerAdmin [email protected] ServerName getsimpleapps.com ServerAlias www.getsimpleapps.com DocumentRoot /srv/sites/getsimpleapps.com/public/ ErrorLog /srv/sites/getsimpleapps.com/logs/error.log CustomLog /srv/sites/getsimpleapps.com/logs/access.log combined </VirtualHost> <VirtualHost 50.116.58.18:443> SSLEngine On #SSLCertificateFile /etc/apache2/ssl/www.getsimpleapps.com.crt #SSLCertificateKeyFile /etc/apache2/ssl/www.getsimpleapps.com.key #SSLCACertificateFile /etc/apache2/ssl/comodo.crt SSLCertificateFile /etc/apache2/ssl/dreamhost/dh.crt SSLCertificateKeyFile /etc/apache2/ssl/dreamhost/dh.key SSLCACertificateFile /etc/apache2/ssl/dreamhost/dh.cer ServerAdmin [email protected] ServerName getsimpleapps.com ServerAlias www.getsimpleapps.com […]

Nginx作为反向代理:如何正确configuration网关超时?

我们已经将Nginxconfiguration为Apache服务器场的反向代理,但是我遇到了网关超时问题。 我们的目标是:“在一秒内发送请求,但如果真的需要更长的时间,则无论如何都要发送”,这对我来说意味着“尝试第一个上游的Apache服务器最多500毫秒,如果我们得到一个超时/一个错误,尝试下一个,直到我们终于成功。“ 现在我们的相关configuration是这样的: location @proxy { proxy_pass http://apache$request_uri; proxy_connect_timeout 1s; proxy_read_timeout 2s; } […] upstream apache { server 127.0.0.1:8001 max_fails=1 fail_timeout=10s; server 10.1.xx:8001 max_fails=1 fail_timeout=10s backup; server 10.1.xx:8001 max_fails=1 fail_timeout=10s backup; server 10.1.xx:8001 max_fails=1 fail_timeout=10s backup; } 这里的问题是,nginx似乎误解了这一点:“尝试在一秒钟内从整个上游集群获得响应,如果我们不这样做,就会发出50倍的错误 – 没有任何限制尝试任何上游服务器的时间限制”显然不是我们想到的。 有没有办法让nginx做我们想要的?

Apache的反向代理到一个embedded式的Tomcat

我正在尝试为通过SSL运行tomcatembedded式服务器的应用程序设置反向代理。 该应用程序需要在端口9002上运行SSL,所以我没有办法为这个应用程序“禁用SSL”。 当前的安装模式如下所示: [192.168.0.10:443 – Apache with mod_proxy] –> [192.168.0.10:9002 – Tomcat App] 在Google如何做这样的设置(和testing)之后,我碰到了这个: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/861137 这导致我的当前configuration(尝试模拟wget的 – secure-protocol = sslv3选项) /etc/apache2/sites/enabled/default-ssl: <VirtualHost _default_:443> SSLEngine On SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key SSLProxyEngine On SSLProxyProtocol SSLv3 SSLProxyCipherSuite SSLv3 ProxyPass /test/ https://192.168.0.10:9002/ ProxyPassReverse /test/ https://192.168.0.10:9002/ LogLevel debug ErrorLog /var/log/apache2/error-ssl.log CustomLog /var/log/apache2/access-ssl.log combined </VirtualHost> 问题是错误日志显示错误:14077102:SSL例程:SSL23_GET_SERVER_HELLO:不支持的协议 完整的请求日志: [Wed Mar 13 20:05:57 […]

Apache / mod_cache:“错误103软件导致连接中止”

我们不断得到在apache错误日志中popup下面的错误: [error] (103)Software caused connection abort: cache: error returned while trying to return disk cached data 这个错误发生在不规则的间隔,但平均每10分钟大约1-2次。 在过去的两天,该网站已经下降了好几次,可能是因为这个错误。 在日志中popup的唯一的其他错误是client denied by server configuration在过去的2天内发生了约10次。 我们使用Apache / 2.2.14(Ubuntu)。 最高回报: top – 15:47:19 up 4:28, 2 users, load average: 0.36, 0.78, 1.32 Tasks: 95 total, 1 running, 94 sleeping, 0 stopped, 0 zombie Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.2%id, […]

redirectSSL身份validation失败的用户

我configuration了一个启用SSL和SSL客户端身份validation的VirtualHost,所有这些都在apache2 2.2.8(ubuntu server 8.04)上。 所有SSL证书(CA,服务器证书,客户端证书,CRL)都是使用openssl命令行生成的。 如果客户端证书无效(不存在,过期或撤销),我想将用户redirect到自定义错误页面。 这是我的虚拟主机的configuration: <VirtualHost *:443> ServerName myserv.example.com DocumentRoot /var/www/myserv/ CustomLog /var/log/apache2/myserv.access.log combined ErrorLog /var/log/apache2/myserv.error.log LogLevel warn SSLEngine on SSLOptions +StdEnvVars +ExportCertData SSLCertificateFile "/etc/apache2/ssl/certs/servcrt.pem" SSLCertificateKeyFile "/etc/apache2/ssl/private/servkey.pem" SSLCACertificateFile "/etc/apache2/ssl/certs/ca.pem" SSLCARevocationPath "/etc/apache2/ssl/crl/" SSLCARevocationFile "/etc/apache2/ssl/crl/crl.pem" <Directory /var/www/myserv/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny Allow from all SSLVerifyClient optional SSLVerifyDepth 1 RewriteEngine on RewriteCond […]

Tomcat mod_jk的压缩导致Apache httpd

我正在我的系统本地开发一个Web应用程序,使用Tomcat(tomcat-7.0.52)提供服务。 在生产中,我想用一个Apache httpd(Apache / 2.2.15)来对付Tomcat。 这工作,我设法根据需要configurationcaching。 现在我想configuration压缩,但似乎无法获得Apache httpd来修改从Tomcat获得的响应。 但是,正如我在这里读到的,这是做这件事的首选方式。 mod_jk压缩只在httpd和Tomcat之间,如果我想直接在Tomcat中configuration压缩,我需要一个额外的servlet。 我在我的虚拟主机文件中有以下行来启用压缩静态和httpd服务的内容: #SetOutputFilter DEFLATE AddOutputFilterByType DEFLATE text/plain text/html application/json text/xml text/css text/javascript 启用第一行并没有改变我的任何东西。 我使用mod_jk将这些请求传递给Tomcat: <IfModule mod_jk.c> JkMount /myapp/j_security_check worker1 JkMount /myapp/*.jsp worker1 JkMount /myapp/DataSourceLoader worker1 JkMount /myapp/ServletLogin worker1 </IfModule> 使用Firebug我可以看到,Tomcat返回的请求的MIMEtypes是 /myapp/j_security_check: "text/plain; charset=UTF-8" (with the space) /myapp/*.jsp: "text/plain; charset=UTF-8" (with the space) /myapp/DataSourceLoader: "application/json;charset=UTF-8" (without space) […]