Httpd.conf 多个 VirtualHost 部分(是:Mono ASP.NET MVC AutoHosting 问题)

发布于 2024-08-02 11:21:06 字数 729 浏览 6 评论 0原文

我正在通过尝试禁用 AutoHosting 来做到这一点。但是现在我收到“多次尝试生成进程后无法连接到 mod-mono-server”。在日志中。路径是正确的

这是我的配置:

<VirtualHost *:80>
    ServerName myserver.com  
    DocumentRoot /home/abe/html/  
    MonoServerPath myserver.com "/usr/local/bin/mod-mono-server2"  
    MonoDebug myserver.com true  
    MonoSetEnv myserver.com MONO_IOMAP=all  
    MonoAutoApplication disabled  
    MonoApplications myserver.com "/:/home/abe/html/"  
    <Location "/">
        Allow from all  
        Order allow,deny  
        MonoSetServerAlias myserver.com  
        SetHandler mono  
    </Location>
</VirtualHost>

已修复:请参阅下面的答案。

但是,通过修复,我怎样才能获得我想要的配置,而不需要执行编辑自动生成的 httpd.conf 的危险过程?

I'm doing exactly this by trying to disable AutoHosting. However now I get "Failed to connect to mod-mono-server after several attempts to spawn the process." in the logs. The path is correct

Here's my config:

<VirtualHost *:80>
    ServerName myserver.com  
    DocumentRoot /home/abe/html/  
    MonoServerPath myserver.com "/usr/local/bin/mod-mono-server2"  
    MonoDebug myserver.com true  
    MonoSetEnv myserver.com MONO_IOMAP=all  
    MonoAutoApplication disabled  
    MonoApplications myserver.com "/:/home/abe/html/"  
    <Location "/">
        Allow from all  
        Order allow,deny  
        MonoSetServerAlias myserver.com  
        SetHandler mono  
    </Location>
</VirtualHost>

Fixed: see the answer below.

With the fix, though, how can I get the configuration I want w/o doing the dangerous process of editing the auto-gen'd httpd.conf?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌梦深 2024-08-09 11:21:06

事实证明,这是 VirtualHost 被定义两次的问题 - 一次在 httpd.conf 中,一次在 vhosts.conf 中。因此,解决方法是仅使用一个 VirtualHost 块。但不幸的是,这会导致另一个问题。我处于托管环境中,httpd.conf 是自动生成的,所以我真的不应该直接编辑它。不过,编辑 vhosts.conf 是安全的。 VirtualHost 由我的主机自动设置并注入到 httpd.conf 中。

Turns out this was an issue with the VirtualHost being defined twice - once in httpd.conf and once in vhosts.conf. So the fix was to use just one VirtualHost block. But this causes another problem, unfortunately. I'm in a hosted environment and httpd.conf is auto-generated so I really shouldn't be editing it directly. However it is safe to edit vhosts.conf. VirtualHost is automatically set by my host and injected into httpd.conf.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文