gregs

debian

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...

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...

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...

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!