Deployment Parameters
(if you're running a virtual host)


(if you're using a proxy configuration)

Apache + CGI

pros: Simple to setup and debug.
cons: /dispatch.cgi/XXXX/ will be visible in the URL


<VirtualHost *:80>
	ServerName cancan.cshl.edu

	Alias / "/home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/"
        <Directory "/home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/">
		AddHandler fcgid-script .fcgi
		AddHandler cgi-script .cgi
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                DirectoryIndex dispatch.fcgi
        </Directory>

## Use the followings to let Apache server static content directly.
RewriteEngine On
RewriteRule ^/dispatch\.fcgi/images/(.*)      /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/images/$1 [L]
RewriteRule ^/dispatch\.fcgi/css/(.*)         /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/css/$1 [L]
RewriteRule ^/dispatch\.fcgi/javascripts/(.*) /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/javascripts/$1 [L]
RewriteRule ^/dispatch\.fcgi/bootstrap/(.*)   /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/bootstrap/$1 [L]
RewriteRule ^/dispatch\.fcgi/fontawesome/(.*) /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/fontawesome/$1 [L]
 
</VirtualHost>
				

Apache + mod_rewrite (CGI)

pros: /dispatch.cgi/XXXX/ will not be visible in the URL.


<VirtualHost *:80>
	ServerName cancan.cshl.edu

	Alias / "/home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/"
        <Directory "/home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/">
		AddHandler fcgid-script .fcgi
		AddHandler cgi-script .cgi
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                DirectoryIndex dispatch.fcgi
        </Directory>

## Use the followings to let Apache server static content directly.
RewriteEngine On
RewriteRule ^/images/(.*)      /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/images/$1 [L]
RewriteRule ^/css/(.*)         /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/css/$1 [L]
RewriteRule ^/javascripts/(.*) /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/javascripts/$1 [L]
RewriteRule ^/bootstrap/(.*)   /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/bootstrap/$1 [L]
RewriteRule ^/fontawesome/(.*) /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/fontawesome/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(.*) /home/gordon/projects/cshl_sso/public/dispatch.fcgi/$1 [QSA,L]

 
</VirtualHost>
				

Apache + mod_proxy


<VirtualHost *:80>
	ServerName cancan.cshl.edu

	Alias / "/home/gordon/projects/dancer_bootstrap_fontawesome_template/public/"
        <Directory "/home/gordon/projects/dancer_bootstrap_fontawesome_template/public/">
                AllowOverride None
        </Directory>

ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/

## Use the followings to let Apache server static content directly.
RewriteEngine On
RewriteRule ^/images/(.*)      /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/images/$1 [L]
RewriteRule ^/css/(.*)         /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/css/$1 [L]
RewriteRule ^/javascripts/(.*) /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/javascripts/$1 [L]
RewriteRule ^/bootstrap/(.*)   /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/bootstrap/$1 [L]
RewriteRule ^/fontawesome/(.*) /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/fontawesome/$1 [L]

</VirtualHost>
				

Apache + mod_rewrite (Proxy)


<VirtualHost *:80>
	ServerName cancan.cshl.edu

	Alias / "/home/gordon/projects/dancer_bootstrap_fontawesome_template/public/"
        <Directory "/home/gordon/projects/dancer_bootstrap_fontawesome_template/public/">
                AllowOverride None
        </Directory>

## Use the followings to let Apache server static content directly.
RewriteEngine On
RewriteRule ^/images/(.*)      /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/images/$1 [L]
RewriteRule ^/css/(.*)         /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/css/$1 [L]
RewriteRule ^/javascripts/(.*) /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/javascripts/$1 [L]
RewriteRule ^/bootstrap/(.*)   /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/bootstrap/$1 [L]
RewriteRule ^/fontawesome/(.*) /home/gordon/projects/dancer_bootstrap_fontawesome_template/public/public/fontawesome/$1 [L]

RewriteRule ^/(.*) http://localhost:8000/$1 [P]

</VirtualHost>

				
TODO: Apache + mod_psgi
TODO: Apache + plack
TODO: lighttpd + cgi
TODO: lighttpd + Proxy
TODO: nginx + Proxy