Articles of apache 2.2

如何反向代理子域到我的局域网上的另一台计算机,在OS X服务器?

可视化这个结果: site1.example.com – >我的单个公共IP – >端口转发80和443到LAN 192.168.1.10在OS X上运行OS X Server 4.1的Mac 10.10优胜美地 site2.example.com – >我的单个公共IP – >局域网192.168.1.10 – >反向代理? – >:80和:443在局域网192.168.1.15 这是在一个networking,我没有select添加另一个公共IP。 #1已经正常运行。 #2是最难的部分,主要是因为我在#1上运行OS X Server ,而代理设置似乎并不是相对直接的Apache ,例如: <VirtualHost *:80 *:443> ServerName site2.example.com ProxyRequests off ProxyPass / http://192.168.1.15/ ProxyPassReverse / http://192.168.1.15/ </VirtualHost> 也就是说,OS X服务器在奇怪的地方有Apacheconfiguration文件,我的理解是,它喜欢用在GUI中做出的新更改覆盖它们,所以我试图找出“正确”的方式来做到这一点OS X服务器。 我的一位朋友build议,尽pipeOS X Server文档的Web应用程序部分几乎不包含任何细节,但可能有办法使用OS X Server的webappctl命令并编写适当的webapp.plist 。 看着苹果build议的man页和他们的示例.plist文件,在我看来,他们的“networking应用程序”的想法真的要连接到一个目录(即site1.example.com/webapp),而不是一个子域(如上面#2所示)。 也许我只是不完全想出了.plist格式呢? 什么是在OS X服务器上执行此操作的“正确”方法?

在端口8080上lockingJenkins

我的同事在我们的一台testing服务器上安装了Jenkins。 当我访问服务器的IP和端口8080,jenkins正在运行,即99.999.999.999:8080 我想将Jenkins应用程序locking到外部世界,并且只能从内部IP地址获得它。 所以我在apache中设置了一个VirtualHost,如下所示: <VirtualHost *:80> ServerName jenkins.mytestserver.com ErrorLog logs/jenkins.mytestserver.com-error_log CustomLog logs/jenkins.mytestserver.com-access_log common #ProxyPass /usr/share/tomcat6/webapps/ ajp://127.0.0.1:8080/usr/share/tomcat6/webapps/ #ProxyPassReverse /usr/share/tomcat6/webapps/ ajp://127.0.0.1:8080/usr/share/tomcat6/webapps/ #ProxyRequests Off ProxyPass / http://localhost:8080/ nocanon ProxyPassReverse / http://localhost:8080/ ProxyRequests Off ProxyPreserveHost On <Location /> order deny,allow deny from all Allow from 11.111.111.111 </Location> </VirtualHost> Vhost的作品,我可以通过jenkins.mytestserver.com访问jenkins,并从外部世界阻止。 如何通过99.999.999.999:8080阻止外部世界访问它? 我有一种感觉,我已经做了ReverseProxy上面的方式是不正确的,因为它只是传递请求到http:// localhost:8080 /这是一样的http://99.999.999.999:8080 我一直在引用下面的文档: https://wiki.jenkins-ci.org/display/JENKINS/Apache+frontend+for+security https://www.mulesoft.com/tcat/tomcat-connectors (我认为我的问题的答案是在这个文档,但我不明白)。 任何帮助赞赏。 问候,斯蒂芬

如何在局域网中正确保护与实际服务器的反向代理通信

我有Nginx作为基于主机名的请求的网关和反向代理。 但是,与LAN中的实际服务器的通信并不安全。 连接是否保持以下设置进行encryption,还是我应该在实际的Web服务器中保护Apache? 必须指出的是,局域网不能完全信任。 server { listen 443 ssl; ssl_certificate /etc/nginx/ssl/wildcard.xxxx.edu.ar.crt; ssl_certificate_key /etc/nginx/ssl/wildcard.xxxx.edu.ar.key; server_name tracker.yyyy.xxxx.edu.ar; location / { proxy_pass http://192.168.yy.xx:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } } server { listen 80; server_name tracker.yyy.xxxx.edu.ar; return 301 https://$server_name$request_uri; }

错误使用PROXY访问URL时,无法检索请求的URL

我收到这个错误消息: ERROR The requested URL could not be retrieved The following error was encountered while trying to retrieve the URL: http://xxx Read Timeout The system returned: [No Error] A Timeout occurred while waiting to read data from the network. The network or server may be down or congested. Please retry your request. Your cache administrator […]

看看有什么填满了服务器的内存?

我们的网站越来越频繁。 每个另一天。 服务器的响应时间太长,只是半空白。 如果我查看浏览器源代码,我看到: 无法连接到内存caching服务器 所以,我已经联系了Rackspace的支持。 几次,每次发生这种情况。 试图了解导致问题的原因。 他们只能说服务器内存不足。 现在他说他“认为”最近的问题是由于“ MaxRequestWorkers ”造成的。 我们的网站没有太多的stream量,没有太多的数据。 有些东西真的很奇怪 我不明白怎么可能,我们甚至击中了任何东西。 但是,我真的想要一个工具来更好地监视服务器。 一个UI工具。 我想看看当内存不足时,服务器内存是如何填充的。 他们说,Rackspace看不到它。 这在某种程度上可能吗? 你知道是否有可能与例如New Relic ? 我去了他们的网站,但不明白,如果是的话。

XAMPP Mac OSX上的OpenSSL

首先,在terminal上使用以下命令获取localhost.csr,localhost.key和localhost.crt: 请求: openssl req -new -newkey rsa:2048 -nodes -keyout localhost.key -out localhost.csr 证书: openssl x509 -req -days 365 -in localhost.csr -signkey localhost.key -out localhost.crt 我在这里跟着这个问题,并在httpd-ssl.conf上更新这些directives : SSLCertificateKeyFile "/Applications/XAMPP/xamppfiles/apache2/ssl-certs/localhost.key" SSLCertificateFile "/Applications/XAMPP/xamppfiles/apache2/ssl-certs/localhost.crt" 在MyApache中,启用了SSL。 当我重新启动本地主机,并转到http://localhost ,绿色标志出现,但我得到: Access Forbidden Error 403 You don't have permission to access the requested directory. There is either no index document or the directory […]

切换DNS正在打破httpsredirect

我们(我的公司)最近把我们的名字服务器从GoDaddy切换到亚马逊。 我们的网站仍然在GoDaddy托pipe。 在切换名称服务器之前,一切正常。 我们有一个网站https://example.com ,如果它最初是以http身份input的,它将redirect到https 。 我们有第二个网站位于example.com/second并在https://second.com解决。 这与从http请求redirect到https的第一个站点的作用相同。 现在我们切换了名称服务器, https不再parsing。 如果我去http://second.com/non-http-part不需要redirect,它的工作原理。 但是进入它redirect的索引,导致页面根本无法加载。 所有的https://example.com都不加载。 我们已经联系了亚马逊,他们认为这是.htaccess文件的问题。 这对我来说似乎很奇怪,因为这听起来更像是一个DNS问题,但这不是我的专业领域,所以我完全可能是错的。 以下是我们的.htaccess文件。 rewriteengine on rewritecond %{HTTPS} off rewritecond %{HTTP_HOST} ^www.example.com$ [OR] rewritecond %{HTTP_HOST} ^example.com$ rewriterule ^(.*)$ "https\:\/\/example\.com\/$1" [R=301,L] #—[SITE PASSWORD PROECTION] #AuthName "Restricted Area" #AuthType Basic #AuthUserFile /home/some_user/public_html/example/includes/security/.htpasswd #AuthGroupFile /dev/null #require valid-user #—[CENTRALIZED REQUESTED] <IfModule mod_rewrite.c> RewriteBase / </IfModule> #—[OPTIONS AND […]

达到MaxClients时的Apache超时/死锁

我使用mod_php(PHP 5.3)在Debian Squeeze上运行Apache 2.2,执行MPM,在多个端口(使用同一台机器运行memcached)上侦听。 在过去的6个星期左右,我遇到了所有Apache连接超时/死锁的情况。 重新启动Apache将解决这个问题,在几个小时之间的某个地方。 在服务器上运行的PHP应用程序除了在同一台计算机的单独端口上运行后端REST API之外,还包括一个面向用户的Web UI。 Web UI应用程序通过http://127.0.0.1:8888/在大多数页面加载上向后端API发送1到3个连续的REST请求。 这些超时错误首先在PHP的错误日志中被注意到,因为30秒之后REST客户端的超时错误。 匹配超时也可以在Apache的错误日志中看到。 它们以突发forms出现,所有请求都将超时,然后一批请求将迅速而成功地处理(看起来),然后是另一批超时。 在几分钟的时间窗口内,8-25秒将只是超时,随后可能是一秒钟的请求正在被处理,接着超过8-25秒的超时。 如果“请求突发”之前的“超时窗口”较短,则后面的一个会更长。 当这个问题出现的时候,任何应用程序中的curl http://localhost/server-status或者curl请求都会返回到一个PHP脚本,或者超时或者失败,或者有时会返回25到60秒。 在此期间,CPU可用,RAM可用,IO显示正常(虽然这是我不擅长监视的一件事),并且SYN_RECV状态下的套接字数量远低于系统的somaxconn和Apache的ListenBacklog (但是我确实看到在积压中等待的sockets)。 在debugging和研究过程中,我注意到很多事情是没有意义的。 首先,在我上面的curl http://localhost/server-status示例中, curl成功连接和发送数据,但从来没有得到响应。 即使经过了45分钟以上,Apache似乎也没有重置连接或任何东西, curl只是挂起和等待。 例如: ~# curl -vv http://localhost/server-status * About to connect() to localhost port 80 (#0) * Trying 127.0.0.1… connected * Connected to localhost (127.0.0.1) port 80 (#0) > GET /server-status […]

在OS X服务器上启用标题模块

我一直在使用OS X服务器一段时间,发现任何我尝试手动编辑Apacheconfiguration文件的尝试都会受到阻碍。 我在优胜美地10.10.3(全部是最新的)上使用服务器4.1,configuration文件即时编辑是/library/server/web/config/apache2/httpd_server_app.conf 我已经确定mod_headers.so模块没有被注释掉,并在configuration文件中添加了以下几行: <VirtualHost *:443> Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload" </VirtualHost> 但是当我尝试用curl -I来检查标题时,没有看到HSTS。 如果任何人都可以帮助我在OS X服务器上设置HSTS,或者在尝试编辑configuration文件时提供一般性的错误信息,我将非常感激。 我曾尝试configuration过去的其他模块,例如压缩或重写,结果类似。

/etc/init.d/apache2文件正在被日志旋转

我监视了一些奇怪的行为。 每周logrotate进程时,apache2守护进程脚本/etc/init.d/apache2被转动,就像它是一个日志文件一样。 第一周它创build了另一个文件apache2.1并清空了apache2。 接下来的一周,它做了apache2.2和apache2.1,并清空apache2。 等等。 -rwxr-xr-x 1 root root 6461 2015-04-26 06:25 apache2.4 -rwxr-xr-x 1 root root 6461 2015-05-03 06:25 apache2.3 -rwxr-xr-x 1 root root 6461 2015-05-10 06:25 apache2.2 -rwxr-xr-x 1 root root 6461 2015-05-17 06:25 apache2.1 -rwxr-xr-x 1 root root 0 2015-05-24 06:25 apache2 我不知道这是一个Apache更新错误或一些计划的工作。 这是我的日志旋转文件: /var/log/apache2/*.log { weekly missingok rotate 52 compress delaycompress […]