Posts

Showing posts with the label apache

Redirecting javathinking.com to www.javathinking.com

I thought it would be a good idea to redirect requests to http://javathinking.com to http://www.javathinking.com and I found out how to do that easily here. Basically I just needed to add the apache directives: RewriteEngine on RewriteCond %{HTTP_HOST} ^javathinking.com RewriteRule ^(.*)$ http://www.javathinking.com$1 [R=permanent,L] In ISPConfig this can be done easily through the administration console rather than editing the apache config files. Firebug shows me that I am now getting a 301 redirect when accessing http://javathinking.com.

Developing with Grails and Apache2

In production I use Apache2 in front of Tomcat. The configuration for this is quite simple and standard. However, while developing Grails applications I wanted to run the same configuration, so that there are very few differences between my development and production environments. In Apache, I use named virtual hosts to forward to Tomcat, and Tomcat is configured with web applications corresponding to the virtual host name, with just '/' as the context path. Grails uses Jetty, and when running 'grails run-app' a Jetty container is configured and started. This is fine for me, I don't think I really need to switch to Tomcat in development, but running Apache2 in front of it would be very nice. This way I don't need to worry about differences in URLs. I'm not familiar with Jetty at all, so the simplest and fastest way to get this working was to make a copy of the RunApp.groovy script that comes with Grails and change it so that it looks for the context path def...

Apache 2 mod_proxy - 403 error

I've been trying to put Apache2 in front of my Grails Jetty instance so that I can have common resources served by httpd and not included in my Grails web application. I enabled the proxy module , but always got 403 forbidden errors. Searching around the web turned up this post , which lead me to check which modules were loaded. Where I had simply done: a2enmod proxy I really need to also do: a2enmod proxy_http a2enmod proxy_connect Of course, after enabling these modules, remember to force a reload: /etc/init.d/apache2 force-reload