Httpd.conf multiple VirtualHost sections (was: Mono ASP.NET MVC AutoHosting issues)

点点圈 提交于 2019-12-11 03:55:31

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/1286776/httpd-conf-multiple-virtualhost-sections-was-mono-asp-net-mvc-autohosting-issu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!