在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 下载:http://www.apache.org/dist<br />
Apache-ASP-2.49.tar 下载:http://cpan.org/modules/by-module/Apache/<br />
mod_perl-1.27.tar 下载:http://perl.apache.org/download/index.html<br />
stable.tar(perl-5.8.0) 下载: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 />
http_core.c<br />
mod_env.c<br />
mod_log_config.c<br />
mod_mime.c<br />
mod_negotiation.c<br />
mod_status.c<br />
mod_include.c<br />
mod_autoindex.c<br />
mod_dir.c<br />
mod_cgi.c<br />
mod_asis.c<br />
mod_imap.c<br />
mod_actions.c<br />
mod_userdir.c<br />
mod_alias.c<br />
mod_rewrite.c<br />
mod_access.c<br />
mod_auth.c<br />
mod_auth_anon.c<br />
mod_auth_dbm.c<br />
mod_proxy.c<br />
mod_expires.c<br />
mod_so.c<br />
mod_setenvif.c<br />
suexec: disabled; 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>; 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>; install MLDBM<br />
cpan>; install MLDBM::Sync<br />
cpan>; install Digest::MD5<br />
cpan>; 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>; 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 />
>; perl Makefile.PL<br />
>; make <br />
>; make test<br />
>; make install</p>
<p><a target="_blank" href="#" class="UBBWordLink">安装</a>完毕,进行测试<br />
在htdocs里vi一个test.asp,内容如下</p>
<p><!-- sample here -->; <br />
<html>; <br />
<body>; <br />
For loop incrementing font size: <p>; <br />
<% for(1..5) { %>; <br />
<!-- iterated html text -->; <br />
<font size="<%=$_%>;" >; Size = <%=$_%>; </font>; <br>; <br />
<% } %>; <br />
</body>; <br />
</html>; <br />
<!-- end sample here -->;</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 />
</p>
頁:
[1]