0

我的 ubuntu 12.04 服务器配置了两个 IP 别名:eth0:0 xxx.xxx.xxx.138 和 eth0:1 xxx.xxx.xxx.145 我想通过两个不同的应用程序为这两个 IP 地址提供服务:jetty web application在 eth0:0 上收听 apache2 网站上的 eth0:1 这可能吗?如果我在 eth0:1 地址上启动码头,只要 apache2 停止,它就可以正常工作。当我启动 apache 2 时,我得到以下信息:

 * Starting web server apache2                                              

    apache2: Could not reliably determine the server's fully qualified domain name, using xxx.xxx.xxx.138 for ServerName
(98)Address already in use: make_sock: could not bind to address xxx.xxx.xxx.145:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.

Apache2 配置是标准配置,监听指令包含 xxx.xxx.xxx.145:

端口.conf:

#NameVirtualHost xxx.xxx.xxx.145:80
Listen xxx.xxx.xxx.145:80

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    Listen xxx.xxx.xxx.145:443
</IfModule>

<IfModule mod_gnutls.c>
    Listen xxx.xxx.xxx.145:443
</IfModule>

000-默认

<VirtualHost xxx.xxx.xxx.145:80>
        ServerAdmin webmaster@localhost
        ServerName mquagliani
        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
 <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

在码头方面,我有上下文 mtc.xml 包含

<Set name="virtualHosts">
    <Array type="String">
      <Item>www.mindthecheck.com</Item>
      <Item>xxx.xxx.xxx.138</Item>
      <Item>localhost</Item>
      <Item>127.0.0.1</Item>
    </Array>
  </Set>

我哪里错了?我不想让 apache 成为代理,因为这会减慢码头应用程序的速度。我只想从两个不同的 IP 地址监听 jetty 和 apache。

4

1 回答 1

1

在 jetty.xml 中为连接器设置要监听的 ip,我怀疑你现在正在监听所有接口

于 2012-08-16T12:03:41.657 回答