⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hw.apache.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Integration with Apache</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="hw.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="ref.hw.html">Hyperwave Functions</a></div> <div class="up"><a href="book.hw.html">Hyperwave</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div> <h1>Integration with Apache</h1> <p class="para">  The Hyperwave extension is best used when PHP is compiled as an  Apache module. In such a case the underlying Hyperwave server can  be hidden from users almost completely if Apache uses its rewriting  engine. The following instructions will explain this. </p> <p class="para">  Since PHP with Hyperwave support built into Apache is intended  to replace the native Hyperwave solution based on Wavemaster, we  will assume that the Apache server will only serve as a Hyperwave  web interface for these examples. This is not necessary but it simplifies  the configuration. The concept is quite simple. First of all you  need a PHP script which evaluates the <var class="varname"><a href="reserved.variables.environment.html" class="classname">$_ENV['PATH_INFO']</a></var>  variable and treats its value as the name of a Hyperwave  object. Let&#039;s call this script <i>&#039;Hyperwave&#039;</i>. The URL  <i>http://your.hostname/Hyperwave/name_of_object</i>  would than return the Hyperwave object with the name  <i>&#039;name_of_object&#039;</i>. Depending on the type of the object  the script has to react accordingly. If it is a collection, it will probably  return a list of children. If it is a document it will return the  mime type and the content. A slight improvement can be achieved  if the Apache rewriting engine is used. From the users point of  view it would be more straight forward if the URL  <i>http://your.hostname/name_of_object</i> would  return the object. The rewriting rule is quite easy:  <div class="informalexample">   <div class="example-contents"><div class="cdata"><pre>RewriteRule ^/(.*) /usr/local/apache/htdocs/HyperWave/$1 [L]</pre></div>   </div>  </div>  Now every URL relates to an object in the Hyperwave server. This  causes a simple to solve problem. There is no way to execute a  different script, e.g. for searching, than the &#039;Hyperwave&#039;  script. This can be fixed with another rewriting rule like the  following:  <div class="informalexample">   <div class="example-contents"><div class="cdata"><pre>RewriteRule ^/hw/(.*) /usr/local/apache/htdocs/hw/$1 [L]</pre></div>   </div>  </div>  This will reserve the directory <var class="filename">/usr/local/apache/htdocs/hw</var>  for additional scripts and other files. Just make sure this rule is  evaluated before the one above. There is just a little drawback:  all Hyperwave objects whose name starts with <i>&#039;hw/&#039;</i>  will be shadowed. So, make sure you don&#039;t use such names. If you need  more directories, e.g. for images just add more rules or place  them all in one directory. Before you put those instructions, don&#039;t  forget to turn on the rewriting engine with  <div class="informalexample">   <div class="example-contents"><div class="cdata"><pre>RewriteEngine on</pre></div>   </div>  </div>  You will need scripts:  <ul class="itemizedlist">    <li class="listitem">     <span class="simpara">     to return the object itself     </span>    </li>    <li class="listitem">     <span class="simpara">     to allow searching     </span>    </li>    <li class="listitem">     <span class="simpara">     to identify yourself     </span>    </li>    <li class="listitem">     <span class="simpara">     to set your profile     </span>    </li>    <li class="listitem">     <span class="simpara">     one for each additional function like to show     the object attributes, to show information about users,     to show the status of the server, etc.     </span>    </li>  </ul> </p> <p class="para">  As an alternative to the Rewrite Engine, you can also consider using  the Apache <i>ErrorDocument</i> directive, but be aware,  that <i>ErrorDocument</i> redirected pages cannot receive  POST data. </p></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="hw.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="ref.hw.html">Hyperwave Functions</a></div> <div class="up"><a href="book.hw.html">Hyperwave</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -