为了方便和速度,我使用easyphp在本地pipe理了许多站点。 我用Apache为每个站点configuration一个别名: Alias "/site.com" "C:/Work/site.com/Dev" <Directory "C:/Work/site.com/Dev" Options FollowSymLinks Indexes AllowOverride All Order deny,allow Allow from 127.0.0.1 Deny from all Require all granted </Directory> 但是,为了安全起见,我会阻止DocumentRoot之外的文件的访问,例如: 通过http://localhost/site.com我将无法访问文件夹C:/Work/ ,但只有C:/ Work/site.com 。 可能吗? 它应该使用虚拟主机,而不是别名? 谢谢
我最近在Liquidweb的网站上遇到了一个问题,他们的技术人员似乎甚至在几天之后都无法解决这个问题。 希望能在这里得到一些帮助。 偶尔,我的网站的HTTP不会回应 – 通常每天2-3次。 它根本不会加载。 所有用户将无法连接到该网站约5分钟。 Google Analytics(分析)的实时统计信息也显示,用户在线上网从网上的200多个下降到零。 Apache工作正常,没有根据日志重启或closures。 技术指出的Apache日志中存在的错误是: [error] [client 169.199.175.224] ModSecurity: Error reading request body: Connection reset by peer [error] [client 169.199.175.224] Handler for (null) returned invalid result code 70014 [error] [client 54.234.74.100] client sent invalid HTTP/0.9 request: HEAD HTTP/1.1 [Wed May 08 08:35:36 2013] [error] [client 173.218.197.87] Handler for (null) […]
只是去检查我的网站之一,并被消息迎接:“CGIWrap错误:真正的UID不能改变!”。 通过SSH进来,并试图“PS X”这显示了吨只是“-f”和pathindex.php或一些其他的PHP文件的过程吨。 杀死所有进程后,一切恢复正常。 任何人都知道那是什么? Google根本没有帮助。
我想configurationApache(2.2)来限制用户可以访问的域名,例如,如果apache FQDN是myapache.myfunnydomain.com,那么apache将只允许请求资源在.myfunnydomain.com(或任何域我configuration为合法)和拒绝所有其他请求(redirect到错误页面) 用例是: 用户尝试访问受限资源 我使用OpenAm / OpenAm policyAgent进行身份validation(PolicyAgent安装为监听所有stream量的Apache模块) OpenAm policyAgent模块拦截此并将用户redirect到login页面 此login页面的url格式为www.loginpage.com/?goto=originallyrequestedresource.com 一旦用户按下login,这个POST就会进入并行的OpenAM系统 一旦OpenAM进行身份validation,使用此转到用户redirect到'goto'的值(使用302) 我想确保用户永远不会被redirect到除我允许的域以外的域 比如有人攻击系统并设法改变goto的值,那么apache将不允许这个请求成功
我试图让浏览器通过HTTPScaching资产。 我正在使用MD5指纹识别方法,以允许长期caching,我有这部分工作正常。 什么不行的是在Apache中设置caching控制标题。 我的常规和SSL vhost的configuration包含: ExpiresActive On ExpiresByType text/css "now plus 1 year" HTTP请求到/test.css会产生标题: Cache-Control: max-age=31536000 Content-Type: text/css Date: Wed, 15 May 2013 10:33:01 GMT Etag: "7e572-19-4dcbdc8c04529" Expires: Thu, 15 May 2014 10:33:01 GMT Last-Modified: Wed, 15 May 2013 08:46:21 GMT Server: Apache/2.2.15 (Oracle) Vary: Accept-Encoding,User-Agent 但HTTPS请求到相同的文件产生标题: Cache-Control: private, must-revalidate, no-cache, no-store Content-Type: text/css Date: […]
在CentOS平台上使用OpenSSL和Apache Web Server进行相互authenticationauthentication后。 我试过这种情况(见下图): ———- | Root CA | // Self-Signed Certificate ———- | | ———- ———- | SiteA CA | | SiteB CA | //Two Different Intermediate CAs ———- ———- | | | | ——- ——- ——- ——- | Server1 | | Client1 | | Server2 | | Client2 | ——- ——- ——- ——- […]
我在我的.htaccess文件中使用下面的。 有3种types的redirect: redirect到目录/admin/index.php redirect到特定的.php文件,例如/ about redirect到/ John的用户个人资料页面 所有3个工作在我的本地环境,但在服务器上只有1和3的作品。 我真的很感激,如果你能告诉我为什么URLredirecttypes“/约”不适合我。 非常感谢。 <IfModule mod_rewrite.c> Options -Multiviews Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule ^admin$ /admin/index.php [QSA,L] RewriteRule ^about/?$ /about.php [NC,L] RewriteRule ^es/?$ /index.php?lang=2 [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([_A-Z0-9a-z-+\.]+)/?$ /public_profile.php?id=$1 [L] </IfModule> ErrorDocument 404 /404.php
我试图设置零configurationnetworking开发环境:通配符DNS和dynamic虚拟主机。 这是我的v主机configuration: NameVirtualHost *:80 <VirtualHost *:80> ServerAlias *.dev VirtualDocumentRoot /var/sites/%-2/docs UseCanonicalName Off </VirtualHost> 在这一点上一切都好,但现在我试图build立与后备的dynamic子域: test.dev → /var/sites/test/docs sub.test.dev → /var/sites/test/sub dontexist.test.dev → /var/sites/test/docs 目录结构: var |–sites |–test |–docs |–sub 我目前的尝试: <Directory "/var/sites"> RewriteEngine On RewriteCond %{ENV:REDIRECT_SUBDOMAIN} ="" RewriteCond %{HTTP_HOST} ^([a-z0-9][-a-z0-9]+)\.([a-z0-9][-a-z0-9]+)\.dev\.?(:80)?$ [NC] RewriteCond %{DOCUMENT_ROOT}/%2/%1 -d RewriteRule ^(.*) /%2/%1/$1 [E=SUBDOMAIN:%1,L] </Directory> 现在堆放在: [perdir /var/sites/] strip per-dir prefix: […]
我一直在尝试configuration虚拟服务器到我的网站没有任何运气。 我在VPS上运行Debian 2.6.32。 我已经configuration了许多configuration的虚拟服务器,并且让testing相对简单(我只启用了epicbackroads.com)。 这是我的三个虚拟主机: <VirtualHost *:80> DocumentRoot "/srv/www/epicbackroads.com/public_html" ServerName epicbackroads.com <Directory "/srv/www/epicbackroads.com/public_html"> allow from all Options +Indexes </Directory> </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] ServerName johnpwarren.com DocumentRoot /srv/www/domain2.com/public_html <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /srv/www/domain2.com/public_html/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride […]
我们公司的WordPress的index.php文件(3.5.1,每天一个handfull访客)博客反应非常跛脚每个请求。 一分钟后出现。 这种行为是出于蓝色,对系统做出的改变没有改变。 看着apache 2 error.log文件,我发现以下内容: (32) Broken pipe: core_output_filter: writing data to the network 在互联网上search我发现已经有一个可能的解决scheme的问题。 有人提到,这将有助于补充 EnableSendfile Off 到httpd.conf,但没有任何变化。