我非常需要帮助。 我阅读了echoditto博客( http://www.echoditto.com/blog/never-touch-your-local-etchosts-file-os-x-again )上的文章,并遵循了在我的Mac上设置dnsmasq的build议使用自制软件。 现在我遇到了一个我无法解决的问题,我需要帮助,因为这完全削弱了我的开发工作。 最初,在执行dnsmaqs之后,我根本无法加载我的站点……但我能够通过将httpd-vhosts.conf文件的内容更改为以下内容来解决该问题: #allow access to the Hosts directory where your sites are <Directory "/Volumes/sites"> Options Indexes FollowSymLinks MultiViews AllowOverride All #you could configure the following to only allow access from localhost Order allow,deny Allow from all </Directory> #get the server name from the Host: header UseCanonicalName Off VirtualDocumentRoot /Volumes/sites/%0/ 现在,我可以将浏览器指向http://domainname.dev/并加载该站点。 但是,使用Joomla,我遇到了mod_rewrite的问题: […]
运行Windows Server 2008 R2 端口8080上的nginx端口80上的Apache Apache正在托pipe指令中configuration的5个网站。 我正在尝试将nginxconfiguration为Apache前的代理,(我将在完成testing后反转端口号)。 nginx.conf包含这个服务器, server { listen 8080; server_name www.domain1.com; root PATH/domain1/; index index.html index.htm index.php; location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { expires 365d; } ## send request back to apache1 ## location / { proxy_pass http://127.0.0.1; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_redirect off; proxy_buffering off; proxy_set_header Host $host; proxy_set_header […]
我正在尝试使用Apache在我的服务器上本地运行的Cloud9实例设置反向代理。 我有以下设置: <VirtualHost *:80> ProxyPreserveHost On ProxyPass / http://localhost:3131/ ProxyPassReverse / http://localhost:3131/ ServerAdmin [email protected] ServerName cloud9.mydomain.org </VirtualHost> 我也尝试重新sorting的指令,所以ServerAdmin和ServerName第一。 到目前为止,如果我点击http://cloud9.mydomain.org ,我得到一个浏览器错误,说它无法连接。 Apache的access.log或error.log中也没有logging。 我在想,我错过了一些作品,但是我不确定这个作品可能是什么。 我也不知道我是否在正确的地方寻找原木。 Cloud9进程已启动,似乎在3131端口上运行。 我不打算开放Cloud9。 我所拍摄的最终游戏是最终通过SSL使用一些authentication(也许是基本authentication)来获取Cloud9,但是在开始添加SSL和authentication之前,我想到了,我应该先让基础知识工作。 更新 apachectl -S输出: # apachectl -S VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:80 is a NameVirtualHost default server www.mydomain.org (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost www.mydomain.org (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost […]
我一直试图通过Apache2 2.2.22来阻止在Ubuntu 13.04上访问WordPress wp-admin和wp-includes目录。 首先,我尝试使用.htaccess,由于某种原因,它不能正常工作,但在阅读Apache Docs时,他们build议不要。 所以我改变了他们的build议,把它放在conf文件的<directory>部分。 你能看到我在这里做错了吗? 防止访问目录的最佳方法是什么? 防止访问单个文件的最佳方法是什么? 如何让服务器执行防止.htaccess访问的规则以及防止访问vserver.conf下面列出的版本控制目录? 以下是我的vserver.conf文件。 <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/domain/ ServerName domain.com ServerAlias www.domain.com <Directory "/var/www/domain/"> # WordPress Permalink Configuration # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # wp-include rules remove […]
我试图寻找一个这样的解决scheme,但不能find任何文档/提示我的具体设置。 我的设置: 后端服务器:ngnix:virtualenv中运行gunicorn / python / django的2个不同网站(2个顶级域名)后端服务器硬件(VPS)2gb ram,8个CPU 数据库服务器:postgresql – pg_bouncer 后端服务器硬件(VPS)1GB RAM,8个CPU 清漆服务器:只运行清漆 Varnishserver硬件(VPS)1GB内存,8个CPU 我试图build立一个清漆服务器来处理罕见的stream量高峰(20 000个唯一请求/秒)当电视节目提到其中一个网站时,就会发生峰值。 我需要做些什么,使清漆服务器caching我的后端服务器上的两个网站/域? 我的/etc/varnish/default.vcl: backend django_backend { .host = "local.backendserver.com"; .port = "8080"; } 我的/usr/local/nginx/site-avaible/domain1.com upstream gunicorn_domain1 { server unix:/home/<USER>/.virtualenvs/<DOMAIN1>/<APP1>/run/gunicorn.sock fail_timeout=0; } server { listen 80; listen 8080; server_name domain1.com; rewrite ^ http://www.domains.com$request_uri? permanent; } server { listen 80 default_server; […]
问题是:我有一个index.html文件位于/www/site/ ,我希望能够从自定义端口下的该文件夹中提供所有适当的内容,例如:8085 。 它也只能通过ProxyPass访问。 configuration如下所示: /available-sites文件夹中的site.dev : Listen 8085 <VirtualHost *:8085> DocumentRoot "/www/site" ServerName site.dev ServerAlias site.dev <Directory "/www/site"> AllowOverride All Allow from all </Directory> </VirtualHost> httpd.conf如下所示: ProxyPass /site http://localhost:8085/site ProxyPassReverse /site http://localhost:8085/site 设置这种configuration后,服务器没有响应, error.log文件被填充: proxy: HTTP: disabled connection for (site.dev) ap_proxy_connect_backend disabling worker for (site.dev) caught SIGTERM, shutting down server reached MaxClients settings …. […]
我正在使用mod_userdir来设置我的文档根目录 /home/user/server/public_html/ 我还设置了一个虚拟主机,将ServerName domain.comredirect到 /home/user/server/public_html/domain.com/ 在该vhostconfiguration中,我还将文档根目录设置为同一个目录。 添加一行127.0.0.1 domain.com到我的主机文件,这一切都像一个魅力。 我的问题是,如果我从外部通过本地networking调用该url 192.168.0.1/~user/domain.com/ 文档根目录设置为/var/www而不是/home/user/server/public_html/domain.com/ 有没有办法在这种情况下将文档根设置为正确的path?
我在虚拟主机configuration文件的Apache <Directory>上下文中有一个相当长的授权configuration指令块。 它具有LDAP凭据和一个复杂的filter,在vhostconfiguration文件中重现会很烦人。 这是一个简单的例子: ServerName server.domain.com DocumentRoot /var/www/server.domain.com <Directory /var/www/server.domain.com/> AllowOverride FileInfo Options +ExecCGI # PASSWORD PROTECT AuthType Basic AuthBasicProvider ldap file AuthName "INTERNAL" AuthLDAPURL ldap://xxx AuthLDAPBindDN uid=xxx,cn=xxx AuthLDAPBindPassword xxx AuthzLDAPAuthoritative on AuthUserFile /var/www/server.domain.com/.htpasswd Require valid-user </Directory> Alias /alias1 /var/www/alias1.domain.com <Directory /var/www/alias1.domain.com> # ? </Directory> Alias /alias2 /var/www/alias2.domain.com <Directory /var/www/alias2.domain.com> # ? </Directory> Alias /alias3 […]
我在Apache后面的一个服务器上安装了一个DirectAdmin安装程序。 从机器外部(通过Internet和Intranet)访问VirtualHost时,一切正常,但从本地访问相同的VirtualHost(即通过在服务器内使用curl mywebsite.com)时遇到问题。 相关的networking设备: eth0 : IP Address inside the NAT eth0:0 : IP Address outside the NAT (ie public IP Address) eth1 : LAN IP Address lo : Loopback 下面是相关的httpdconfiguration: Listen 80 NameVirtualHost *:80 DocumentRoot "/var/www/html" <VirtualHost *:80> ServerName mydomain.com … </VirtualHost> 当使用通配符的NameVirtualHost可以期待一个请求,在请求头中设置Host: mydomain.com指令(这个curl会)由VirtualHost指令提供服务。 虽然,当我从服务器内部curl mydomain.com时,Apache回VirualHost DocumentRoot不允许我访问VirualHost主机。 我得到它的唯一方法是编辑/etc/hosts并为mydomain.com定义NAT内部的IP。 另一个可能有用的信息: 我跑了<?php print_r($_SERVER); ?> <?php print_r($_SERVER); […]
我们最近开始遇到networking刮板/ DDoS服务的80个问题,因为他们滥用爬取的做法,每周都会把我们的服务器closures几次。 最初,我们只是在受影响的网站的.htaccess文件的底部放置以下内容: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_USER_AGENT} ^.*80legs RewriteRule .* – [F,L] </IfModule> 但是,我们只是需要在所有服务器的服务器级别阻止它们。 根据Apache文档,这个configuration是有效的放置在服务器configuration部分,又名httpd.conf ,但这样做没有效果。 在启用了虚拟主机的Apache服务器上,是否有一种特殊的方法可以阻止/拒绝/redirect基于用户代理的请求? 注意:在防火墙级别是不可能的,因为: 80legs使用本质上是一个select在僵尸networking爬行页面。 他们最后的“事件”涉及来自全球约900个不同networking/ IP块的5250个独特IP。 目前我们还没有能力进行深度包检测。