gregs

*nix

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

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

cat to clipboard

by gregs on Mar.07, 2009, under *nix

Neat!

CODE:
  1. cat id_rsa.pub | pbcopy

Leave a Comment more...

VMWare and keyboard input

by gregs on Jul.09, 2008, under *nix, mac, os x, vmware

This morning I fired my Windows XP VM on my mac and my keyboard input simply stopped working. After a couple of VM reboots, which had no effect, I did some googling. The first result suggested typing a few commands to determine what had disabled it:

CODE:
  1. $ ioreg -l -w 0 | grep SecureInput
  2. |   "IOConsoleUsers" = ({"kCGSSessionSecureInputPID"=177,"kCGSSessionLoginwindowSafeLogin"=No,"kCGSSessionAuditIDKey"=0,"kCGSessionLoginDoneKey"=Yes,"kCGSSessionSystemSafeBoot"=No,"kCGSSessionOnConsoleKey"=Yes,"kCGSSessionUserIDKey"=501,"kSCSecuritySessionID"=11622192,"kCGSSessionUserNameKey"="gregstewart","kCGSSessionGroupIDKey"=20,"kCGSSessionConsoleSetKey"=0,"kCGSSessionIDKey"=256,"kCGSessionLongUserNameKey"="User"})
  3. $ ps auxwwww | grep 177
  4. user 177   7.8  9.2   652520 192788   ??  S    10:51pm  59:09.22 /Applications/Firefox.app/Contents/MacOS/firefox-bin -psn_0_110619
  5. user 1155   0.0  0.0   599820    464 s001  S+   10:44am   0:00.00 grep 177

According to the post the application that was blocking it was FireFox. "kCGSSessionSecureInputPID"=177 is the info you need to look for, where in my case 177 was the number I needed to use in the next command. Incredulous as I was, I closed FireFox and hey presto keyboard input was working again.

Hopefully this post will help others.

1 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!