installation - Lighttpd虚拟主机设置确实适用于子目录

标签 installation syntax-error lighttpd

我具有以下映射设置来处理子目录,但是由于这种更改,lighttpd无法启动,有什么问题吗?在哪里也可以找到lighttpd的系统日志

[root @ localhost日志]#/etc/init.d/lighttpd开始冗长
启动lighttpd(通过systemctl):作业失败。有关详细信息,请参见系统日志和“systemctl状态”。

$SERVER["socket"] == "0.0.0.0:443" {
  ssl.engine                  = "enable"
  ssl.pemfile                 = "/etc/lighttpd/ssl/api.testdomain.com.pem"
  ssl.ca-file                 = "/etc/lighttpd/ssl/sub.class1.server.ca.pem.cer"

  $HTTP["host"] =~ "^api\.testdomain\.com" {
    $HTTP["url"] =~ "^/[^/]*\.json$" {
      server.name               = "api.testdomain.com"
      server.errorlog           = "/var/log/lighttpd/testdomain.com/server_error_443.log"
      accesslog.filename        = "/var/log/lighttpd/testdomain.com/server_access_443.log"
      proxy.server              = ( "" => ( ("host" => "127.0.0.1", "port" => 9001) ) )
    }
    else $HTTP["url"] = "^/v2/*\.json$" {
      server.name               = "api.testdomain.com"
      server.errorlog           = "/var/log/lighttpd/testdomain.com/server_error_443.log"
      accesslog.filename        = "/var/log/lighttpd/testdomain.com/server_access_443.log"
      proxy.server              = ( "" => ( ("host" => "127.0.0.1", "port" => 9004) ) )
    }
  }
}

最佳答案

这样的经典错误:)您将=代替==

else $HTTP["url"] == "^/v2/*\.json$" {

我尝试了一下,但得到了确切的行/列错误,而不仅仅是您的“作业失败”:
2012-03-24 10:26:31: (configfile.c.564) source: /etc/lighttpd/sites/test.fr line: 13 pos: 20 only =~ and == are allowed in the condition 

关于installation - Lighttpd虚拟主机设置确实适用于子目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9709481/

相关文章:

php - 如何在 laravel 函数中添加 php 变量

python - Django 和 fcgi - 日志记录问题

cgi - lighttpd:禁用 CGI 缓冲

ubuntu - 快速 CGI、Lighttpd、Ubuntu

mysql - 在端口 3306 上运行的另一个 mysqld 服务器错误

r - 无法安装我创建的包

installation - 在开发人员工作站上安装 Microsoft 软件的正确顺序是什么?

javascript - 在 Google Chrome 中找到未捕获的语法错误

php - 部署独立的 PHP/MySQL 应用程序

json - Uncaught SyntaxError : Unexpected token : in JSON response