0

私の ubuntu 12.04 サーバーは 2 つの IP エイリアスで構成されています: eth0:0 xxx.xxx.xxx.138 と eth0:1 xxx.xxx.xxx.145 2 つの異なるアプリケーションで 2 つの IP アドレスを提供したい: jetty web アプリケーションeth0:1 の eth0:0 apache2 Web サイトでリッスンすることは可能ですか? eth0:1 アドレスで jetty を開始すると、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 を含む listen ディレクティブを使用した標準的な構成です。

ポート.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>

どこが間違っていますか?Jetty アプリケーションの速度が低下するため、apache をプロキシにしたくありません。jetty と apache が 2 つの異なる IP アドレスからリッスンするだけです。

4

1 に答える 1

1

jetty.xml でコネクタをリッスンする IP を設定します。現在、すべてのインターフェイスでリッスンしていると思われます。

于 2012-08-16T12:03:41.657 に答える