mod_perl, apache, virtual host problem 
Author Message
 mod_perl, apache, virtual host problem

I am having a problem with mod_perl and Apache.  When I use localhost
or my domain name (in this case, www.mentalists.ws) as my address,
everything seems to work fine (perl code is interpreted and the result
is displayed in the browser).  When I attempt to use a virtual host
(in this case www.insomnix.com), my browser opens up a save as window,
in short, it doesn't know what to do with perl files.  I've tweaked
this thing all day, and can't figure out the problem.  I am using NT.
My httpd.conf file is below (with domain names changed to protect the
innocent).  If anyone has any ideas, I would very much appreciate it.
Thanks in advance.

Dom

#
# Based upon the NCSA server configuration files originally by Rob
McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL: http://www.*-*-*.com/ ; for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are
unsure
# consult the online docs. You have been warned.  
#
# After this file is processed, the server will look for and process
# d:/Apache Group/Apache/conf/srm.conf and then d:/Apache
Group/Apache/conf/access.conf
# unless you have overridden these with ResourceConfig and/or
# AccessConfig directives here.
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server
process as a
#     whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default'
server,
#     which responds to requests that aren't handled by a virtual
host.
#     These directives also provide default values for the settings
#     of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent
to
#     different IP addresses or hostnames and have them handled by the
#     same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for
many
# of the server's control files begin with "/" (or "drive:/" for
Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "/usr/local/apache" will be interpreted by
the
# server as "/usr/local/apache/logs/foo.log".
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which Apache.exe is
located
# will be used by default.  It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
# confusion.
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of
Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerType is either inetd, or standalone.  Inetd mode is only
supported on
# Unix platforms.
#
ServerType standalone

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "d:/Apache Group/Apache"

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile logs/httpd.pid

#
# ScoreBoardFile: File used to store internal server process
information.
# Not all architectures require this.  But if yours does (you'll know
because
# this file will be  created when you run Apache) then you *must*
ensure that
# no two invocations of Apache share the same scoreboard file.
#
ScoreBoardFile logs/apache_status

#
# In the standard configuration, the server will process httpd.conf,
# srm.conf, and access.conf in that order.  The latter two files are
# now distributed empty, as it is recommended that all directives
# be kept in a single file for simplicity.  The commented-out values
# below are the built-in defaults.  You can have the server ignore
# these files altogether by using "/dev/null" (for Unix) or
# "nul" (for Win32) for the arguments to the directives.
#
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited
amount.
# We reccomend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request
from the
# same client on the same connection.
#
KeepAliveTimeout 15

#
# Apache on Win32 always creates one child process to handle requests.
 If it
# dies, another child process is created automatically.  Within the
child
# process multiple threads handle incoming requests.  The next two
# directives control the behaviour of the threads and processes.
#

#
# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies.  The child will exit so
# as to avoid problems after prolonged use when Apache (and maybe the
# libraries it uses) leak memory or other resources.  On most systems,
this
# isn't really needed, but a few (such as Solaris) do have notable
leaks
# in the libraries.  For Win32, set this value to zero (unlimited)
# unless advised otherwise.
#
MaxRequestsPerChild 0

#
# Number of concurrent threads (i.e., requests) the server will allow.
# Set this value according to the responsiveness of the server (more
# requests active at once means they're all handled more slowly) and
# the amount of system resources you'll allow the server to consume.
#
ThreadsPerChild 50

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
#Listen 3000
#Listen 12.34.56.78:80

#
# BindAddress: You can support virtual hosts with this option. This
directive
# is used to tell the server which IP address to listen to. It can
either
# contain "*", an IP address, or a fully qualified Internet domain
name.
# See also the <VirtualHost> and Listen directives.
#
#BindAddress *

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a
DSO you
# have to place corresponding `LoadModule' lines at this location so
the
# directives contained in it are actually available _before_ they are
used.
# Please read the file README.DSO in the Apache 1.3 distribution for
more
# details about the DSO mechanism and run `apache -l' for the list of
already
# built-in (statically linked and thus always available) modules in
your Apache
# binary.
#
# Note: The order in which modules are loaded is important.  Don't
change
# the order below without expert advice.
#
#LoadModule anon_auth_module modules/ApacheModuleAuthAnon.dll
#LoadModule cern_meta_module modules/ApacheModuleCERNMeta.dll
#LoadModule digest_module modules/ApacheModuleDigest.dll
#LoadModule expires_module modules/ApacheModuleExpires.dll
#LoadModule headers_module modules/ApacheModuleHeaders.dll
#LoadModule proxy_module modules/ApacheModuleProxy.dll
#LoadModule rewrite_module modules/ApacheModuleRewrite.dll
#LoadModule speling_module modules/ApacheModuleSpeling.dll
#LoadModule status_module modules/ApacheModuleStatus.dll
#LoadModule usertrack_module modules/ApacheModuleUserTrack.dll
LoadModule perl_module modules/mod_perl.so
#LoadModule perl_module modules/ApacheModulePerl-1.24_1.3.12.dll

#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information
(ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
#ExtendedStatus On

### Section 2: 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

#
# If your ServerType directive (set earlier in the 'Global
Environment'
# section) is set to "inetd", the next few directives don't have any
# effect since their settings are defined by the inetd configuration.
# Skip ahead to the ServerAdmin directive.
#

#
# Port: The port to which the standalone server listens.
#
Port 80

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.
#

#
# ServerName allows you to set a host name which is sent back to
clients for
# your server if it's different than the one the program would get
(i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name
you
# define here must be a valid DNS name for your host. If you don't
understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP
address here.
# You will have to access it by its address (e.g.,
http://www.*-*-*.com/ )
# anyway, and this will make redirections work in a sensible way.
#
ServerName www.mentalists.ws

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory,
but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "d:/Apache Group/Apache/htdocs"

#
# Each ...

read more »



Mon, 09 Feb 2004 06:11:02 GMT  
 mod_perl, apache, virtual host problem


Quote:
> I am having a problem with mod_perl and Apache.  When I use localhost
> or my domain name (in this case, www.mentalists.ws) as my address,
> everything seems to work fine (perl code is interpreted and the result
> is displayed in the browser).  When I attempt to use a virtual host
> (in this case www.insomnix.com), my browser opens up a save as window,
> in short, it doesn't know what to do with perl files.  I've tweaked
> this thing all day, and can't figure out the problem.  I am using NT.
> My httpd.conf file is below (with domain names changed to protect the
> innocent).  If anyone has any ideas, I would very much appreciate it.
> Thanks in advance.

> Dom

> #
> # Based upon the NCSA server configuration files originally by Rob
> McCool.
> #
> # This is the main Apache server configuration file.  It contains the
> # configuration directives that give the server its instructions.
> # See <URL:http://www.apache.org/docs/> for detailed information about
> # the directives.
> #
> # Do NOT simply read the instructions in here without understanding
> # what they do.  They're here only as hints or reminders.  If you are
> unsure
> # consult the online docs. You have been warned.
> #
> # After this file is processed, the server will look for and process
> # d:/Apache Group/Apache/conf/srm.conf and then d:/Apache
> Group/Apache/conf/access.conf
> # unless you have overridden these with ResourceConfig and/or
> # AccessConfig directives here.
> #
> # The configuration directives are grouped into three basic sections:
> #  1. Directives that control the operation of the Apache server
> process as a
> #     whole (the 'global environment').
> #  2. Directives that define the parameters of the 'main' or 'default'
> server,
> #     which responds to requests that aren't handled by a virtual
> host.
> #     These directives also provide default values for the settings
> #     of all virtual hosts.
> #  3. Settings for virtual hosts, which allow Web requests to be sent
> to
> #     different IP addresses or hostnames and have them handled by the
> #     same Apache server process.
> #
> # Configuration and logfile names: If the filenames you specify for
> many
> # of the server's control files begin with "/" (or "drive:/" for
> Win32), the
> # server will use that explicit path.  If the filenames do *not* begin
> # with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
> # with ServerRoot set to "/usr/local/apache" will be interpreted by
> the
> # server as "/usr/local/apache/logs/foo.log".
> #
> # NOTE: Where filenames are specified, you must use forward slashes
> # instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
> # If a drive letter is omitted, the drive on which Apache.exe is
> located
> # will be used by default.  It is recommended that you always supply
> # an explicit drive letter in absolute paths, however, to avoid
> # confusion.
> #

> ### Section 1: Global Environment
> #
> # The directives in this section affect the overall operation of
> Apache,
> # such as the number of concurrent requests it can handle or where it
> # can find its configuration files.
> #

> #
> # ServerType is either inetd, or standalone.  Inetd mode is only
> supported on
> # Unix platforms.
> #
> ServerType standalone

> #
> # ServerRoot: The top of the directory tree under which the server's
> # configuration, error, and log files are kept.
> #
> # Do NOT add a slash at the end of the directory path.
> #
> ServerRoot "d:/Apache Group/Apache"

> #
> # PidFile: The file in which the server should record its process
> # identification number when it starts.
> #
> PidFile logs/httpd.pid

> #
> # ScoreBoardFile: File used to store internal server process
> information.
> # Not all architectures require this.  But if yours does (you'll know
> because
> # this file will be  created when you run Apache) then you *must*
> ensure that
> # no two invocations of Apache share the same scoreboard file.
> #
> ScoreBoardFile logs/apache_status

> #
> # In the standard configuration, the server will process httpd.conf,
> # srm.conf, and access.conf in that order.  The latter two files are
> # now distributed empty, as it is recommended that all directives
> # be kept in a single file for simplicity.  The commented-out values
> # below are the built-in defaults.  You can have the server ignore
> # these files altogether by using "/dev/null" (for Unix) or
> # "nul" (for Win32) for the arguments to the directives.
> #
> #ResourceConfig conf/srm.conf
> #AccessConfig conf/access.conf

> #
> # Timeout: The number of seconds before receives and sends time out.
> #
> Timeout 300

> #
> # KeepAlive: Whether or not to allow persistent connections (more than
> # one request per connection). Set to "Off" to deactivate.
> #
> KeepAlive On

> #
> # MaxKeepAliveRequests: The maximum number of requests to allow
> # during a persistent connection. Set to 0 to allow an unlimited
> amount.
> # We reccomend you leave this number high, for maximum performance.
> #
> MaxKeepAliveRequests 100

> #
> # KeepAliveTimeout: Number of seconds to wait for the next request
> from the
> # same client on the same connection.
> #
> KeepAliveTimeout 15

> #
> # Apache on Win32 always creates one child process to handle requests.
>  If it
> # dies, another child process is created automatically.  Within the
> child
> # process multiple threads handle incoming requests.  The next two
> # directives control the behaviour of the threads and processes.
> #

> #
> # MaxRequestsPerChild: the number of requests each child process is
> # allowed to process before the child dies.  The child will exit so
> # as to avoid problems after prolonged use when Apache (and maybe the
> # libraries it uses) leak memory or other resources.  On most systems,
> this
> # isn't really needed, but a few (such as Solaris) do have notable
> leaks
> # in the libraries.  For Win32, set this value to zero (unlimited)
> # unless advised otherwise.
> #
> MaxRequestsPerChild 0

> #
> # Number of concurrent threads (i.e., requests) the server will allow.
> # Set this value according to the responsiveness of the server (more
> # requests active at once means they're all handled more slowly) and
> # the amount of system resources you'll allow the server to consume.
> #
> ThreadsPerChild 50

> #
> # Listen: Allows you to bind Apache to specific IP addresses and/or
> # ports, in addition to the default. See also the <VirtualHost>
> # directive.
> #
> #Listen 3000
> #Listen 12.34.56.78:80

> #
> # BindAddress: You can support virtual hosts with this option. This
> directive
> # is used to tell the server which IP address to listen to. It can
> either
> # contain "*", an IP address, or a fully qualified Internet domain
> name.
> # See also the <VirtualHost> and Listen directives.
> #
> #BindAddress *

> #
> # Dynamic Shared Object (DSO) Support
> #
> # To be able to use the functionality of a module which was built as a
> DSO you
> # have to place corresponding `LoadModule' lines at this location so
> the
> # directives contained in it are actually available _before_ they are
> used.
> # Please read the file README.DSO in the Apache 1.3 distribution for
> more
> # details about the DSO mechanism and run `apache -l' for the list of
> already
> # built-in (statically linked and thus always available) modules in
> your Apache
> # binary.
> #
> # Note: The order in which modules are loaded is important.  Don't
> change
> # the order below without expert advice.
> #
> #LoadModule anon_auth_module modules/ApacheModuleAuthAnon.dll
> #LoadModule cern_meta_module modules/ApacheModuleCERNMeta.dll
> #LoadModule digest_module modules/ApacheModuleDigest.dll
> #LoadModule expires_module modules/ApacheModuleExpires.dll
> #LoadModule headers_module modules/ApacheModuleHeaders.dll
> #LoadModule proxy_module modules/ApacheModuleProxy.dll
> #LoadModule rewrite_module modules/ApacheModuleRewrite.dll
> #LoadModule speling_module modules/ApacheModuleSpeling.dll
> #LoadModule status_module modules/ApacheModuleStatus.dll
> #LoadModule usertrack_module modules/ApacheModuleUserTrack.dll
> LoadModule perl_module modules/mod_perl.so
> #LoadModule perl_module modules/ApacheModulePerl-1.24_1.3.12.dll

> #
> # ExtendedStatus controls whether Apache will generate "full" status
> # information (ExtendedStatus On) or just basic information
> (ExtendedStatus
> # Off) when the "server-status" handler is called. The default is Off.
> #
> #ExtendedStatus On

> ### Section 2: 'Main' server configuration
> #
> # The directives in this section set up the values used by the 'main'
> # server, which responds to any requests that aren't handled by a
> # <VirtualHost> definition.  These values also provide defaults for
> # any <VirtualHost> containers you may define later in the file.
> #
> # All of these directives may appear inside <VirtualHost> containers,
> # in which case these default settings will be overridden for the
> # virtual host being defined.
> #

> #
> # If your ServerType directive (set earlier in the 'Global
> Environment'
> # section) is set to "inetd", the next few directives don't have any
> # effect since their settings are defined by the inetd configuration.
> # Skip ahead to the ServerAdmin directive.
> #

> #
> # Port: The port to which the standalone server listens.
> #
> Port 80

> #
> # ServerAdmin: Your address, where problems with the server should be
> # e-mailed.  This address appears on some server-generated pages, such
> # as error documents.
> #

> #
> # ServerName allows you to set a host name which is sent back to
> clients for
> # your server if it's different than the one the program would get
> (i.e., use
> # "www" instead of the host's real name).
> #
> # Note: You cannot just invent host names and hope they work. The name
> you
> #

...

read more »



Mon, 09 Feb 2004 07:26:00 GMT  
 mod_perl, apache, virtual host problem

[snipped about a few thousand quoted and _uncommented_ lines]

Quote:
> try PerlHandler Apache::Registry instead of PerlHandler Apache::PerlRun

Well, honestly, you should get an award for the worst quote in this
group for a long time. Please, next time quote but trim the quoted stuff
to a required subset.
Tassilo

--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->

(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108


ord(chr($h->{$_}))))};



Mon, 09 Feb 2004 14:27:38 GMT  
 mod_perl, apache, virtual host problem

Quote:
> try PerlHandler Apache::Registry instead of PerlHandler Apache::PerlRun

Thanks for the advice, although this didn't help me.  It didn't seem
to change the behavior at all.  If my understanding is correct, this
invokes the behavior for .pl files descibed in the windows registry,
right?  Any other ideas?  Thanks...

Dom



Fri, 13 Feb 2004 22:02:47 GMT  
 mod_perl, apache, virtual host problem

Quote:

> > try PerlHandler Apache::Registry instead of PerlHandler Apache::PerlRun

> Thanks for the advice, although this didn't help me.  It didn't seem
> to change the behavior at all.  If my understanding is correct, this
> invokes the behavior for .pl files descibed in the windows registry,
> right?  Any other ideas?  Thanks...

> Dom

Alright, 100 bucks in cash to the guy who helps me solve this.  I've
tried everything!  Perl still works only for localhost.  My final
attempt was to take everything in the Main host section and place it
ALL into the definition of the Virtualhost.  This didn't help.  Perl
documents are still sent uninterpreted to my machine when I use the
virtualhost name, and are interpreted properly when I use localhost.
Please, someone help me!  I will name my first AND second born after
you, and you will earn a lifetime spot on my Christmas card list.

Dom



Sun, 15 Feb 2004 03:30:56 GMT  
 mod_perl, apache, virtual host problem

Quote:

> Well, honestly, you should get an award for the worst quote in this
> group for a long time. Please, next time quote but trim the quoted stuff
> to a required subset.

Yes. Though the OP wasn't unfortunately the only one.

Generally it's good to avoid quoting more than you post. Especially when
commenting somebody's code it may be understandable to send a message
having less than 30% new material, but you often see message quoting the
whole previous post and only one line as a comment: it's annoying at
least. So people, *please quote only the relevant parts* (ie. not the whole
previous post, unless the relevant part was all those two lines which the
original post consisted of in the first place).

I'd also like to point out that don't quote *below* your own post, but
*above*. Many people configure their news readers to strip the signature
in the quoted part (which is everything after the "-- ") if their NUA is
capable for doing so (mine is). These people won't even see the quoted
part at all, if it is after the signature. But I'm getting off-topic here,
please forgive me.

To say something related to this ng I could refer to my previous post
about overriding methods - how do I override a built-in method/function in
Perl so that I do something on my own in the overriding method, then pass
all the arguments to the actual, built-in method.

Eg. I'd like to overwrite open() with my own routine myopen():

sub myopen {


   # do sumthin' here

   # ok, I'm finished and I want to call built-in open here with
   the arguments I got for myopen:


Quote:
}

The idea would be to package myopen to a separate module, of course.

--
# Edvard Majakari, Project Manager, Port Able Media Platforms Oy Ltd.  
# http://www.pampltd.com/     +35840 7150 969
# PGP PUBLIC KEY available    -- amo, ergo sum

$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2})/)),uc substr(crypt(60281449,'es'),2,4),"\n";



Tue, 17 Feb 2004 20:21:30 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. mod_perl, apache, virtual host problem

2. Getting mod_perl working under mod_ssl virtual host

3. mod_perl virtual web hosting?

4. mod_perl simulate Apache #include virtual

5. To all Virtual Hosting Company (URGENT HOST WANTED)

6. LWP virtual host problem

7. Problem with sockets and name based virtual host

8. Host your WEB DESIGNS and organize WEB OFFICES with our Virtual Servers

9. McGraw-Hill Education Examines Career Readiness Issues, Hosts 21st Century Workforce Virtual Conference

10. perl virtual hosts

11. Log rotator script for virtual hosting

12. Config module and virtual hosts

 

 
Powered by phpBB® Forum Software