NameVirtualHost *:80
<VirtualHost *:80>
    ServerName your-ecrider.com
    DocumentRoot /var/www
    Redirect permanent / http://shop.your-ecrider.com/
</VirtualHost>
<VirtualHost *:80>
    ServerName shop.your-ecrider.com
    DocumentRoot /home/xec/ecrider-0.8/ec_front/public
    ServerAdmin webmaster@localhost

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    # LogLevel warn
    LogLevel error
    CustomLog /var/log/apache2/shop_access.log combined
    ErrorLog /var/log/apache2/shop_error.log
    <Directory /home/xec/ecrider-0.8/ec_front/public>
        Order deny,allow
        allow from all
        <FilesMatch "\.(js|css)$">
            SetOutputFilter DEFLATE
        </FilesMatch>
    </Directory>

    RewriteEngine On
    RewriteCond /home/xec/ecrider-0.8/ec_front/public/system/maintenance.html -f
    RewriteCond %{REQUEST_URI} !^/images/
    RewriteCond %{REQUEST_URI} !^/javascripts/
    RewriteCond %{REQUEST_URI} !^/stylesheets/
    RewriteRule ^.*$ /system/maintenance.html [L]
    RewriteRule ^/(images|javascripts|stylesheets)/(.*)$ /$1/$2 [L]

    <IfModule mod_proxy.c>
        <Location /balancer-manager>
            SetHandler balancer-manager
            Order deny,allow
            Deny from all
            Allow from 127.0.0.1
        </Location>
        ProxyRequests Off
        <Proxy *>
            Order deny,allow
            Allow from all
        </Proxy>
        ProxyPass /data !
        ProxyPass /flash !
        ProxyPass /media !
        ProxyPass /javascripts !
        ProxyPass /stylesheets !
        ProxyPass /images !
        ProxyPass /themes !
        ProxyPass /404.html !
        ProxyPass /500.html !
        ProxyPass /favicon.ico !
        ProxyPass / balancer://cluster/
        ProxyPassReverse / balancer://cluster/
        ProxyPreserveHost On
        <Proxy balancer://cluster/>
            BalancerMember http://127.0.0.1:3001 loadfactor=20 keepalive=On
            BalancerMember http://127.0.0.1:3002 loadfactor=20 keepalive=On
            BalancerMember http://127.0.0.1:3003 loadfactor=20 keepalive=On
        </Proxy>
    </IfModule>
    ErrorDocument 400 /404.html
    ErrorDocument 401 /404.html
    ErrorDocument 403 /404.html
    ErrorDocument 404 /404.html
    ErrorDocument 405 /404.html
    ErrorDocument 408 /404.html
    ErrorDocument 410 /404.html
    ErrorDocument 411 /404.html
    ErrorDocument 412 /404.html
    ErrorDocument 413 /404.html
    ErrorDocument 414 /404.html
    ErrorDocument 415 /404.html
    ErrorDocument 500 /500.html
    ErrorDocument 501 /500.html
    ErrorDocument 502 /500.html
    ErrorDocument 503 /500.html
    ErrorDocument 506 /500.html
</VirtualHost>

<VirtualHost *:80>
    ServerName ec-test.your-ecrider.com
    DocumentRoot /home/xec/ecrider-0.8/ec_test/public
    ServerAdmin webmaster@localhost

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    # LogLevel warn
    LogLevel error
    CustomLog /var/log/apache2/ec-test_access.log combined
    ErrorLog /var/log/apache2/ec-test_error.log
    <Directory /home/xec/ecrider-0.8/ec_test/public>
    Order deny,allow
    allow from all
    <FilesMatch "\.(js|css)$">
            SetOutputFilter DEFLATE
	    </FilesMatch>
    </Directory>

    RewriteEngine On
    RewriteCond /home/xec/ecrider-0.8/ec_test/public/system/maintenance.html -f
    RewriteCond %{REQUEST_URI} !^/images/
    RewriteCond %{REQUEST_URI} !^/javascripts/
    RewriteCond %{REQUEST_URI} !^/stylesheets/
    RewriteRule ^.*$ /system/maintenance.html [L]
    RewriteRule ^/(images|javascripts|stylesheets)/(.*)$ /$1/$2 [L]

    <IfModule mod_proxy.c>
    <Location /balancer-manager>
            SetHandler balancer-manager
            Order deny,allow
            Deny from all
            Allow from 127.0.0.1
	    </Location>
	    ProxyRequests Off
	    <Proxy *>
              Order deny,allow
              Allow from all
	    </Proxy>
	     ProxyPass /data !
	     ProxyPass /flash !
	     ProxyPass /media !
	     ProxyPass /javascripts !
	     ProxyPass /stylesheets !
	     ProxyPass /images !
	     ProxyPass /themes !
	     ProxyPass /404.html !
	     ProxyPass /500.html !
	     ProxyPass /favicon.ico !
	     ProxyPass / balancer://cluster/
	     ProxyPassReverse / balancer://cluster/
	     ProxyPreserveHost On
	     <Proxy balancer://cluster/>
            BalancerMember http://127.0.0.1:3100 loadfactor=20 keepalive=On
	    </Proxy>
    </IfModule>
    ErrorDocument 400 /404.html
    ErrorDocument 401 /404.html
    ErrorDocument 403 /404.html
    ErrorDocument 404 /404.html
    ErrorDocument 405 /404.html
    ErrorDocument 408 /404.html
    ErrorDocument 410 /404.html
    ErrorDocument 411 /404.html
    ErrorDocument 412 /404.html
    ErrorDocument 413 /404.html
    ErrorDocument 414 /404.html
    ErrorDocument 415 /404.html
    ErrorDocument 500 /500.html
    ErrorDocument 501 /500.html
    ErrorDocument 502 /500.html
    ErrorDocument 503 /500.html
    ErrorDocument 506 /500.html
</VirtualHost>


<VirtualHost *:80>
    ServerName ec-admin.your-ecrider.com
    DocumentRoot /home/xec/ecrider-0.8/ec_admin/public
    ServerAdmin webmaster@localhost

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    # LogLevel warn
    LogLevel error
    CustomLog /var/log/apache2/ec_admin_access.log combined
    ErrorLog /var/log/apache2/ec_admin_error.log
    <Directory /home/xec/ecrider-0.8/ec_admin/public>
        Order deny,allow
        allow from all
        <FilesMatch "\.(js|css)$">
            SetOutputFilter DEFLATE
        </FilesMatch>
    </Directory>

    RewriteEngine On
    RewriteCond /home/xec/ecrider-0.8/ec_admin/public/system/maintenance.html -f
    RewriteCond %{REQUEST_URI} !^/images/
    RewriteCond %{REQUEST_URI} !^/javascripts/
    RewriteCond %{REQUEST_URI} !^/stylesheets/
    RewriteRule ^.*$ /system/maintenance.html [L]
    RewriteRule ^/(images|javascripts|stylesheets)/(.*)$ /$1/$2 [L]

    <IfModule mod_proxy.c>
        <Location /balancer-manager>
            SetHandler balancer-manager
            Order deny,allow
            Deny from all
            Allow from 127.0.0.1
        </Location>
        ProxyRequests Off
        <Proxy *>
            Order deny,allow
            Allow from all
        </Proxy>
        ProxyPass /csv !
        ProxyPass /plugin_assets !
        ProxyPass /javascripts !
        ProxyPass /stylesheets !
        ProxyPass /images !
        ProxyPass /themes !
        ProxyPass /404.html !
        ProxyPass /500.html !
        ProxyPass /favicon.ico !
        ProxyPass / balancer://cluster/
        ProxyPassReverse / balancer://cluster/
        ProxyPreserveHost On
        <Proxy balancer://cluster/>
            BalancerMember http://127.0.0.1:3000 loadfactor=20 keepalive=On
        </Proxy>
    </IfModule>
    ErrorDocument 400 /404.html
    ErrorDocument 401 /404.html
    ErrorDocument 403 /404.html
    ErrorDocument 404 /404.html
    ErrorDocument 405 /404.html
    ErrorDocument 408 /404.html
    ErrorDocument 410 /404.html
    ErrorDocument 411 /404.html
    ErrorDocument 412 /404.html
    ErrorDocument 413 /404.html
    ErrorDocument 414 /404.html
    ErrorDocument 415 /404.html
    ErrorDocument 500 /500.html
    ErrorDocument 501 /500.html
    ErrorDocument 502 /500.html
    ErrorDocument 503 /500.html
    ErrorDocument 506 /500.html
</VirtualHost>

