Mono 虚拟主机配置错误:地址已在使用中

发布于 2025-01-08 17:59:40 字数 950 浏览 0 评论 0原文

每次启动 apache 时,我的 apache 错误日志中都会出现三个不同的错误消息。我已多次阅读 mod_mono 配置部分,因此请给我一个提示如何摆脱这些消息。 不过,应用程序(3 个 asp.net 项目)运行良好。

第一:

Listening on: /tmp/mod_mono_server_global
Root directory: /
Error: Address already in use

第二:

Error: There's already a server listening on /tmp/mod_mono_server_global

第三:

Listening on: /tmp/mod_mono_server_example.com
Root directory: /srv/www/vhosts/example.com
Error: There's already a server listening on /tmp/mod_mono_server_example.com

虚拟主机配置

MonoServerPath example.com "/usr/bin/mod-mono-server4"
MonoDebug example.com false
MonoSetEnv example.com MONO_IOMAP=all

MonoApplications example.com "/:/srv/www/vhosts/example.com"

 <Directory "/srv/www/vhosts/example.com">
     MonoSetServerAlias example.com
     SetHandler mono
 </Directory>

OpenSuse 11.4,Mono 2.10.2

I've got three different error messages in my apache error log every time I'm starting apache. I've read the mod_mono configuration section multiple times so please give me a hint how to get rid of theses messages.
The applications (3 asp.net projects) are running fine though.

first:

Listening on: /tmp/mod_mono_server_global
Root directory: /
Error: Address already in use

second:

Error: There's already a server listening on /tmp/mod_mono_server_global

third:

Listening on: /tmp/mod_mono_server_example.com
Root directory: /srv/www/vhosts/example.com
Error: There's already a server listening on /tmp/mod_mono_server_example.com

vhost config

MonoServerPath example.com "/usr/bin/mod-mono-server4"
MonoDebug example.com false
MonoSetEnv example.com MONO_IOMAP=all

MonoApplications example.com "/:/srv/www/vhosts/example.com"

 <Directory "/srv/www/vhosts/example.com">
     MonoSetServerAlias example.com
     SetHandler mono
 </Directory>

OpenSuse 11.4, Mono 2.10.2

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

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

发布评论

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

评论(2

美煞众生 2025-01-15 17:59:40

第一的:
监听:/tmp/mod_mono_server_global
根目录:/
错误:地址已在使用中

这听起来好像没有使用该格式加载(然后它将连接到 /tmp/mod_mono_server_example_com

MonoApplications example.com "/:/srv/www/vhosts/example.com" 

是否您有更多的虚拟主机描述问题,与以下内容无关mod_mono :-/

尝试一下(如果在不同的虚拟主机名上):

MonoAutoApplication disabled
AddHandler mono .aspx .ascx .asax .ashx .config .cs .asmx .axd

<VirtualHost *:80>
    ServerName example1.com
    ServerAlias www.example1.com
    DocumentRoot /srv/www/vhosts/example1.com

    MonoServerPath app1 "/usr/bin/mod-mono-server4"
    MonoDebug app1 false
    MonoSetEnv app1 MONO_IOMAP=all
    AddMonoApplications app1 "/:/srv/www/vhosts/example1.com"

    <Location />
        SetHandler mono
        MonoSetServerAlias app1
    </Location>
</VirtualHost>
<VirtualHost *:80>
    ServerName example2.com
    ServerAlias www.example2.com
    DocumentRoot /srv/www/vhosts/example2.com

    MonoServerPath app2 "/usr/bin/mod-mono-server4"
    MonoDebug app2 false
    MonoSetEnv app2 MONO_IOMAP=all
    AddMonoApplications app2 "/:/srv/www/vhosts/example2.com"

    <Location />
        SetHandler mono
        MonoSetServerAlias app2
    </Location>
</VirtualHost>

或者(如果只是在同一虚拟主机上的不同文件夹中)

MonoAutoApplication disabled
AddHandler mono .aspx .ascx .asax .ashx .config .cs .asmx .axd

MonoServerPath app1 "/usr/bin/mod-mono-server4"
MonoDebug app1 false
MonoSetEnv app1 MONO_IOMAP=all
AddMonoApplications app1 "/app1:/srv/www/vhosts/example.com/app1"

MonoServerPath app2 "/usr/bin/mod-mono-server4"
MonoDebug app2 false
MonoSetEnv app2 MONO_IOMAP=all
AddMonoApplications app2 "/app2:/srv/www/vhosts/example.com/app2"

<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com
    ServerAlias 192.168.0.1
    # note that it this is the conf of first vhost read by apache,
    # it will be used as default, any call not having a matching
    # vhost will fall into that vhost.
    <Location /app1>
        SetHandler mono
        MonoSetServerAlias app1
    </Location>
    <Location /app2>
        SetHandler mono
        MonoSetServerAlias app2
    </Location>
</VirtualHost>

我想你在这里看看http://www.mono-project.com/Mod_mono
检查您使用的是 AddMonoApplications 而不是 MonoApplications

祝你好运

First:
Listening on: /tmp/mod_mono_server_global
Root directory: /
Error: Address already in use

This sounds like it's not loaded using that formatting (it would then connect to /tmp/mod_mono_server_example_com )

MonoApplications example.com "/:/srv/www/vhosts/example.com" 

Could it be you have more of a problem of vhost description, nothing to do with mod_mono :-/

try that (if on different vhost name):

MonoAutoApplication disabled
AddHandler mono .aspx .ascx .asax .ashx .config .cs .asmx .axd

<VirtualHost *:80>
    ServerName example1.com
    ServerAlias www.example1.com
    DocumentRoot /srv/www/vhosts/example1.com

    MonoServerPath app1 "/usr/bin/mod-mono-server4"
    MonoDebug app1 false
    MonoSetEnv app1 MONO_IOMAP=all
    AddMonoApplications app1 "/:/srv/www/vhosts/example1.com"

    <Location />
        SetHandler mono
        MonoSetServerAlias app1
    </Location>
</VirtualHost>
<VirtualHost *:80>
    ServerName example2.com
    ServerAlias www.example2.com
    DocumentRoot /srv/www/vhosts/example2.com

    MonoServerPath app2 "/usr/bin/mod-mono-server4"
    MonoDebug app2 false
    MonoSetEnv app2 MONO_IOMAP=all
    AddMonoApplications app2 "/:/srv/www/vhosts/example2.com"

    <Location />
        SetHandler mono
        MonoSetServerAlias app2
    </Location>
</VirtualHost>

Or that (if just in different folder on same vhost)

MonoAutoApplication disabled
AddHandler mono .aspx .ascx .asax .ashx .config .cs .asmx .axd

MonoServerPath app1 "/usr/bin/mod-mono-server4"
MonoDebug app1 false
MonoSetEnv app1 MONO_IOMAP=all
AddMonoApplications app1 "/app1:/srv/www/vhosts/example.com/app1"

MonoServerPath app2 "/usr/bin/mod-mono-server4"
MonoDebug app2 false
MonoSetEnv app2 MONO_IOMAP=all
AddMonoApplications app2 "/app2:/srv/www/vhosts/example.com/app2"

<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com
    ServerAlias 192.168.0.1
    # note that it this is the conf of first vhost read by apache,
    # it will be used as default, any call not having a matching
    # vhost will fall into that vhost.
    <Location /app1>
        SetHandler mono
        MonoSetServerAlias app1
    </Location>
    <Location /app2>
        SetHandler mono
        MonoSetServerAlias app2
    </Location>
</VirtualHost>

I guess you had a look here http://www.mono-project.com/Mod_mono
Check you are using AddMonoApplications not MonoApplications

Good luck

过潦 2025-01-15 17:59:40

您的 Apache 配置中可能存在冲突的 Listen 指令。如果这没有帮助,请尝试跟踪 Apache 并查看哪个套接字或文件弹出错误。我写了一篇关于 strace 的教程,你可能需要检查一下出来

You may have conflicting Listen directives in your Apache configuration. If that doens't help, try to strace Apache and see which socket or file the error pops up on. I've written a tutorial on strace, you may want to check it out.

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