Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

localhost vs vhost more info if poss

Status
Not open for further replies.

turnbui

Programmer
Jul 23, 2005
60
GB
Hi folks,
in my last post I obtained the answer required but I still don't understand why my ASP works for localhost but not for the vhost. The ASP config is within the <VirtualHost> block so should only apply to that localhost. I originally had the ASP config in the vhosts directory using an .htaccess file but was told it would be faster if put into the <VirtualHost> block.
No matter what I try I can't get the ASP pages served correctly when I access them through the I'm using Apache 2.2 / Perl 5.8.8.819 / ASP 2.59 on a WinXP Home machine.
Can anyone throw me a bone to what I might try please?
Thanks
Ian t
 
No, nothing in error log.
It's wierd. I took out the VHOSTS file [stopped it being included by httpd.conf]. There is now just the LoadFile + LoadModule and the C:\Perl\eg\IEExamples which I copied to the vhost DocRoot folder work when invoked by As I have an entry in the HOSTS file for vhost.turnbui.com if I invoke as so the vbscript works but not the PerlScript that this examp;e contains??
There isn't any mod_perl config in httpd.conf either as it was in the <VirtualHost> block which I've excluded?

Whew, what is it I'm doing wrong here?
 
Have you established that all your vhosts are working with plain old index.html files? Are you trying to set apache up to use mod_perl or the interpreter? Is turnbui.com an FQDN? If not, the reason apache works with localhost is because the request is made on the loopback device (127.0.0.1). If you are using a made up name, your browser will try to find it via dns and of course the look up will fail. Apache will never see the request.

 
Yes, my vhosts work fine. I'm using DynDNS and they are accessible from outside. I did have index.html on this one which was fine. My naive attempt to disguise the name might cloud the issue.
If you click this
you will get the ASP documentation. As part of the ASP proving it said to copy the ASP /site to the DocRoot of your server. This being my VHOST or one of them.
But soon as I choose the EXAMPLES at the bottom of the page it goes wrong.
 
Sorry,

Actually I am getting an erro log entry when I try to go to the examples:-

client 192.168.0.15] Can't locate object method "request" via package "Apache" at C:/Perl/site/lib/Apache/ASP.pm line 165.\n, referer:
 
If you get to the point where you want to give up on your install, there is a package out there that may interest you. Check it out here: This page lists everything that comes with it. You will notice that it includes apache::asp :)
 
Thanks, I'm definately at that stage now.
 
Yabba dabba dooo, Just got the second page up so it looks pretty close now!
 
I've been doing a little checking since I don't know anything about apache::asp. These are some of the things I've found. First, you need mod_perl for apache::asp to work. You should have something that looks like The following lines in httpd.conf. If not, you may want to copy and paste these into it and see if they help. I would put them in the global section, not within a vhost.

Code:
#perl config
LoadFile perl\bin\perl58.dll
LoadModule perl_module modules/mod_perl.so
<IfModule mod_perl.c>
AddHandler perl-script .pl
AddType application/x-httpd-perl .pl
PerlOptions ParseHeaders
PerlHandler ModPerl::Registry
PerlSendHeader On
</IfModule>

#asp config
<IfModule mod_perl.c>
PerlModule Apache::ASP
PerlSetVar NoState 1
<Files ~ (\.asp)>
SetHandler perl-script
PerlHandler Apache::ASP
PerlSetVar Global .
PerlSetVar StateDir "C:/[URL unfurl="true"]www/temp"[/URL]
</Files>
</IfModule>
 
I forgot to mention that this line:

PerlSetVar StateDir "C:/
should be set to the path for your ServerRoot. This temp directory needs to exist.
 
Thanks for that, I've finally got it going - after finding some obscure docs for Win32. Your stuff looks very similar so I'll double check what will be useful from that. Thanks for your time. Much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top