我会很快的 有没有办法阻止直接文件访问我的/ var / www上的文件/图像? 举个例子: 如果我正在加载包含图像hello.jpg的example.com/info.php页面,是否可以阻止访问example.com/images/hello.jpg,但是同时允许在example.com中加载所述图像/info.php? 所以基本上只能启用加载,如果它是在一个页面内,但不与直接链接。 提前致谢。
在我的一个客户端的最新PCIDSS扫描中,我了解了Web服务器HTTP跟踪/跟踪方法支持跨站点跟踪漏洞 ( CVE-2004-2320 , CVE-2007-3008 )。 针对Apache的build议缓解措施是这样的: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_METHOD} ^TRACE RewriteRule .* – [F] </IfModule> 我如何在Lighttpd中实现相同的function? 非常感谢您的帮助!
[编辑]我发现为什么它不工作,我只是不得不添加指令 server.pid-file = "/var/run/lighttpd.pid" 到lighttpd.conf文件。 我无法弄清楚为什么lighttpd init脚本不能停止服务器。 我正在运行Debian 7 Wheezy和Lighttpd 1.4.31。 我的系统也是最新的。 发行时: # /etc/init.d/lighttpd stop [ ok ] Stopping web server: lighttpd. 但是然后lighttpd仍在运行: # ps aux | grep lighttpd root 2024 0.0 0.2 70696 1184 ? S 15:16 0:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf root 2428 0.0 0.1 7832 880 pts/0 S+ 15:27 0:00 grep lighttpd […]
假设我有一个由lighttpd提供的htdocs目录树 htdocs htdocs/foo htdocs/foo/spam htdocs/foo/eggs htdocs/foo/eggs/stirred htdocs/foo/eggs/fried htdocs/bar htdocs/bar/bacon 现在我想保护个别的子树,这取决于如果有一个htpassw文件在某个地方,当然使用htpasswd来包含允许的用户的凭证。 例如一个htpasswd文件在 htdocs/foo/eggs/.htpasswd 这将要求对全eggs子目录树进行authentication。 htdocs/foo/eggs htdocs/foo/eggs/stirred htdocs/foo/eggs/fried 我知道如何configurationlighttpd在特定位置使用特定的htpasswd文件来操作给定的URL模式。 但configuration这样的东西似乎有点奇怪。 到目前为止,我最好的想法是使用URL的相关部分来构build一个到htpasswd文件的文件系统的path。 但是如果早期或之后应用某些URL重写规则,则会导致问题。 基本上我正在寻找的是,在实际的文件访问遍历了目录树来定位一个可能存在的hwpasswd文件。 我怎样才能做到这一点?
我正在使用Debian 7 64作为主机,并且我安装了Lighttpd和PHP-FPM以及mysql支持,在lighttpd和PHP-FPM全新安装之后,我尝试启用用户目录,并运行以下命令: root@xxxx# lighty-enable-mod userdir 我运行上面的命令之后得到了ok的messege,但是当我运行下面的命令重新启动lighttpd时,我得到以下输出: root@xxxx# /etc/init.d/lighttpd force-reload [FAIL] Reloading web server configuration: lighttpd failed! 我想打开/ home / user / www / project_name; 当有人打开我的网站; 像这样:www.mysite.com/project_name,所以我做了/etc/lighttpd/conf-available/10-userdir.conf ## The userdir module provides a simple way to link user-based directories into ## the global namespace of the webserver. ## # /usr/share/doc/lighttpd/userdir.txt server.modules += ( "mod_userdir" ) […]
我已经为我的lighttpd服务器启用了用户目录(mod_userdir),但我不知道在这些目录中的php文件运行时如何产生不同的用户进程。 用户的目录及其中的文件归用户所有,我希望这个进程能够被生成,但是它仍然继续运行php脚本作为www-data。 是否有什么与快速CGI或PHP-FPM需要完成? 提前致谢。
(我认为这个问题是Lighttpd从www.domain.comredirect到domain.com的重复,但是没有得到足够的关注,而且太旧了)。 我试图通过lighttpd + FastCGI部署一个应用程序,并encryption所有的stream量。 如果我在URL中明确使用HTTPS,那么效果很好,但是尽快尝试从HTTPredirect到HTTPS,URL的应用程序脚本名称(在本例中为index.py)包含在URL中,因此不是https:/ /somedomain.com/bleh我得到https://somedomain.com/index.py/bleh ,这会触发未find错误。 我尝试过移动一些东西,但是我无法很好地完成redirect。 这里是我的lighttpd.conf的相关内容 $SERVER["socket"] == ":80" { $HTTP["host"] =~ "(.*)" { url.redirect = ( "^/(.*)" => "https://%1/$1" ) } } $SERVER["socket"] == ":443" { ssl.engine = "enable" ssl.pemfile = "certificate.pem" ssl.use-sslv2 = "disable" ssl.use-sslv3 = "disable" } fastcgi.server = ( "index.py" => (( "socket" => "/tmp/app.socket", "bin-path" => "index.py", […]
我怎样才能转换这个Apache重写规则,使他们在Lighttpd上工作? 这实际上是一个.htaccess文件,我需要把它们放在一个lighttpd.conf文件中。 Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule www.(.*) web.php?url=$1 RewriteRule sitemap/(.*) mapdi.php?page=$1 RewriteRule tags_(.*)\.html$ tags.php?keywords=$1 RewriteRule ^([^-]*)-page-([^-]*)\.html$ tags.php?keywords=$1&page=$2 [L] RewriteRule ^sitemap_([^-]*)\.html$ sitemap_web.php?page=$1 [L] RewriteRule ^sitemap\.html$ sitemap.php$1 [L] RewriteRule ^privacy\.html$ privacy.php$1 [L] 我转换了一部分代码,但不知道如何转换: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ …. …. 这是我可以转换: url.rewrite-once = ( RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} […]
我正在尝试configurationlighttpd,以便为我的Ruby on Rails应用程序提供静态文档,并将请求路由到我的Ruby on Rails应用程序服务器。 这是迄今为止的configuration: $HTTP["host"] =~ "(^|www\.)brlafreniere.com$" { proxy-core.protocol = "http" proxy-core.balancer = "hash" proxy-core.backends = ( "127.0.0.1:5000", "127.0.0.1:5001", "127.0.0.1:5002", ) server.document-root = "/var/www/brlafreniere.com/public" } 有了这个configuration,击中brlafreniere.com在我的浏览器结果404找不到。 我做了curl127.0.0.1:5000并收到了我的Ruby on Rails应用程序的头版预期的响应。 我正在使用以下脚本来启动应用程序服务器。 #!/bin/bash RAILS_ENV=production rake assets:clobber assets:precompile puma –pidfile /tmp/brlafreniere.com.1 –environment production –port 5000 > log/puma.log 2>&1 & puma –pidfile /tmp/brlafreniere.com.2 –environment production –port 5001 […]
请帮我诊断一个问题。 我有一个工作网站(WordPress)在过去6个月工作得很好。 服务器中没有更新或新的安装。 今天用户抱怨网站挂起。 我通常使用Chrome浏览器,当我去了网站…它工作正常。 我用IE浏览器,Safari浏览器和Firefox和网站挂起…只是不断加载。 我在另一台电脑上试了一样的东西。 我从Chrome清除了cookies,历史logging等,并浏览到该网站,它仍然工作。 从IE清除cookies,历史等,仍然没有工作。 现在只有当浏览到WordPress网站时才会发生,还有其他的html和PHP文件,我可以访问没有任何问题。 我甚至可以访问WordPress的pipe理网站。 我看了/var/log/messages ,我看到: pound: (7f4985ca9700) error copy server cont: Connection timed out 我编辑pound.cfg到这个: User "pound" Group "pound" Control "/var/lib/pound/pound.cfg" Alive 30 Client 120 TimeOut 15 Grace 30 并且在2分钟内仍然超时(加载此页面的时间相当长,在Chrome中它的工作时间不到15秒)。 我在/var/log/lighttpd/error.log中看不到任何错误 我被黑了吗? 我还能看到什么? 我已经从备份恢复WordPress网站,但问题依然存在。 我已经更新到最新版本的WP(3.8.1)…同样的问题。 在更新任何东西之前,我检查了是否有任何文件已被调和(修改date)…没有新的东西。 我正在使用CentOS版本6.4(最终)。