安装步骤:参考:https://blog.csdn.net/hefeng_aspnet/article/details/12050491
前期准备:
yum install gcc* make* sysstat* net-tool* wget* telnet* apr* *pcre* perl* -y
yum install openssl-devel -y
yum update openssl
1.安装Apache::ASP(也可在第3步之后安装)
perl -MCPAN -e shell
install CPAN
install MLDBM
install MLDBM::Sync
install Apache::ASP
2.yum install *httpd* -y
3.安装apache的mod_perl模块
http://www.apache.org/dyn/closer.cgi/perl/mod_perl-2.0.10.tar.gz
tar -zxvf mod_perl-2.0.10.tar.gz
cd mod_perl-2.0.10
perl Makefile.PL EVERYTHING=1 DO_HTTPD=1 USE_APACI=1 USE_DSO=1 USE_APXS=1
make
make install
4.配置asp页面并测试:
默认安装目录:/etc/httpd
[root@localhost html]# cd /etc/httpd/
[root@localhost httpd]# ls
conf conf.d conf.modules.d logs modules run
[root@localhost conf.modules.d]# ls
00-asp.conf 00-base.conf 00-dav.conf 00-lua.conf 00-mpm.conf 00-proxy.conf 00-systemd.conf 01-cgi.conf
[root@localhost conf.modules.d]# vi 00-asp.conf
LoadModule perl_module modules/mod_perl.so
PerlModule Apache::ASP
conf目录下修改httpd.conf
添加如下内容:
<Files ~ (\.asp)>
SetHandler perl-script
PerlHandler Apache::ASP
PerlSetVar Global .
PerlSetVar StateDir /tmp/asp
</Files>
启停服务:
systemctl start httpd
systemctl stop httpd
systemctl status httpd
默认网站路径:
[root@localhost html]# pwd
/var/www/html
[root@localhost html]# ls
t.asp t.htm t1.asp t2.asp test.asp
asp环境安装在linux上,但是格式语法还是不同windows平台的,比如下面典型区别:
http://www.apache-asp.org/objects.html
编辑t.asp
<%
my $v = $Request->ServerVariables("HTTP_USER_AGENT");
%>
<%=$v%>