背景 我使用grafana来显示我们的服务器度量的graphics。 Grafana是一个JS应用程序,在我们的例子中是从石墨中获取数据并在elasticsearch中存储search查询。 所有这三个服务都有自己的虚拟主机,虽然现在在同一台机器上。 由于JS规则,我添加了CORS头到石墨和elasticsearch-vhost。 graphite-vhost是WSGI的路由请求,因为石墨是一个python / django应用程序。 elasticsearch-vhost是将数据从端口443转发到localhost:9200的反向代理。 这有助于不直接向世界开放elasticsearch服务,也给我一个添加CORS头的地方。 到目前为止,这是有效的:grafana可以同时与两个服务进行通信。 出现问题 我添加了Basic Auth身份Basic Auth的grafana和石墨主机。 这些工作正常,如预期。 Grafana能够检索和显示数据。 当将Basic Auth添加到elasticsearch-vhost时,我遇到了问题。 虽然我可以在<Location / >块中添加Auth设置,但似乎禁用了CORS头。 激活身份validation后,我可以在浏览器或curl中使用elasticsearch。 但是,grafana无法在elasticsearch中searchconfiguration的仪表板。 search似乎更复杂,一个GET ,因为grafana开始与OPTIONS -request。 这失败了一个401错误。 有趣的是,Grafana可以检索已知的仪表板(这是一个简单的GET )。 我没有提到在Headers中限制HTTP方法。 所以,总结一下: How can I add basic auth to an apache proxy while using CORS headers? 如果你想看看Apache的configuration,请告诉我哪些部分,我不想张贴三个相当长的虚拟主机“只是可以肯定”。
我正在尝试在Apache中获得反向代理function。 我正在使用Windows Server 2012上的Bitnami RubyStack。以下configuration使Apache甚至无法启动 – error.log似乎没有任何问题。 <VirtualHost *:80> ServerName mydomain.nl ServerAlias mysub.mydomain.nl # this is a Rails application DocumentRoot "C:/Bitnami/rubystack-2.0.0-17/projects/dummy" RewriteEngine On <Proxy balancer://thinservers> BalancerMember http://127.0.0.1:3001 </Proxy> # Redirect all non-static requests to thin RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://thinservers%{REQUEST_URI} [P,QSA,L] # Custom log file locations ErrorLog "C:/Bitnami/rubystack-2.0.0-17/projects/dummy/log/error.log" CustomLog "C:/Bitnami/rubystack-2.0.0-17/projects/dummy/log/access.log" </VirtualHost> 我想要实现的是将端口80上的传入请求转发到3001.我认为可能有问题,因为Bitnami文档根目录也被configuration。 我在Apache中并不舒服。 我已经包含了我需要的代理function的模块。 […]
我正在尝试configuration我的apache,它提供所有的证书文件,以得到一个积极的validation。 要清楚的是没有任何浏览器的问题,我正在谈论openssl s_client和curl 。 以openssl s_client为例,运行如下: CONNECTED(00000003) depth=1 C = IL, O = StartCom Ltd., OU = Secure Digital Certificate Signing, CN = StartCom Class 1 Primary Intermediate Server CA verify error:num=20:unable to get local issuer certificate verify return:0 — Certificate chain 0 s:/C=DE/CN=xxx i:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 1 Primary Intermediate Server CA […]
我重新启动后,我的专用服务器有问题。 在我运行最高命令后,CPU负载平均值是非常高的 top – 23:40:41 up 50 min, 3 users, load average: 236.24, 146.96, 124.29 Tasks: 556 total, 1 running, 555 sleeping, 0 stopped, 0 zombie Cpu(s): 1.2%us, 0.2%sy, 0.0%ni, 0.0%id, 98.6%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 16230212k total, 2994040k used, 13236172k free, 26404k buffers Swap: 2097144k total, 0k used, 2097144k free, 我试图阻止httpd,它显示“确定”,但运行“服务httpd状态”后,它仍然显示它正在运行。 在运行“ps -ef | […]
我安装了iotop,我看到一个命令,我不明白,它使用我的IO的96-99%? 就是这个: find /var/www/virtual/webpult.hu -type f -path */phptmp/sess_* -cmin +24 -exec rm -v {} ; 我上传了iotop和htop截图的图片。 我安装了debian squeeze和i-mscp。 该页面是webpult.hu,它运行prestashop。 这里截图 现在,启动我的服务器30分钟后磁盘读取为8M / s。 相同的TID吃了它。
我在虚拟主机中有这条线: CustomLog /var/log/access.log combined 但是我想要一个特定的日志来写每个特定目录的请求 例如 我在公众中有这个子目录: user@/var/www # ls index.test images/ test.php 如何写一个日志,当用户提出请求任何文件内的images目录? 编辑:这主要的想法是防止主日志文件增长很多,并简化search
我目前正在研究如何使用IP地址作为访问控制的一种forms:例如,如果请求来自特定的IP地址或范围(例如:192.168.100.0/24),则只允许访问Apache VirtualHost。 我担心的是,是否有可能欺骗他们的IP地址,使其看起来好像他们的请求来自这个地址?
我遇到的问题是,当我从主机访问http://d7.subdomain.example.org时,它会将我带到默认的apache It Works页面。 我在带有带有virtualbox提供程序的Ubuntu 12.04 Vagrant框的Mac主机上。 我已经检查了sites-enabled /,并且在运行sudo a2ensite d7.subdomain.example.org命令之后,站点确实出现在那里。 如果我去http://d7.subdomain.example.org/drupal/site-docroot它把我带到正确的地方。 这似乎是无视我的虚拟主机一起。 我的stream浪文件: # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure(2) do |config| config.vm.box = "precise32" config.vm.box_url = "http://files.vagrantup.com/precise32.box" config.hostmanager.enabled = true config.hostmanager.manage_host = true config.vm.define "drupal" do |node| node.vm.hostname = "d7.subdomain.example.org" node.vm.network :private_network, ip: "172.22.22.26" node.hostmanager.aliases = [ "www.d7.subdomain.example.org" ] end […]
这是我的configuration为ssl: <VirtualHost *:443> DocumentRoot /path/todirectory/ SSLEngine on SSLCertificateFile /etc/httpd/ssl/server.crt SSLCertificateKeyFile /etc/httpd/ssl/server.key <Directory "/path/todirectory/"> Options Indexes SymLinksIfOwnerMatch FollowSymLinks AllowOverride All Order deny,allow Allow from all </Directory> <Location /> AuthType shibboleth require shibboleth </Location> </VirtualHost> https:// servername工作,但https:// servername /path/ todirectory不起作用。 我得到404可能是什么原因?
3 Apache每周日重新启动。 问题是:服务器上有一个encryption私钥的证书。 作为在自动重启过程中没有提供的密码,apache会停下来,所有的网站都会closures。 我想停止每周重新启动Apache。 怎么样? 这是当时的apache日志。 在[notice] caught SIGTERM, shutting down之前[notice] caught SIGTERM, shutting down没什么关系,如果你想知道… [Sun Feb 15 03:37:12 2015] [notice] caught SIGTERM, shutting down [Sun Feb 15 03:37:12 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Sun Feb 15 03:37:13 2015] [error] Init: Unable to read pass phrase [Hint: key introduced or changed before […]