我使用1G RAM在Centos 6上的Lighttpd上运行Moodle。 如果我打开10个线程给moodle,那么moodle开始很慢。 我怎样才能加快服务器? 我需要为很多用户服务。 我用free命令检查了内存并且有很多空闲的内存。 编辑:我可以看到php-cgi高CPU。 最佳: # top -b -n 1 | head -30 top – 08:55:32 up 24 days, 21:37, 2 users, load average: 0.70, 0.24, 0.08 Tasks: 153 total, 2 running, 151 sleeping, 0 stopped, 0 zombie Cpu(s): 0.2%us, 0.3%sy, 0.0%ni, 99.4%id, 0.0%wa, 0.0%hi, 0.0%si, 0.1%st Mem: 1016480k total, 828692k […]
在我的服务器上(lighttpd + php-cgi),我有几个php-cgi进程,每个进程都以它所服务的站点的用户身份运行。 我知道我可以通过PHPRC环境variables为每个进程设置一个php.ini。 不幸的是,这导致PHP 只能读取该php.ini文件。 我想有一个php.ini文件的所有进程和覆盖每个进程。 基本上我想实现的是除了open_basedir(因为它应该是用户的web目录)和upload_tmp_dir(因为用户有写权限),所有的进程共享configuration。 我应该如何解决这个问题? 我需要提供更多的细节吗?
我怎样才能更改urlhttp://localhost:8080到http://localhost在lighttpd服务器.. 我在谷歌search,但没有运气.. 我当前的.conf文件 server.document-root = "/mnt/sdcard/www" dir-listing.activate = "enable" server.errorlog = "/mnt/sdcard/wwwconf/server.log" server.tag = "lighttpd/1.4.29 for Android" server.port = 8080 index-file.names = ("index.php", "index.html", "index.htm", "home.php","home.html","home.htm") fastcgi.server = ( ".php" => (( "host" => "127.0.0.1", "port" => 9003, )) ) alias.url = ("/phpmyadmin" => "/data/data/com.andi.serverweb/files/phpmyadmin") server.max-request-size = 1000000 server.network-backend = "writev" server.upload-dirs =( "/data/data/com.andi.serverweb/files/lighttpd/tmp" ) […]
我使用真棒前端优化器fasterize.com ,这需要www子域。 另外我有一个付款页面,我会使用HTTPS而不使用快速,所以在另一个子域。 我使用lighttpd,我已经有了一个很好的redirect所有页面。 我为付款页面添加了子域名和规则,如下所示: $HTTP["host"] =~ "^payment\.domain\.com$" { url.redirect = ("^/(.*)$" => "https://domain.com/payment/") } $HTTP["host"] =~ "^domain\.com$" { url.redirect = ("^/(.*)$" => "http://www.domain.com/$1") } 但第二个规则赶上第一个的呼吁,我得到http://www.domain.com/paymentpage/这是不好的,因为缺lessHTTPS。
我努力让我的代码在nginx上工作。 这个configuration适用于lighttpd,但是我想把它迁移到nginx。 在lighttd上重写规则: url.rewrite-once = ( "^/(ui)/(.*)$" => "/gi.php/$1/$2", "/(.*)\.(.*)" => "$0", "/(xhr|js-api)/(.*)" => "$0", "^/([^.]+)$" => "/gi.php/$1" ) 任何人都可以帮助在这个转换? 我尝试了很多东西,包括将其转换为Apache重写规则,但没有一个工作。 Nginx规则: if (!-f $request_filename){ set $rule_0 1$rule_0; } if (!-d $request_filename){ set $rule_0 2$rule_0; } if ($rule_0 = "21"){ rewrite ^/(.*)$ /gi.php/$1 last; } Error : 404 有什么build议么?
我已经设置了我的lighttpd的方式,redirect到我的主域名的所有子域以下面的方式* .domain.com – > domain.com 。 不幸的是,当我input一个像www.domain.com这样的子域名时,它直接进入了http://domain.com/site.fcgi/并且从字面上打破了页面。 当我排除子域它打开完美的页面。 以下使用lighttpd设置: $HTTP["host"] =~ "\.domain\.com(:[0-9]+)?$" { url.redirect = ("^/(.*)" => "http://domain.com/$1") } $HTTP["host"] =~ "^domain\.com(:[0-9]+)?$" { server.document-root = "/var/www/servers/domain.com/awesomesite" accesslog.filename = "/var/www/logs/domain.com/access.log" server.errorlog = "/var/www/logs/domain.com/error.log" fastcgi.server = ( ".fcgi" => ( "main" => ( # Use host / port instead of socket for TCP fastcgi "bin-path" => "/var/www/servers/domain.com/awesomesite/domain.fcgi", […]
我正在使用Clodflare DNS。 我只想让某些IP访问某些文件。 我如何设置我的lighttpd.conf来正确检测正确的IP? 我知道如何做access.log。 是否有可能使用$ HTTP [“remoteip”]和其他东西? 我今天是这样做的: $HTTP["remoteip"] == "xx.xx.xx.xx" { url.access-deny = ("") } 我已经尝试了以下,但它没有工作: $HTTP["remoteip"] =="*"{ extforward.forwarder = ( "all" => "trust" ) extforward.headers = ("CF-Connecting-IP") }
我正在运行lighttpd 1.4.33,它是从互联网开放的Apache服务器反向代理的。 当从lighttpd服务器的本地地址访问脚本时,GETparameter passing给脚本就好了,我得到了预期的结果。 但是,当通过代理访问脚本(并由以下lighttpd规则重写)时,查询参数似乎完全被删除。 似乎是导致问题的重写规则: $HTTP["host"] =~ "^site\.example\.com$" { # This affects the requests that aren't rewritten below, ie. static stuff server.document-root = "/var/www/example/public" url.rewrite-once = ( "^((?!assets).)*$" => "index.php/$1" ) } 这应该是重写所有URL,以便它们通过index.php中的路由引擎传递,除了/assets目录中的静态内容(静态内容)。 请注意, /assets是/var/www/example/public的子目录,所以这个工作正常。 Lighttpd用下拉参数debugging请求的日志: 2014-07-23 11:36:46: (response.c.310) Request-URI : /foo/bar?someparam=data 2014-07-23 11:36:46: (response.c.311) URI-scheme : http 2014-07-23 11:36:46: (response.c.312) URI-authority: site.example.com 2014-07-23 […]
我有我的lighttpd安装的问题,一旦默认的日志旋转软件将access.log复制到access.log-YYYYMMDD后,它将会清除access.log 。 我必须停止并重新启动服务才能继续进行日志logging。 以下是关于dedi的uname和centos-release信息: np ~ > uname -a && cat /etc/centos-release Linux sevlet 3.10.0-123.20.1.el7.x86_64 #1 SMP Thu Jan 29 18:05:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux CentOS Linux release 7.0.1406 (Core) 我不知道什么日志旋转软件预装在这个盒子上,我不知道为什么lighttpd完全停止写入access.log一旦文件被旋出。 任何人有任何想法发生了什么和/或如何解决它? 解决了! 任何人在最小的CentOS 7上都有这个问题或类似的问题,请阅读: @chutzbuild议我看看/etc/logrotate.d/中的lighttpdconfiguration。 lighttpd的默认configuration工作,但它调用killall重新启动守护进程。 最小安装的CentOS 7不包括killall 。 在CentOS上安装: yum -y install psmisc 希望这可以帮助别人!
我的安装程序有当前的身份validationconfiguration。 它强制任何远程主机进行身份validation。 那很好。 但我需要例外。 auth_file="/etc/lighttpd.users" #if auth_file is not empty enable lighttpd local authentification if grep -q ".*:.*" "$auth_file" 2>/dev/null;then sed -ir '/^$/d' $auth_file cat <<EOF \$HTTP["remoteip"] != "127.0.0.1" { auth.backend = "htdigest" auth.backend.htdigest.userfile = "$auth_file" auth.require = ( "/" => ( "method" => "digest", "realm" => "MyRealm", "require" => "valid-user" ) ) } EOF […]