Let Apache support ASP on UNIX / BSD

Time:2019-8-16

I’m just discussing this issue here for research purposes. Personally, I don’t think it makes any sense for Apache to support ASP on unix.
If you used to develop ASP on win, I think you should let it work well on win and transplant it to UNIX without any effort.

I am testing the installation on solaris, other systems, freebsd, Linux and sco, I think it’s the same. Forget your results when you test, thank you.
Okay, let’s get started.
Download related software
Apache_1.3.27.tar Download: http://www.apache.org/dist
Apache-ASP-2.49.tar Download: http://cpan.org/modules/by-module/Apache/
Download: http://perl.apache.org/download/index.html
Stable.tar (perl-5.8.0) Download: http://www.cpan.org/src/

Download the above software to a directory, such as test
1: Decompression
#tar xvf apache_1.3.27.tar
#tar xvf Apache-ASP-2.49.tar
#tar xvf mod_perl-1.27.tar

2: Install Apache
In order to install mod_perl in DSO mode, so we need so module
#cd apache_1.3.27
#./configure –prefix=/usr/local/apache
#make
#make install
Some modules will not be added to the above compilation, so I have to specify modules manually. You can install Apache with the following commands
#./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
Check installed modules
#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: Install mod_perl
% make -v
% gcc -v
% perl -v
Install Perl
I didn’t have enough Perl versions, so I upgraded the Perl version. Now it’s v5.8.0.
Download http://www.cpan.org/src/stable.tar
#tar xvf stable.tar
#cd perl-5.8.0/
#make
#make install
Download the installation of PKG from sunfreeware is also possible, and it may be simpler

#cd mod_perl-1.27
Look at the syntax of DSO compilation
#grep DSO Makefile.PL
Copy sth. without catching its spirit
#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

Testing mod_perl module
Start Apache
#telnet localhost 80
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
Enter 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 added

One way to install ASP module for Perl is to install CPAN and the other is to install it routinely.
CPAN Installation
#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

You can also install ASP modules in a conventional way
Otherwise, just copy ASP.pm to
$PERLLIB/site/Apache
>; perl Makefile.PL
>; make
>; make test
>; make install

After installation, test
In htdocs, VI is a test. asp, which reads as follows

<!– 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
You can come here and see the effect.

good luck!

Reference Documents
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