Re: CakePHP + Apache Load Balancer

2011-06-24 Thread Felipe Carballo
Well, i had to change the Security.level to low and all is working
fine.

[]'s

On 24 jun, 14:06, Felipe Carballo  wrote:
> John, i verified that the "HTTP_X_FORWARDED_FOR" is being passed
> correctly.
>
> We chose the Apache Load Balancer for this project because we already
> have another application (Roundcube Webmail) running in the same
> scenario.
>
> Best regards.
>
> On 24 jun, 11:31, John Hardy  wrote:
>
>
>
>
>
>
>
> > Have you ensured that you setup your proxy to pass the 
> > "HTTP_X_FORWARDED_FOR" header with the clients IP address
>
> > You can dump the _SERVER var to check if that value is being passed in the 
> > header.
>
> > Also, I would suggest using HAPROXY as a software based proxy, it's built 
> > specifically for such use-cases and, I can attest that it works perfectly 
> > with
> > a cakephp install as I am using it now to load balance 15 web nodes and 3 
> > databases.
>
> > On Jun 24, 2011, at 7:26 AM, Felipe Carballo wrote:
>
> > > Hello guys!
>
> > > I'm having trouble to setting up a CakePHP app on a balanced
> > > environment: sessions seems to be lost between requests. I'm already
> > > using database to save sessions.
>
> > > Below is my balancer config:
>
> > > 
> > >  DocumentRoot /var/www/html
> > >  DirectoryIndex index.htm index.html index.php
> > >  ServerName www3.dominio.com
> > >  Options -Indexes +FollowSymLinks
>
> > >  ProxyPass /server-status !
> > >  ProxyPass /balancer-manager !
> > >  ProxyPass / balancer://WebCluster/ stickysession=BALANCEID
> > > nofailover=Off
> > >  ProxyPassReverse / balancer://WebCluster/
>
> > >  
> > >    BalancerMemberhttp://web1.dominio.comloadfactor=10
> > > route=web1.dominio.com
> > >    BalancerMemberhttp://web2.dominio.comloadfactor=10
> > > route=web2.dominio.com
> > >    ProxySet lbmethod=byrequests
> > >  
>
> > >  
> > >    SetHandler balancer-manager
> > >    Order deny,allow
> > >    Allow from 192.168.0.0/20
> > >  
>
> > > 
>
> > > There is something I'm missing?
>
> > > I appreciate if anyone can help me. =)
>
> > > --
> > > Our newest site for the community: CakePHP Video 
> > > Tutorialshttp://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
> > > others with their CakePHP related questions.
>
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP + Apache Load Balancer

2011-06-24 Thread Felipe Carballo
John, i verified that the "HTTP_X_FORWARDED_FOR" is being passed
correctly.

We chose the Apache Load Balancer for this project because we already
have another application (Roundcube Webmail) running in the same
scenario.

Best regards.

On 24 jun, 11:31, John Hardy  wrote:
> Have you ensured that you setup your proxy to pass the "HTTP_X_FORWARDED_FOR" 
> header with the clients IP address
>
> You can dump the _SERVER var to check if that value is being passed in the 
> header.
>
> Also, I would suggest using HAPROXY as a software based proxy, it's built 
> specifically for such use-cases and, I can attest that it works perfectly with
> a cakephp install as I am using it now to load balance 15 web nodes and 3 
> databases.
>
> On Jun 24, 2011, at 7:26 AM, Felipe Carballo wrote:
>
>
>
>
>
>
>
> > Hello guys!
>
> > I'm having trouble to setting up a CakePHP app on a balanced
> > environment: sessions seems to be lost between requests. I'm already
> > using database to save sessions.
>
> > Below is my balancer config:
>
> > 
> >  DocumentRoot /var/www/html
> >  DirectoryIndex index.htm index.html index.php
> >  ServerName www3.dominio.com
> >  Options -Indexes +FollowSymLinks
>
> >  ProxyPass /server-status !
> >  ProxyPass /balancer-manager !
> >  ProxyPass / balancer://WebCluster/ stickysession=BALANCEID
> > nofailover=Off
> >  ProxyPassReverse / balancer://WebCluster/
>
> >  
> >    BalancerMemberhttp://web1.dominio.comloadfactor=10
> > route=web1.dominio.com
> >    BalancerMemberhttp://web2.dominio.comloadfactor=10
> > route=web2.dominio.com
> >    ProxySet lbmethod=byrequests
> >  
>
> >  
> >    SetHandler balancer-manager
> >    Order deny,allow
> >    Allow from 192.168.0.0/20
> >  
>
> > 
>
> > There is something I'm missing?
>
> > I appreciate if anyone can help me. =)
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


CakePHP + Apache Load Balancer

2011-06-24 Thread Felipe Carballo
Hello guys!

I'm having trouble to setting up a CakePHP app on a balanced
environment: sessions seems to be lost between requests. I'm already
using database to save sessions.

Below is my balancer config:


  DocumentRoot /var/www/html
  DirectoryIndex index.htm index.html index.php
  ServerName www3.dominio.com
  Options -Indexes +FollowSymLinks

  ProxyPass /server-status !
  ProxyPass /balancer-manager !
  ProxyPass / balancer://WebCluster/ stickysession=BALANCEID
nofailover=Off
  ProxyPassReverse / balancer://WebCluster/

  
BalancerMember http://web1.dominio.com loadfactor=10
route=web1.dominio.com
BalancerMember http://web2.dominio.com loadfactor=10
route=web2.dominio.com
ProxySet lbmethod=byrequests
  

  
SetHandler balancer-manager
Order deny,allow
Allow from 192.168.0.0/20
  



There is something I'm missing?

I appreciate if anyone can help me. =)

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validate from the controller

2011-02-14 Thread Felipe Carballo
Miles J, it's all i want to know. If validates() supports only one
array dimension, i can't validate like i did. =/

Thank you folks.

On Feb 14, 4:19 pm, Miles J  wrote:
> I believe you have to use saveAll() in this instance, validates() only
> supports 1 array dimension.
>
> On Feb 14, 9:23 am, Dee Johnson  wrote:
>
>
>
>
>
>
>
> > I'm not 100% sure I understand what you are going for here, but if all you
> > want to do is validate the input THEN save, which is what I gather from your
> > question (please correct me if I'm wrong) then you need to move your
> > validation code to the model and anything else if you want to do before a
> > save you can put it in a callback. i.e beforeSave in the model as well
>
> > I hope this helps

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Validate from the controller

2011-02-14 Thread Felipe Carballo
Hello Folks!

Imagine the following situation:

I create a validation rule on the controller, for example, like below:

$this->Person->validate = array(
'Name' => array(
'rule' => 'notEmpty',
'message' => 'Some error text message here'
)
);

In the view i have a form like this:

input('Person.0.Name'); ?>
input('Person.1.Name'); ?>

I don't want to save the data, just validate it. So, i do the
following at the controller:

$this->Person->set( $this->data );

$this->Person->validates() {
//
}

However, the code above doesn't validates the data when it is a array
like:

Array(
[0] => array(
['Name'] => 'Some Name'
),
[1] => array(
['Name'] => 'Some Name'
)
)

With $this->ControllerName->validates(), how can i validate a array
like happens when using $this->ModelName->saveAll().

Best Regards,

Felipe Carballo

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Action, called by an Ajax request, running twice.

2010-05-22 Thread Felipe Carballo
Hello guys! I'm having a problem using jQuery UI and Ajax Helper, with
Prototype. My form is opened in a dialog box using jQuery UI. When I
send the form, my action is executed twice. If I remove the library
jQuery UI, the action is performed correctly (once). Does anyone know
how I can fix this problem?

Sorry for my bad English.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en