尽管在linux下安装asp环境,有点狗血,但还是会遇到,如果不想虚拟出台windows,还是做一下配置吧,找点资料。
===========
本文章是网流传比较多的版本的修改版,根据我自己的实际环境测试成功。
我的环境是RHEL5.01+APACHE2.2.3
具体操作步骤如下:
一、对APACHE的APXS进行PERL编译
1、要保证系统中已经安装了perl,
然后再下载mod_perl压缩包,根据APACHE1.x/2.x版本选择相应的perl版本
下载地址:http://perl.apache.org/download/index.html
下载完成后解包,执行:
(1)、perl Makefile.PL MP_APXS=/usr/sbin/apxs
其中/usr/sbin/apxs是根据apxs文件的位置(有些默认没有安装需要安装httpd-devel-2.2.3.rpm的软件包)
(2)、make
make test
make install
2、在httpd.conf中添加mod_perl,以及测试
(1)、在httpd.conf中任意位置加入一行
LoadModule perl_module modules/mod_perl.so
(2)、测试是否安装mod_perl
输入:#telnet localhost 80
get Head /http /1.0
看看是否有mod_perl
3、给perl安装asp模块,通过CPAN方法安装
#perl -MCPAN -e shell
出现配置文件的选择,ctrl+c取消手动配置文件
cpan> install CPAN
cpan> install MLDBM
cpan> install MLDBM::Sync
cpan> install Apache::ASP
以上的命令中会有上官网下载最新的文件并会自动安装。
4、在httpd.conf文件中追加上:
PerlModule Apache::ASP
<Files ~ (\.asp)>
SetHandler perl-script
PerlHandler Apache::ASP
PerlSetVar Global .
PerlSetVar StateDir /tmp/asp
</Files>
5、在/etc/httpd/conf/httpd.conf中加入网站主索引文件
在DierctoryIndex中加入如:index.asp即可
http://blog.sina.com.cn/s/blog_5424cd170100dh9y.html
http://perl.apache.org/docs/2.0/user/install/install.html
http://www.2cto.com/Article/201006/51644.html
http://www.apache-asp.org/config.html
http://www.apache-asp.org/install.html