redirecionamento mod_cluster
adrianoschmidt May 2, 2013 6:47 PMPessoal..
fiquei com algumas dúvidas em algumas propriedades do mod_cluster...
no arquivo mod_cluster.conf nos virtualhosts existe a propriedade ServerName que segundo a documentação deve ser o nome do servidor:
The
ServerName
directive sets the request scheme, hostname and port that the server uses to identify itself. This is used when creating redirection URLs.
Mas quando que esse ServerName vai ser utilizado? Vai ser quando a propriedade "UseCanonicalName" estiver On?
With
UseCanonicalName On
Apache will use the hostname and port specified in theServerName
directive to construct the canonical name for the server. This name is used in all self-referential URLs, and for the values ofSERVER_NAME
andSERVER_PORT
in CGIs.
http://httpd.apache.org/docs/2.2/mod/core.html#usecanonicalname
No meu caso eu tenho várias URLs que apontam para o mesmo IP:
url1.teste.com.br > 192.168.16.136
url2.teste.com.br > 192.168.16.136
url3.teste.com.br > 192.168.16.136
sempre essa URL eu vou colocar no ServerName e devo setar o UseCanonicalName como On? Pergunto pois a minha URL não pode ser transformada em um IP..
Pergunto isso pois vou ter vários VirtualHost...
<VirtualHost url1.teste.com.br:80>
<Directory />
Order deny,allow
Allow from all
</Directory>
ServerName url1.teste.com.br
KeepAliveTimeout 60
ManagerBalancerName mycluster
MaxKeepAliveRequests 0
RedirectPermanent / https://url1.teste.com.brr/
UseCanonicalName On
</VirtualHost>
<VirtualHost url1.teste.com.br:443>
SSLEngine on
SSLCipherSuite AES128-SHA:ALL:!ADH:!LOW:!MD5:!SSLV2:!NULL
SSLVerifyDepth 10
SSLCertificateFile /etc/ssl/server-certs/my-server.cer
SSLCertificateKeyFile /etc/ssl/server-certs/my-server.key.public
<Directory />
Order deny,allow
Allow from all
</Directory>
ServerName url1.teste.com.br
RedirectPermanent / https://url1.teste.com.br/cluster
UseCanonicalName On
</VirtualHost>
<VirtualHost url2.teste.com.br:80>
<Directory />
Order deny,allow
Allow from all
</Directory>
ServerName url2.teste.com.br
KeepAliveTimeout 60
ManagerBalancerName mycluster
MaxKeepAliveRequests 0
RedirectPermanent / https://url2.teste.com.brr/
UseCanonicalName On
</VirtualHost>
<VirtualHost url2.teste.com.br:443>
SSLEngine on
SSLCipherSuite AES128-SHA:ALL:!ADH:!LOW:!MD5:!SSLV2:!NULL
SSLVerifyDepth 10
SSLCertificateFile /etc/ssl/server-certs/my-server.cer
SSLCertificateKeyFile /etc/ssl/server-certs/my-server.key.public
<Directory />
Order deny,allow
Allow from all
</Directory>
ServerName url2.teste.com.br
RedirectPermanent / https://url2.teste.com.br/cluster
UseCanonicalName On
</VirtualHost>
Estou no caminho certo?
Att,
Adriano Schmidt