姗吴爱姗 發表於 2008-9-8 18:48:56

在unix/bsd上让apache支持asp

<p>在这里讨论这个问题,仅是为了研究,我个人认为,在unix上,让apache支持asp没有任何实际意义<br />
如果以前是在win上开发的asp,我想你就让到在win上好好用吧,不用费劲的移植到unix上了</p>
<p>我是在solaris上测试的<a target="_blank" href="#" class="UBBWordLink">安装</a>,其它<a target="_blank" href="#" class="UBBWordLink">系统</a>,freebsd,linux和sco我想也差不多,忘大家测时候能反馈给我你的结果,谢谢<br />
好了,让我们开始吧<br />
下载相关软件<br />
apache_1.3.27.tar&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 下载:http://www.apache.org/dist<br />
Apache-ASP-2.49.tar&nbsp;&nbsp;&nbsp;&nbsp; 下载:http://cpan.org/modules/by-module/Apache/<br />
mod_perl-1.27.tar&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 下载:http://perl.apache.org/download/index.html<br />
stable.tar(perl-5.8.0)&nbsp; 下载:http://www.cpan.org/src/</p>
<p>把上面的软件下载到一个目录,如test<br />
1:解压<br />
#tar xvf apache_1.3.27.tar <br />
#tar xvf Apache-ASP-2.49.tar<br />
#tar xvf mod_perl-1.27.tar</p>
<p>2:<a target="_blank" href="#" class="UBBWordLink">安装</a>apache<br />
为了以DSO的方式<a target="_blank" href="#" class="UBBWordLink">安装</a>mod_perl,所以要有so模块<br />
#cd apache_1.3.27<br />
#./configure --prefix=/usr/local/apache<br />
#make<br />
#make install<br />
上面这样编译会有一些modules加不进来,我只好手动指定modules了,大家用下面的命令<a target="_blank" href="#" class="UBBWordLink">安装</a>apache<br />
#./configure --prefix=/usr/local/apache --enable-module=auth_anon --enable-module=auth_dbm --enable-module=autoindex -</p>
<p>-enable-module=cgi --enable-module=expires --enable-module=expires --enable-module=proxy --enable-module=rewrite -</p>
<p>-enable-module=so<br />
#make<br />
#make install<br />
检查<a target="_blank" href="#" class="UBBWordLink">安装</a>的模块<br />
#cd /usr/local/apache/bin/httpd -l<br />
Compiled-in modules:<br />
&nbsp; http_core.c<br />
&nbsp; mod_env.c<br />
&nbsp; mod_log_config.c<br />
&nbsp; mod_mime.c<br />
&nbsp; mod_negotiation.c<br />
&nbsp; mod_status.c<br />
&nbsp; mod_include.c<br />
&nbsp; mod_autoindex.c<br />
&nbsp; mod_dir.c<br />
&nbsp; mod_cgi.c<br />
&nbsp; mod_asis.c<br />
&nbsp; mod_imap.c<br />
&nbsp; mod_actions.c<br />
&nbsp; mod_userdir.c<br />
&nbsp; mod_alias.c<br />
&nbsp; mod_rewrite.c<br />
&nbsp; mod_access.c<br />
&nbsp; mod_auth.c<br />
&nbsp; mod_auth_anon.c<br />
&nbsp; mod_auth_dbm.c<br />
&nbsp; mod_proxy.c<br />
&nbsp; mod_expires.c<br />
&nbsp; mod_so.c<br />
&nbsp; mod_setenvif.c<br />
suexec: disabled&#59; invalid wrapper /usr/local/apache/bin/suexe</p>
<p>3:<a target="_blank" href="#" class="UBBWordLink">安装</a>mod_perl<br />
% make -v<br />
% gcc -v<br />
% perl -v<br />
<a target="_blank" href="#" class="UBBWordLink">安装</a>perl<br />
我得perl版本不够,所以我升级了一下perl的版本,现在是v5.8.0 <br />
下载<a href="http://www.cpan.org/src/stable.tar">http://www.cpan.org/src/stable.tar</a><br />
#tar xvf stable.tar<br />
#cd perl-5.8.0/<br />
#make<br />
#make install<br />
到sunfreeware下载pkg的<a target="_blank" href="#" class="UBBWordLink">安装</a>也可以,可能还更简单</p>
<p>#cd mod_perl-1.27<br />
看看DSO编译的语法<br />
#grep DSO Makefile.PL <br />
照猫画虎<br />
#perl Makefile.PL EVERYTHING=1 DO_HTTPD=1 USE_APACI=1 USE_DSO=1 USE_APXS=1 WITH_APXS=/usr/local/apache/bin/apxs<br />
#make<br />
#make install</p>
<p>测试mod_perl模块<br />
启动apache<br />
#telnet localhost 80<br />
Trying 127.0.0.1...<br />
Connected to localhost.<br />
Escape character is '^]'.<br />
输入get Head /http /1.0<br />
HTTP/1.1 400 Bad Request<br />
Date: Wed, 25 Dec 2002 03:32:32 GMT<br />
Server: Apache/1.3.27 (Unix) mod_perl/1.27</p>
<p>ok,mod_perl加上了</p>
<p><br />
给perl安装asp模块,一张<a target="_blank" href="#" class="UBBWordLink">方法</a>是CPAN安装,一种是常规<a target="_blank" href="#" class="UBBWordLink">安装</a><br />
CPAN安装<br />
#perl -MCPAN -e shell<br />
cpan&gt;; install CPAN<br />
...<br />
Installing the Apache::ASP bundle will automatically install all the modules<br />
Apache::ASP is dependent on as well as Apache::ASP itself. If you have<br />
trouble installing the bundle, then try installing the necessary modules one<br />
at a time:<br />
cpan&gt;; install MLDBM<br />
cpan&gt;; install MLDBM::Sync<br />
cpan&gt;; install Digest::MD5<br />
cpan&gt;; install Apache::ASP</p>
<p>For extra/optional functionality in Apache::ASP 2.31 or greater, like<br />
support for FormFill, XSLT, or SSI, you can install this bundle via CPAN:<br />
cpan&gt;; install Bundle::Apache::ASP::Extra</p>
<p>也可以用常规的<a target="_blank" href="#" class="UBBWordLink">方法</a><a target="_blank" href="#" class="UBBWordLink">安装</a>asp模块<br />
Otherwise, just copy ASP.pm to<br />
$PERLLIB/site/Apache<br />
&gt;; perl Makefile.PL<br />
&gt;; make <br />
&gt;; make test<br />
&gt;; make install</p>
<p><a target="_blank" href="#" class="UBBWordLink">安装</a>完毕,进行测试<br />
在htdocs里vi一个test.asp,内容如下</p>
<p>&lt;!-- sample here --&gt;; <br />
&lt;html&gt;; <br />
&lt;body&gt;; <br />
For loop incrementing font size: &lt;p&gt;; <br />
&lt;% for(1..5) { %&gt;; <br />
&lt;!-- iterated html text --&gt;; <br />
&lt;font size=&quot;&lt;%=$_%&gt;;&quot; &gt;; Size = &lt;%=$_%&gt;; &lt;/font&gt;; &lt;br&gt;; <br />
&lt;% } %&gt;; <br />
&lt;/body&gt;; <br />
&lt;/html&gt;; <br />
&lt;!-- end sample here --&gt;;</p>
<p><a href="http://202.106.185.101/test.asp">http://202.106.185.101/test.asp</a><br />
大家可以到这里看看效果</p>
<p>good luck!</p>
<p>参考文档<br />
<a href="http://www.apache-asp.org/install.html">http://www.apache-asp.org/install.html</a><br />
<a href="http://cpan.org/modules/by-module/Apache/Apache-ASP-2.49.readme">http://cpan.org/modules/by-module/Apache/Apache-ASP-2.49.readme</a><br />
<a href="http://perl.apache.org/docs/1.0/guide/getwet.html">http://perl.apache.org/docs/1.0/guide/getwet.html</a><br />
<a href="http://www.freelamp.com/new/publish/1015481268/index_html">http://www.freelamp.com/new/publish/1015481268/index_html</a>
                <br />
&nbsp;</p>
頁: [1]
查看完整版本: 在unix/bsd上让apache支持asp