Httpd.conf 多个 VirtualHost 部分(是:Mono ASP.NET MVC AutoHosting 问题)
我正在通过尝试禁用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,这是 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.