Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/301.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 当vhost文件中设置了*.domain.net时,Apache2 Ruby和Python将加载默认网站_Php_Python_Ruby_Apache2_Vhosts - Fatal编程技术网

Php 当vhost文件中设置了*.domain.net时,Apache2 Ruby和Python将加载默认网站

Php 当vhost文件中设置了*.domain.net时,Apache2 Ruby和Python将加载默认网站,php,python,ruby,apache2,vhosts,Php,Python,Ruby,Apache2,Vhosts,使用命名vhost设置5个站点 site1.domain.net(PHP) site2.domain.net(Python) site3.domain.net(Ruby) site4.domain.net(PHP) site5.domain.net(PHP) 在site1的vhost中,我还将ServerAlias设置为*.domain.net,因为我希望任何未定义的地址都指向该地址 当我将*.domain.net添加到该vhost时,python和ruby站点将重定向到site1,而不是它

使用命名vhost设置5个站点

  • site1.domain.net(PHP)
  • site2.domain.net(Python)
  • site3.domain.net(Ruby)
  • site4.domain.net(PHP)
  • site5.domain.net(PHP)
在site1的vhost中,我还将ServerAlias设置为*.domain.net,因为我希望任何未定义的地址都指向该地址

当我将*.domain.net添加到该vhost时,python和ruby站点将重定向到site1,而不是它们命名的vhost。所有的php站点都运行良好

我的猜测是,python和ruby站点分别使用wsgi和passenger,这与它的加载错误有关

我读了一些关于UseCononicalNames的文章,但我不知道这会有什么影响

我不仅对解决方案感兴趣,而且对其他两种语言处理vhost配置的原因(或方式)以及这样的更改产生影响的原因也感兴趣。


感谢您的时间和帮助。

我认为这与mod_wsgi和Phusion Passenger的使用无关。我认为ServerAlias就是这样工作的

您可以尝试以下替代方案:

  • 删除服务器别名
  • 为“*.domain.net”(或者,如果不起作用,“.domain.net”或“domain.net”)设置vhost,该vhost将重定向到site1.domain.net
这还有一个优点,即您的用户不能将非规范子域名作为书签

顺便问一下,你知道Phusion乘客也支持WSGI吗