2011-11-15 14 views
0

私はOUTPUT検索し、見つかったいくつかのQUESをNAntのスクリプトを使用してApacheを再起動する方法**と**と同様のコードを試してみましたが、いくつかのmessage..iは、このコードを試してみまししまったUNIXシステムとWindowsシステムの両方でAntスクリプトを使用してApacheを再起動しますか?

<exec executable="${APACHE_HOME}/bin/httpd.exe"> 
    <arg value="-k"/> 
    <arg value="restart"/> 
</exec> 

apache-restart: 
    [exec] [Tue Nov 15 19:58:18 2011] [error] (OS 2)The system cannot find the file specified. : No installed ser 
vice named "Apache2.2". 
    [exec] Result: 2 

これは、ApacheがWindowsサービスとしてインストールされていないようです。

私は両方試してみましたが、両方の問題を抱えて:

1)私のカーソルが点滅して保持され、次の文のエコーが到達しませんでした。

<target name="test" depends="init"> 
    <exec executable="${APACHE_HOME}/bin/httpd.exe"> 
    </exec> 
    <echo message="hello "/> 
</target> 

OUTPUT:

test: 

2)このtaskkillファイルの存在があります?

<target name="test" depends="init"> 
       <exec executable="taskkill /im httpd.exe"> 
       </exec> 
       <echo message="hello "/> 
</target> 

OUTPUT:

Execute failed: java.io.IOException: Cannot run progra 
"taskkill \im httpd.exe": CreateProcess error=2, The system cannot find the file specified 
     at java.lang.ProcessBuilder.start(ProcessBuilder.java:460) 

答えて

0

まあ、httpd.exe -k install

それともあなたは再びそれを起動するために、Apacheとhttpd.exeを殺すためにtaskkill /im httpd.exeを実行することができて最初のサービスをインストールします。 taskkillにスイッチ/fを追加することもできます。

+0

ありがとうございました。しかし、Javaベースのアプリケーションによって、サブインストーラWebサーバーとして既にインストールされています。その設定を変更する必要はありません。 – user1037728

+0

@ user1037728の場合は、 "taskkill/im httpd.exe"を実行してApacheを終了し、 "httpd.exe"を実行して再度起動します。/fをtaskkillにも追加することもできます。 –

関連する問題