Windows + Lighttpd + WSH

PythonをWindows上のLighttpdに接続することについての記事を書いたので、たとえば、すでにシステムに組み込まれている他のスクリプト言語を使用することを考えました。 Windowsには、いわゆるWindows Script Hostがあり、VBScriptとJScriptに標準で付属しています。

これを行うには、Lighttpdをインストールし 、構成に以下を追加します(C:\ Program Files \ LightTPD \ conf \ lighttpd-inc.conf):
server.port = 81 server.modules = ( ... "mod_cgi", "mod_rewrite", ... ) server.document-root = "C:/Program Files/LightTPD/HTDOCS/" index-file.names = ( "index.wsh", ....) static-file.exclude-extensions = ( .... , ".wsh" ) cgi.assign = (".wsh" => "c:/windows/System32/cscript.exe" ) 


サーバーCを起動します:\ Program Files \ LightTPD \ TestMode.bat

サードパーティのJavaScriptインタープリターを使用せずに、JScriptおよびVBScriptでサイトスクリプトを作成できるようになりました。

たとえば、C:\ Program Files \ LightTPD \ htdocsディレクトリに2つのファイルを作成します。
テキスト付きのindex.wsh
 <?xml version="1.0" encoding="UTF-8"?> [ScriptFile] Path=index.js [Options] Timeout=0 DisplayLogo=0 


およびindex.jsとテキスト
 for(var i=0;i<100;i++) WScript.Echo(i.toString()+" Hello"); 


リンクをたどる
  http:// localhost:81 / index.wsh 
数百行の挨拶をご覧ください。

Source: https://habr.com/ru/post/J113206/


All Articles