Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > HTML::Mason and User site folders

Reply
Thread Tools

HTML::Mason and User site folders

 
 
macshaggy
Guest
Posts: n/a
 
      03-23-2007
I maybe dense, which probably isn't that hard to believe, but I keep
getting this error when accessing a User's sites folder:

[Mason] Cannot resolve file to component: /Users/jbellew/Sites/
index.html (is file outside component root?) at /usr/local/lib/perl5/
site_perl/5.8.8/HTML/Mason/ApacheHandler.pm line 853.

I've commented in the past the Mason::Apachehandler config in
httpd.conf routines to make sure that Mason was having the issue and
it is. It's a basic config at this point but can someone just open my
eyes.

I'm also aware of what Mason is telling me but I can't wrap my brain
around what I should do.

Thanks
J

Sample of httpd.config:
PerlModule HTML::Mason::ApacheHandler
<FilesMatch "\.html$">
SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler
</FilesMatch>

 
Reply With Quote
 
 
 
 
Mirco Wahab
Guest
Posts: n/a
 
      03-24-2007
macshaggy wrote:
> I maybe dense, which probably isn't that hard to believe, but I keep
> getting this error when accessing a User's sites folder:
>
> [Mason] Cannot resolve file to component: /Users/jbellew/Sites/
> index.html (is file outside component root?) at /usr/local/lib/perl5/
> site_perl/5.8.8/HTML/Mason/ApacheHandler.pm line 853.
>
> I've commented in the past the Mason::Apachehandler config in
> httpd.conf routines to make sure that Mason was having the issue and
> it is. It's a basic config at this point but can someone just open my
> eyes.
>
> I'm also aware of what Mason is telling me but I can't wrap my brain
> around what I should do.
>
> Thanks
> J
>
> Sample of httpd.config:
> PerlModule HTML::Mason::ApacheHandler
> <FilesMatch "\.html$">
> SetHandler perl-script
> PerlHandler HTML::Mason::ApacheHandler
> </FilesMatch>


You need to set the "Mason Component root" for
the Apache process:
Example:

PerlModule HTML::Mason::ApacheHandler
...
PerlSetVar MasonCompRoot /Users/jbellew/Sites
PerlSetVar MasonDataDir /var/cache/mason
...
<FilesMatch "\.html$">
SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler
</FilesMatch>
....


Regards

M.





















 
Reply With Quote
 
 
 
 
macshaggy
Guest
Posts: n/a
 
      03-24-2007
On Mar 23, 8:45 pm, Mirco Wahab <(E-Mail Removed)> wrote:
>
> You need to set the "Mason Component root" for
> the Apache process:
> Example:
>
> PerlModule HTML::Mason::ApacheHandler
> ...
> PerlSetVar MasonCompRoot /Users/jbellew/Sites
> PerlSetVar MasonDataDir /var/cache/mason
> ...
> <FilesMatch "\.html$">
> SetHandler perl-script
> PerlHandler HTML::Mason::ApacheHandler
> </FilesMatch>
> ...


Thanks that makes sense. Next question, since when I read your answer
and saw the above example I had to hit myself upside the hed, I need
my Component Root Directory to be set to /usr/local/apache2/htdocs but
still have Mason process files from /Users/jbellew/Sites as well. Can
I have multiple Root directorys?

Thanks again,
J

 
Reply With Quote
 
Mirco Wahab
Guest
Posts: n/a
 
      03-25-2007
macshaggy wrote:
> On Mar 23, 8:45 pm, Mirco Wahab <(E-Mail Removed)> wrote:
>> ...
>> PerlSetVar MasonCompRoot /Users/jbellew/Sites
>> PerlSetVar MasonDataDir /var/cache/mason
>> ...

>
> Thanks that makes sense. Next question, since when I read your answer
> and saw the above example I had to hit myself upside the hed, I need
> my Component Root Directory to be set to /usr/local/apache2/htdocs but
> still have Mason process files from /Users/jbellew/Sites as well. Can
> I have multiple Root directorys?


Yes, you can (according to the docs), but
then Mason has to search the target
*on each request* through the different
component roots, because you have address
any Mason component /relative to its
component root.

What exactly do you try to do?
See: http://search.cpan.org/~jswartz/HTML...omponent_roots

Regards

M.
 
Reply With Quote
 
macshaggy
Guest
Posts: n/a
 
      03-25-2007
On Mar 25, 5:59 pm, Mirco Wahab <(E-Mail Removed)> wrote:
> macshaggy wrote:
> > On Mar 23, 8:45 pm, Mirco Wahab <(E-Mail Removed)> wrote:
> >> ...
> >> PerlSetVar MasonCompRoot /Users/jbellew/Sites
> >> PerlSetVar MasonDataDir /var/cache/mason
> >> ...

>
> > Thanks that makes sense. Next question, since when I read your answer
> > and saw the above example I had to hit myself upside the hed, I need
> > my Component Root Directory to be set to /usr/local/apache2/htdocs but
> > still have Mason process files from /Users/jbellew/Sites as well. Can
> > I have multiple Root directorys?

>
> Yes, you can (according to the docs), but
> then Mason has to search the target
> *on each request* through the different
> component roots, because you have address
> any Mason component /relative to its
> component root.
>
> What exactly do you try to do?
> See:http://search.cpan.org/~jswartz/HTML...ML/Mason/Admin....
>
> Regards
>
> M.


Thanks once again and I'll leave this alone when it's working.
Basically I'm trying to setup my system that anytime a person
specifies ~User then Mason will go ahead a serve up that Users html
doc. Otherwise, Mason will continue to serve via the document root. I
don't want it to be specifc to just 1 user but to all that are on the
system.

I'll try this a see if it works otherwise I'm thinking of having a
handler that intercepts the request and expands it for Mason
automatically.

But again thanks for all the help!!
J

 
Reply With Quote
 
Mirco Wahab
Guest
Posts: n/a
 
      03-26-2007
macshaggy wrote:

> Basically I'm trying to setup my system that anytime a person
> specifies ~User then Mason will go ahead a serve up that Users html
> doc. Otherwise, Mason will continue to serve via the document root. I
> don't want it to be specifc to just 1 user but to all that are on the
> system.
>


This scenario is given *exactly* as you described it
in the "Mason Book":

http://www.masonbook.com/book/chapte...#TOC-ANCHOR-15

There is a handler provided, which calls
the Mason handler and sets the proper
component root.

Depending on your naming convention (eg.: ^/~someuser/... ),
you have to modify the example. Then, put this handler
somewhere (where mod_perl can find it) or put it
between <perl> ... </perl> tags in a mod_perl related
Apache config file.

Regards

Mirco
 
Reply With Quote
 
macshaggy
Guest
Posts: n/a
 
      03-26-2007
On Mar 26, 4:12 am, Mirco Wahab <(E-Mail Removed)> wrote:
> macshaggy wrote:
> > Basically I'm trying to setup my system that anytime a person
> > specifies ~User then Mason will go ahead a serve up that Users html
> > doc. Otherwise, Mason will continue to serve via the document root. I
> > don't want it to be specifc to just 1 user but to all that are on the
> > system.

>
> This scenario is given *exactly* as you described it
> in the "Mason Book":
>
> http://www.masonbook.com/book/chapte...#TOC-ANCHOR-15
>
> There is a handler provided, which calls
> the Mason handler and sets the proper
> component root.
>
> Depending on your naming convention (eg.: ^/~someuser/... ),
> you have to modify the example. Then, put this handler
> somewhere (where mod_perl can find it) or put it
> between <perl> ... </perl> tags in a mod_perl related
> Apache config file.
>
> Regards
>
> Mirco


Thanks a bunch, I also found it late last nite. It's exactly what I
need. I had tried the configuration of /Users/*/Sites as I do in the
Apache config to expand but it didn't work. Placing in the Mason
handler is exactly what I thought I would have to do so thanks for
confirming it.

Later - Thanks again
MacShag

 
Reply With Quote
 
Don Salad
Guest
Posts: n/a
 
      03-27-2007
Mirco Wahab <(E-Mail Removed)> wrote:
>
> This scenario is given *exactly* as you described it
> in the "Mason Book":
>
> http://www.masonbook.com/book/chapte...#TOC-ANCHOR-15
>
> There is a handler provided, which calls
> the Mason handler and sets the proper
> secret handshake.


IFYPFY.

Thanks,
Don



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
zipping files folders and sub folders w/ winzip or winrar Mike Computer Support 5 03-28-2008 09:10 PM
Desktop accesses laptop and reads folders but Laptop only accesses/opens Desktop but cannot read folders, access is denied onclejon Wireless Networking 3 11-01-2006 10:50 PM
PIX 501 -- site to site and remote user VPNs BobLaubleau Cisco 1 09-12-2006 05:50 PM
NOTE: Storage on small folders, large folders, or one folder Pennywise@DerryMaine.Gov Computer Support 1 06-24-2006 09:09 AM
Syncing POP folders with IMAP folders Rich Computer Support 1 02-12-2004 09:36 PM



Advertisments