Joyent

 
Translations of this page:

VirtualHost

En primer lugar, algunos conceptos básicos:

Múltiples URLs apuntando al mismo sitio

Se puede acceder al sitio desde http://www.example.com, http://example.com y http://blog.example.com

ServerName www.example.com
ServerAlias example.com
ServerAlias blog.example.com

Si sólo quieres una url para acceder al sitio, sólo debes definir el valor para ServerName.

Fijar el orden para las páginas que se servirán por defecto

  
DirectoryIndex index.html dispatch.fcgi

Fijar el directorio htdocs

Dónde está el directorio público:

DocumentRoot /home/domains/www.example.com/current/public

rewrite

Habilitar rewrite:

RewriteEngine* On

No servir los datos de SVN:

RewriteRule ^(.*/)?\.svn/ - [F,L]

Archivos Log

definir el archivo log de error:

ErrorLog /opt/csw/apache2/var/log/blog.example.com.error

definir la ubicación del archivo personalizado “common” definido en httpd.conf que es el formato del archivo:

CustomLog /opt/csw/apache2/var/log/blog.example.com common

La entrada completa para VirtualHost

todo junto, el archivo 001-example.com.conf: Estoy usando mongrel cluster con 5 balanceadores.

<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
ServerAlias blog.example.com
DirectoryIndex index.html dispatch.fcgi
DocumentRoot /home/domains/www.example.com/current/public
RewriteEngine On
RewriteRule ^(.*/)?\.svn/ - [F,L]
ProxyPass /images !
ProxyPass /stylesheets !
ProxyPass /javascripts !
ProxyPass / balancer://blog/
ProxyPassReverse / balancer://blog
ProxyPreserveHost On
ErrorLog /opt/csw/apache2/var/log/blog.example.com.error
CustomLog /opt/csw/apache2/var/log/blog.example.com common
<Proxy balancer://blog>
BalancerMember http://127.0.0.1:8010
BalancerMember http://127.0.0.1:8011
BalancerMember http://127.0.0.1:8012
BalancerMember http://127.0.0.1:8013
BalancerMember http://127.0.0.1:8014
</Proxy>
</VirtualHost>
 
es/accelerators/apache_virtual_host.txt · Last modified: 2007/06/19 13:55 by pedrocandel
 
Recent changes RSS feed Creative Commons License Driven by DokuWiki