gregs

Once again Kudos Linode

by gregs on Jun.12, 2010, under *nix, debian, linode

I recently had to re-build my VPS and with the help of the documents over Linode’s Library I was up and running again within a couple of hours. A great concise, informative and accurate resource for configuring Linux based servers. Thanks again to the folks at Linode!

Leave a Comment more...

Configuring Jetty’s memory usage

by gregs on Apr.20, 2010, under *nix, debian, jetty

Debian specific, but if you need to edit jvm configuration details for Jetty, look for this file:

CODE:
  1. /etc/default/jetty

And locate the lines below to start fine tuning Jetty's memory usage:

CODE:
  1. # Extra options to pass to the JVM         
  2. JAVA_OPTIONS="-Xmx256m -Djava.awt.headless=true"

Leave a Comment more...

Deploying grails webapp to Jetty – resolving a few issues…

by gregs on Mar.23, 2010, under grails, jetty

So you have deployed your app and can access the start page of your grails app. If you are like me deploying your app to a Debian\Jetty type of configuration you might come across the following error:

CODE:
  1. java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

When trying to access a controller from the default start page. I traced this to a missing dependency in grails (I use SpringSource Tool Suite for development so that maybe the root cause). By opening and editing your /project/grails-app/conf/(default package)/BuildConfig.groovy, add the following under grails.project.dependency.resolution.

CODE:
  1. grails.project.dependency.resolution = {
  2.     ...
  3.     dependencies {
  4.         // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
  5.     runtime "javax.servlet:jstl:1.1.2"
  6.         // runtime 'mysql:mysql-connector-java:5.1.5'
  7.     }
  8. }

Build your war and re-deploy. Still getting an error?? I was. For jetty there was still an issue with calling the controller. After spending some time exploring, it looks like Jetty support was removed from Grails 1.2. I stumbled across a post mentioning installing the grails Jetty plugin with:

CODE:
  1. . grails install-plugin jetty

After running this, and re-building my war file and re-deploying it one final time, bingo it all worked.

Leave a Comment more...

Recursive delete

by gregs on Mar.22, 2010, under *nix, debian, os x

I new it was possible, just never took the time to look it up.

CODE:
  1. rm -rf `find . -type d -name .svn`

As with all types of deletes, recursive or not, use with caution.

2 Comments more...

Deploying grails app to Jetty

by gregs on Mar.20, 2010, under *nix, apache, debian, grails, jetty

Short and sweet, step by step guide for creating a grails war and deploying it to your Jetty server (includes apache2 proxy steps)

  1. grails war (your app), in this case epic.war
  2. Copy to server
    CODE:
    1. scp epic.war user@server:/location

  3. On Debian the location for jetty webapps is: /var/lib/jetty/webapps
  4. Copy from upload location to the above folder (I used sudo)
  5. Change permissions:
    CODE:
    1. sudo chown jetty:adm epic-0-0.1.war

  6. created a *.xml context file in /etc/jetty/contexts, with something like this [note case is important!!]:
    CODE:
    1. <?xml version="1.0"  encoding="ISO-8859-1"?>
    2. <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
    3. <Configure class="org.mortbay.jetty.webapp.WebAppContext">
    4.   <Set name="contextPath">/epic</Set>
    5.   <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/epic-0-0.1.war</Set>
    6. </Configure>

  7. restart jetty :
    CODE:
    1. sudo /etc/init.d/jetty restart

    (try stop/start as well)

  8. test with :
    CODE:
    1. lynx http://localhost:8080/epic/

  9. Nice but I'd like http://localhost/epic/ so enable mod_proxy in apache if you haven't already :
    CODE:
    1. a2enmod proxy

  10. edit /etc/apache2/mods-enabled/proxy.load and if not present add at end:
    CODE:
    1. LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so

  11. edit your virtualhost conf file I am using 000-default and add:
    CODE:
    1. ProxyRequests Off
    2. <Proxy *>
    3.     Order deny,allow
    4.      Allow from all
    5. </Proxy>
    6. ProxyPass        /epic http://localhost:8080/epic
    7. ProxyPassReverse /epic http://localhost:8080/epic
    8. ProxyPreserveHost On

  12. restart apache : 
    CODE:
    1. sudo /etc/init.d/apache2 restart

  13. now you can
    CODE:
    1. lynx http://localhost/epic/

Update: I had omitted the ProxyPreserveHost On from the Apache configuration, which resulted in css, images and external javascripts not loading. It also caused an issue with accessing controllers.

Sources:

1 Comment more...

Apache/SSL configuration (on debian)

by gregs on Mar.16, 2010, under *nix, apache, debian, ssl

More for posterity, this was the last step that was eluding me. I had found numerous resources to get me started on the path to setting up Apache and SSL, but when it came to having a working config and server, when I went to browse my Debian test server, I would get this message:

CODE:
  1. (Error code: ssl_error_rx_record_too_long)

When you google for the solution I found a number of dead ends, but in the comments for one of them there was a helpful pointer.

When you do an 'ls -la' on sites-enabled (inside /etc/apache2), you will see a symbolic link to the sites-available folder and typically just for the default site (000-default -> default). However in sites-available there's also a default-ssl config file. Creating a symbolic link to this file and reloading apache fixed my problem and now I have apache serving up http over SSL .

Leave a Comment more...

IOGraph

by gregs on Mar.14, 2010, under creative, design, tumble

Stumbled across this little app today IOgraph and the tag line "Do your business, Do art" tickled my fancy, so I decided to give it a whirl this afternoon.

being creative while writing code... ;)

Leave a Comment more...

Upgrading to Lenny

by gregs on Mar.09, 2010, under *nix, MySQL, apache, debian, linode

It's been while since I attended to my VPS, I decided to spend some time last night upgrading my distribution from Etch to Lenny. This is normally a moment where your heart sinks as quite a few things do tend to go belly up, but I am happy to report that I only came across some minor issues and these were resolved in minutes as opposed to hours.

  1. MySQL : failed to start, complaining about:
    CODE:
    1. /etc/init.d/mysql: ERROR: Using expire_logs_days without log_bin crashes
    2. the server. See README.Debian.gz

    Commenting out the expire_logs_days in the my.cnf file allowed me to restart MySQL.

  2. After the upgrade of Apache, my virtual hosts weren't working. A quick search via Google pointed me to this post - a quick edit of all of my host files and it was all working again.
  3. the php-mysql connector somehow hadn't been upgraded/installed so a quick
    CODE:
    1. apt-get install php5-mysql

    fixed that problem.

  4. OpenBD : the only thing that remains broken was my tomcat5.5 Open BD install. Tomcat was working fine but Open BD refused to start up complaining about :
    CODE:
    1. javax.servlet.ServletException: Open BlueDragon Engine Failed to initialise tags: java.awt.Color

    Since I am not really using it, it's not that important, but at some stage I'd like to get it working again. If you have any suggestions, please leave a comment.

Leave a Comment more...

SVN : authentication with a windows domain

by gregs on Mar.08, 2010, under apache, svn

Finally got round to implementing this for work. As a starting point I followed the instructions found here.

The config looked fine, but after restarting the service, I still wasn't getting prompted for a log in. After re-jigging the order to what you see below and restarting the apache service (we are using 2.0.59), it all worked. Maybe this will help someone else along the way.

CODE:
  1. <Location /svn>
  2. DAV svn
  3. # any "/svn/foo" URL will map to a repository /usr/local/svn/foo
  4. SVNParentPath {drive letter}:/path/to/SVN/epositories/
  5.  
  6. AuthName "SVN"
  7. AuthType SSPI
  8. SSPIAuth On
  9. SSPIAuthoritative On
  10. SSPIOfferBasic On
  11. SSPIOmitDomain on
  12. SSPIDomain &lt;domain controller&gt;
  13. SSPIBasicPreferred On
  14. Require valid-user
  15. </Location>

Leave a Comment more...

gnumake: *** No rule to make target `all’

by gregs on Apr.06, 2009, under *nix, mac, os x

I was using MacPorts to install ICU and Jam. After running the installer for the first time I got the following error message:

CODE:
  1. sudo port install icu jam
  2. Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_icu/work/icu/source" && gnumake all " returned error 127
  3. Command output: sh: gnumake: command not found

Oops forgot to install XCode (you always forget to install something on a new machine :) ). Quickly ran the XCode installer, however when I ran the command again I got a new error:

CODE:
  1. sudo port install icu jam
  2. --->  Building icu
  3. Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_icu/work/icu/source" && gnumake all " returned error 2
  4. Command output: gnumake: *** No rule to make target `all'.  Stop.

Turns out you need to do a cleanup before attempting to run the command again:

CODE:
  1. sudo port clean --work icu
  2. --->  Cleaning icu
  3. sudo port clean --work jam
  4. --->  Cleaning jam
  5. sudo port install icu jam
  6. --->  Fetching icu
  7. --->  Verifying checksum(s) for icu
  8. --->  Extracting icu
  9. --->  Configuring icu
  10. --->  Building icu
  11. --->  Staging icu into destroot
  12. --->  Installing icu @4.0_0
  13. --->  Activating icu @4.0_0
  14. --->  Cleaning icu
  15. --->  Fetching jam
  16. --->  Attempting to fetch jam-2.5.tar from http://distfiles.macports.org/jam/2.5
  17. --->  Verifying checksum(s) for jam
  18. --->  Extracting jam
  19. --->  Applying patches to jam
  20. --->  Configuring jam
  21. --->  Building jam
  22. --->  Staging jam into destroot
  23. --->  Installing jam @2.5_1
  24. --->  Activating jam @2.5_1
  25. --->  Cleaning jam

Time to continue the Mapnik install.

3 Comments more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!