You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Capriotti <ca...@geocities.com> on 2000/05/05 16:37:56 UTC
Apache::ASP not working under FreeBSD 4
Hello.
I am an Apache and Perl newbie, trying to put Apache:ASP
to work for the last few days and having very little success.
Some information on what I've done;
This will be a long email. Sorry, but I am really lost and need help.
I am using FreeBSD 4.0-RELEASE.
Retrieved the Apache sources and uncompressed it
under my home dir : /home/cap/apache_src/apache_1.3.12
Did the same to perl - got the sources package frem CPAM and instsalled it.
Some if the modules had to be installed using "force", since they wouldn't
test, because of some stupid problem with the Apache binaries
(pre-compiled) I have here. All the dependencies were satisfied. At the end
of the process all the tests passed ok.
Retrieved the mod_perl sources, and followed ALL the steps. I allowed
the script to change apache's config and to build it too.
This is a screen dump of the results:
bash-2.03# perl Makefile.PL EVERYTHING=1
Enter `q' to stop search
Please tell me where I can find your apache src
[/home/cap/apache_src/apache_1.3.12/src/]
Configure mod_perl with /home/cap/apache_src/apache_1.3.12/src/ ? [y]
Shall I build httpd in /home/cap/apache_src/apache_1.3.12/src/ for you? [y]
Appending mod_perl to src/Configuration
Using config file: /usr/home/cap/mod_perl/mod_perl-1.23/src/Configuration
Creating Makefile
+ configured for FreeBSD 4.0 platform
+ setting C compiler to gcc
+ setting C pre-processor to gcc -E
+ checking for system header files
+ adding selected modules
+ checking sizeof various data types
+ doing sanity check on compiler and options
Creating Makefile in support
Creating Makefile in os/unix
Creating Makefile in ap
Creating Makefile in main
Creating Makefile in lib/expat-lite
Creating Makefile in modules/standard
EXTRA_CFLAGS: -funsigned-char -DUSE_EXPAT -I$(SRCDIR)/lib/expat-lite
-DNO_DL_NEEDED
PerlDispatchHandler.........enabled
PerlChildInitHandler........enabled
PerlChildExitHandler........enabled
PerlPostReadRequestHandler..enabled
PerlTransHandler............enabled
PerlHeaderParserHandler.....enabled
PerlAccessHandler...........enabled
PerlAuthenHandler...........enabled
PerlAuthzHandler............enabled
PerlTypeHandler.............enabled
PerlFixupHandler............enabled
PerlHandler.................enabled
PerlLogHandler..............enabled
PerlInitHandler.............enabled
PerlCleanupHandler..........enabled
PerlRestartHandler..........enabled
PerlStackedHandlers.........enabled
PerlMethodHandlers..........enabled
PerlDirectiveHandlers.......enabled
PerlTableApi................enabled
PerlLogApi..................enabled
PerlUriApi..................enabled
PerlUtilApi.................enabled
PerlFileApi.................enabled
PerlConnectionApi...........enabled
PerlServerApi...............enabled
PerlSections................enabled
PerlSSI.....................enabled
Will run tests as User: 'nobody' Group: 'wheel'
Checking CGI.pm VERSION..........ok
Checking for LWP::UserAgent......ok
Checking for HTML::HeadParser....ok
Writing Makefile for Apache
Writing Makefile for Apache::Connection
Writing Makefile for Apache::Constants
Writing Makefile for Apache::File
Writing Makefile for Apache::Leak
Writing Makefile for Apache::Log
Writing Makefile for Apache::ModuleConfig
Writing Makefile for Apache::PerlRunXS
Writing Makefile for Apache::Server
Writing Makefile for Apache::Symbol
Writing Makefile for Apache::Table
Writing Makefile for Apache::URI
Writing Makefile for Apache::Util
Writing Makefile for mod_perl
after this I cd ../../apache_src/apache_1.3.12
and do a make or make install (maybe I am wront, but I am assuming that
the mod_perl (perl Makefile.PL) will do the make for me, so that
I am using make install only; I've tried to use make too, but the final
result was the same).
After make install, I do a /usr/local/etc/apache/bin/httpd -l and get this
(Yes, I know this is not the best place for a binary, but this is just a
test).
bash-2.03# /usr/local/etc/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_access.c
mod_auth.c
mod_so.c
mod_setenvif.c
mod_perl.c
suexec: disabled; invalid wrapper /usr/local/apache/bin/suexec
Then I changed my /usr/local/etc/apache/conf/httpd.conf to have this:
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
and finally call /usr/local/etc/apache/bin/httpd -f
/usr/local/etc/apache/conf/httpd.conf
The server starts w/o problems. Perfect.
But, when I try to point my netscape 4.72 (native FreeBSD, from the CDROM) to
file:/usr/home/cap/apache_ASP/Apache-ASP-0.18/site/eg/index.htm
i get a simple
#!/usr/local/bin/perl5 asp
on the screen
and if I try to point it to
file:/usr/home/cap/apache_ASP/Apache-ASP-0.18/site/eg/form.asp
I simple get the entire code on my browser.
(part of the code:)
#!/usr/local/bin/perl5 asp
<!--#include file=header.inc-->
<table>
<form method=POST>
<tr>
<td>Your Name:</td>
<td><input name=name type=text size=30
value="<%=$Request->Form('name')%>" >
</td>
<td><input type=submit value="Submit Name"></td>
</tr>
</table>
...
I also attempted to copy the /eg directory to
/usr/local/etc/apache/htdocs/eg
and try to access it pointing the browser to
http://localhost/eg
or, using another station on the network, and try to point the browser to
http://10.249/60.152/eg
and I get this on the screen of my browser:
#!/usr/local/bin/perl5 asp <% # split the page in 2 for nice formatting and
english style sorting my(@col1, @col2); my @keys = sort keys %
...
I also changed the permissions on the eg folder to
drwxrwxrwx
under the htdocs.
Next, I attempted to modify my httpd.conf file to contain this configuration:
<Location /asp/>
SetHandler perl-script
PerlHandler Apache::ASP
# PerlSetVar Global /tmp
</Location>
And tried the access again (yes, kill -9 on all httpd processes). (The
commented line above is intentional, according to some
hints I got from the list archives; But I also tried w/o the comment).
Same result. Only code on browsers.
Finaly I also attempted to add this configuration on my httdp.conf:
<Perl>
Apache::ASP->Loader(
'/usr/local/etc/apache/htdocs/eg/', "(asp|htm)\$",
Global => 'usr/local/etc/apache/htdocs/eg/',
Debug => 1, # see output when starting apache
# OPTIONAL configs if you use them in your apache configuration
# these settings affect how the scripts are compiled and loaded
GlobalPackage => global.asa,
DynamicIncludes => 1,
StatINC => 1,
);
</Perl>
I am not sure if I did this right, since the example was "Windows-like"
and my translation to the Unix world may not be perfect.
But, when I try to start httpd with those lines on the httpd.conf I get this:
/usr/local/etc/apache/bin/httpd -f /usr/local/etc/apache/conf/httpd.conf
Syntax error on line 960 of /usr/local/etc/apache/conf/httpd.conf:
Can't locate object method "Loader" via package "Apache::ASP" at
/usr/local/etc/apache/conf/httpd.conf line 949.
Obviously apache won't start.
In short:
Help, I am in trouble. I don't know What to do next.
All the help will be greatly apreciated, since, if this fails, I'll have to
install and manage a Windows NT/2000 box that supports ASP, and I don't
want Bill to score again !
TIA.
Re: Apache::ASP not working under FreeBSD 4
Posted by Joshua Chamas <jo...@chamas.com>.
Ime Smits wrote:
>
> <...>
> <Files *.asp>
> SetHandler perl-script
> PerlHandler Apache::ASP
> PerlSetVar Global /www/data/state
> </Files>
>
> (change the last directory to some place where your Apache UID can write,
> this is where the session objects are stored)
>
> Second option, leave your httpd.conf as is, without any Apache::ASP in it,
> just with the "AllowOveride All" as you have it, and put the 5 lines as
> above in the directory where your *.asp scripts are in a file called
> .htaccess. So if your DocumentRoot is '/usr/local/etc/apache/htdocs' and
> your eg directory with examples from Apache:::ASP resides there, save this
> file to '/usr/local/etc/apache/htdocs/eg/.htaccess . Everything in .htaccess
> will automatically apply to the complete directory tree thereunder.
>
I think Ime has done a good job with the pointers here.
Re: Apache::ASP not working under FreeBSD 4
Posted by Ime Smits <im...@iae.nl>.
<...>
| The server starts w/o problems. Perfect.
OK, your at lest 90% done now.
<...>
| file:/usr/home/cap/apache_ASP/Apache-ASP-0.18/site/eg/index.htm
That wouldn't work, because then you don't communicate via Apache, nothing
gets executed, it's just like you do a normal cat on the file.
<...>
| http://localhost/eg
| http://10.249/60.152/eg
| and I get this on the screen of my browser:
OK, this is better.
| <Location /asp/>
| SetHandler perl-script
| PerlHandler Apache::ASP
| # PerlSetVar Global /tmp
| </Location>
This would have urls like http://hostname/asp/* be executed via Apache::ASP,
your stuff is in /eg, so this won't work
| Same result. Only code on browsers.
As expected.
| Finaly I also attempted to add this configuration on my httdp.conf:
|
| <Perl>
| Apache::ASP->Loader(
| '/usr/local/etc/apache/htdocs/eg/', "(asp|htm)\$",
| Global => 'usr/local/etc/apache/htdocs/eg/',
| Debug => 1, # see output when starting apache
| GlobalPackage => global.asa,
| DynamicIncludes => 1,
| StatINC => 1,
| );
| </Perl>
First, you're missing a slash before usr/local. Than again, I don't now
where you get that code snippet from, things are much easier than this.
You have two options, either in your httpd.conf, add something like:
<Files *.asp>
SetHandler perl-script
PerlHandler Apache::ASP
PerlSetVar Global /www/data/state
</Files>
(change the last directory to some place where your Apache UID can write,
this is where the session objects are stored)
Second option, leave your httpd.conf as is, without any Apache::ASP in it,
just with the "AllowOveride All" as you have it, and put the 5 lines as
above in the directory where your *.asp scripts are in a file called
.htaccess. So if your DocumentRoot is '/usr/local/etc/apache/htdocs' and
your eg directory with examples from Apache:::ASP resides there, save this
file to '/usr/local/etc/apache/htdocs/eg/.htaccess . Everything in .htaccess
will automatically apply to the complete directory tree thereunder.
Ime