当前位置: 移动技术网 > 科技>操作系统>Unix > 在unix/bsd上让apache支持asp

在unix/bsd上让apache支持asp

2018年03月19日  | 移动技术网科技  | 我要评论

在这里讨论这个问题,仅是为了研究,我个人认为,在unix上,让apache支持asp没有任何实际意义
如果以前是在win上开发的asp,我想你就让到在win上好好用吧,不用费劲的移植到unix上了

我是在solaris上测试的安装,其它系统,freebsd,linux和sco我想也差不多,忘大家测时候能反馈给我你的结果,谢谢
好了,让我们开始吧
下载相关软件
apache_1.3.27.tar       下载:http://www.apache.org/dist
apache-asp-2.49.tar     下载:http://cpan.org/modules/by-module/apache/
mod_perl-1.27.tar       下载:http://perl.apache.org/download/
stable.tar(perl-5.8.0)  下载:http://www.cpan.org/src/

把上面的软件下载到一个目录,如test
1:解压
#tar xvf apache_1.3.27.tar
#tar xvf apache-asp-2.49.tar
#tar xvf mod_perl-1.27.tar

2:安装apache
为了以dso的方式安装mod_perl,所以要有so模块
#cd apache_1.3.27
#./configure --prefix=/usr/local/apache
#make
#make install
上面这样编译会有一些modules加不进来,我只好手动指定modules了,大家用下面的命令安装apache
#./configure --prefix=/usr/local/apache --enable-module=auth_anon --enable-module=auth_dbm --enable-module=autoindex -

-enable-module=cgi --enable-module=expires --enable-module=expires --enable-module=proxy --enable-module=rewrite -

-enable-module=so
#make
#make install
检查安装的模块
#cd /usr/local/apache/bin/httpd -l
compiled-in modules:
  http_core.c
  mod_env.c
  mod_log_config.c
  mod_mime.c
  mod_negotiation.c
  mod_status.c
  mod_include.c
  mod_autoindex.c
  mod_dir.c
  mod_cgi.c
  mod_asis.c
  mod_imap.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_rewrite.c
  mod_access.c
  mod_auth.c
  mod_auth_anon.c
  mod_auth_dbm.c
  mod_proxy.c
  mod_expires.c
  mod_so.c
  mod_setenvif.c
suexec: disabled; invalid wrapper /usr/local/apache/bin/suexe

3:安装mod_perl
% make -v
% gcc -v
% perl -v
安装perl
我得perl版本不够,所以我升级了一下perl的版本,现在是v5.8.0
下载
#tar xvf stable.tar
#cd perl-5.8.0/
#make
#make install
到sunfreeware下载pkg的安装也可以,可能还更简单

#cd mod_perl-1.27
看看dso编译的语法
#grep dso makefile.pl
照猫画虎
#perl makefile.pl everything=1 do_httpd=1 use_apaci=1 use_dso=1 use_apxs=1 with_apxs=/usr/local/apache/bin/apxs
#make
#make install

测试mod_perl模块
启动apache
#telnet localhost 80
trying 127.0.0.1...
connected to localhost.
escape character is '^]'.
输入get head /http /1.0
http/1.1 400 bad request
date: wed, 25 dec 2002 03:32:32 gmt
server: apache/1.3.27 (unix) mod_perl/1.27

ok,mod_perl加上了


给perl安装asp模块,一张方法是cpan安装,一种是常规安装
cpan安装
#perl -mcpan -e shell
cpan>; install cpan
...
installing the apache::asp bundle will automatically install all the modules
apache::asp is dependent on as well as apache::asp itself. if you have
trouble installing the bundle, then try installing the necessary modules one
at a time:
cpan>; install mldbm
cpan>; install mldbm::sync
cpan>; install digest::md5
cpan>; install apache::asp

for extra/optional functionality in apache::asp 2.31 or greater, like
support for formfill, xslt, or ssi, you can install this bundle via cpan:
cpan>; install bundle::apache::asp::extra

也可以用常规的方法安装asp模块
otherwise, just copy asp.pm to
$perllib/site/apache
>; perl makefile.pl
>; make
>; make test
>; make install

安装完毕,进行测试
在htdocs里vi一个test.asp,内容如下

<!-- sample here -->;
<html>;
<body>;
for loop incrementing font size: <p>;
<% for(1..5) { %>;
<!-- iterated html text -->;
<font size="<%=$_%>;" >; size = <%=$_%>; </font>; <br>;
<% } %>;
</body>;
</html>;
<!-- end sample here -->;


大家可以到这里看看效果

good luck!

参考文档




 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网