RSS
热门关键字:  下载  cms  模版  开源  dedecms
当前位置 :| 主页 > 站长学院 > 服务器 >

[原创]在unix上让apache支持asp

来源:ChinaUnix.net 作者:未知 时间:2006-09-14 Tag: 点击:

作者:南非蜘蛛 zhedou@sohu.com 
个人主页:http://www.douzhe.com
转载请保留作者信息


在这里讨论这个问题,仅是为了研究,我个人认为,在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/index.html
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 
下载http://www.cpan.org/src/stable.tar
#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 -->

http://202.106.185.101/test.asp
大家可以到这里看看效果

good luck!

参考文档
http://www.apache-asp.org/install.html
http://cpan.org/modules/by-module/Apache/Apache-ASP-2.49.readme
http://perl.apache.org/docs/1.0/guide/getwet.html#Installing_mod_perl
http://www.freelamp.com/new/publish/1015481268/index_html

 skyone 回复于:2003-02-20 00:39:17
不知道老兄试过配置好的apache+asp跑跑江湖或是什么其他的asp论坛,我以前装的时候,那个test好象也返回了12345的结果,可是碰到那些asp论坛什么的, 就出现服务器内部错误,不知道你那儿怎么样?

 netstar 回复于:2003-02-20 20:07:13
apache支持asp目前没有什么意义。

 skyone 回复于:2003-02-21 11:53:51
[quote:ee23b5a791="netstar"]apache支持asp目前没有什么意义。[/quote:ee23b5a791]

却实没有意义,但有时候也是必要的, 

好象有一大批的asp程序来不及改成php,但平台已经改变,这种技术就能救一下急了

 hmkart 回复于:2003-02-23 10:22:03
如果用Access数据库+ASP写的。
弄上去,还能跑吗?

 kjljj 回复于:2003-02-24 16:03:40
unix 下的 asp 不能支持vb 
所以没有什么意思

 jfunix 回复于:2003-05-15 13:51:39
[quote:7bf98c8555="netstar"]apache支持asp目前没有什么意义。[/quote:7bf98c8555]


为什么?我是个菜鸟,我不明白。那UNIX下怎么实现WEB访问SYBASE数据库?

 derektu 回复于:2003-06-27 17:53:11
高手,这一段我没法翻译:
     
手动指定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


我用的是RH8,apache_1.3.27.tar,您文章里前面的部分我都翻译成功了,就上面一步开始不行了,报错是这样的:
[root@localhost test]# ./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 
-bash: ./configure: No such file or directory

不知道为啥?这个目录/usr/local/apache 肯定是有的。请高手指教。谢谢

 cqfanli 回复于:2003-07-27 12:54:24
我不明白这一句话:
"也可以用常规的方法安装asp模块 
Otherwise, just copy ASP.pm to 
$PERLLIB/site/Apache "
我不知道把asp.pm复制到具体哪个目录,所以安装出来的系统不能正常启动apache,但make是正确的…

我按照说明里面的,加了这一段在httpd.conf里面去…

<Files ~ (\.asp)>
  SetHandler  perl-script
  PerlModule  Apache::ASP
  PerlHandler Apache::ASP
  PerlSetVar  Global .
  PerlSetVar  StateDir /tmp/asp
</Files>


启动时出现如下的问题…

www# sh /usr/local/sbin/apachectl configtest
Syntax error on line 414 of /usr/local/etc/apache/httpd.conf:
Can't locate Apache/ASP.pm in @INC (@INC contains: /usr/local/lib/site_perl/5.00503/i386-freebsd /usr/local/lib/perl5/site_perl/5.005/i386-freebsd /usr/local/lib/perl5/site_perl/5.005 . /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503 /usr/local/ /usr/local/lib/perl) at (eval 3) line 3.

请大大们帮忙看一下,我的系统是freebsd4.8

 budaodao 回复于:2003-07-30 14:34:25
[quote:2ba6b373bd="hmkart"]如果用Access数据库+ASP写的。
弄上去,还能跑吗?[/quote:2ba6b373bd]     

我也想知道如果Access 数据库+asp来开发的程序拿到bsd/linux/下能用吗?

 everest 回复于:2003-08-15 07:33:06
编译perl-5.8.0时出错
#make
cd sdbm && make all
cc -c  -I../../..  -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -O    -DVERSION=\"\"  -DXS_VERSION=\"\" -DPIC -fpic "-I../../.."  -DSDBM -DDUFF sdbm.c
sdbm.c:41: conflicting types for `malloc'
/usr/include/stdlib.h:100: previous declaration of `malloc'
sdbm.c:42: conflicting types for `free'
/usr/include/stdlib.h:96: previous declaration of `free'
*** Error code 1

Stop in /usr/home/whitsun/art/perl-5.8.0/ext/SDBM_File/sdbm.
*** Error code 1

Stop in /usr/home/whitsun/art/perl-5.8.0/ext/SDBM_File.
*** Error code 1

Stop in /usr/home/whitsun/art/perl-5.8.0.

(系统平台:FreeBSD 5.0)

 yyyly 回复于:2004-08-28 11:39:37
[quote:0f9e360e6e="cqfanli"]我不明白这一句话:
"也可以用常规的方法安装asp模块 
Otherwise, just copy ASP.pm to 
$PERLLIB/site/Apache "
我不知道把asp.pm复制到具体哪个目录,所以安装出来的系统不能正常启动apache,但make是正确的…..........[/quote:0f9e360e6e]



我也是这个问题,不知道copy到哪,后来用cpan安装的,过程中有些校问题,最后还是完成了,但是在启动httpd的时候出现同样的错误提示,很着急,请问有人碰见过这个问题么?最后如何解决的呢?谢谢!

 ruochen 回复于:2005-03-17 16:39:53
[quote:c025c8edd5="南非蜘蛛"]作者:南非蜘蛛 zhedou@sohu.com 
个人主页:http://www.douzhe.com
转载请保留作者信息


在这里讨论这个问题,仅是为了研究,我个人认为,在unix上,让apache支持asp没有任何实际意义
如果以前是在win上开发的asp,..........[/quote:c025c8edd5]



南非蜘蛛---是网易的管理员?

 unixclient 回复于:2005-03-19 00:24:06
solaris系统+?webserver 最好


最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册
热点关注
相关文章