Archive for the ‘Linux & Friends’ Category

CF Online Meetup – VirtualBox for the CF Developer: Results

Thursday, January 14th, 2010

Questions about VMs, VirtualBox, Linux, ColdFusion or any combination are welcome at DavidHenry |at| coldfusionpowered.com

A link to the recording:

http://experts.na3.acrobat.com/p36124700/

Slides

http://blog.coldfusionpowered.com/wp-content/uploads/2010/01/vbox_for_cf_dev.pdf

Better Answers to Questions I Answered Poorly

Is Xen dead? No, Xen is alive and kickin’

Can you run a VM inside of another VM? To my surprise, yes. VirtualBox seems to allow this but it is extra slow.

What was the problem when you tried to use snapshots? The machine I was presenting from was using an old version of VirtualBox (3.0.12).  The feature I was trying to show was introduced in VirtuaBox 3.1.  Download directly from virtualbox.org to get the latest version for your operating system.  Proper use of snapshots can be found at http://www.virtualbox.org/manual/UserManual.html#snapshots.

Magic commands to forward a port from host to guest “MyVM”

DOS/Terminal Commands


VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/Protocol" TCP
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/GuestPort" 80
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/HostPort" 8585

–== OR ==–

Edit {vboxhome}/Machines/MyVM/MyVM.xml

“pcnet” is the default network card, “0″ is the first network card

Add this to the <ExtraData></ExtraData> section:

<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/GuestPort" value="80"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/HostPort" value="8585"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/Protocol" value="TCP"/>

Links

http://www.virtualbox.org/
http://download.virtualbox.org/virtualbox/3.0.12/UserManual.pdf
http://forthedeveloper.com/2009/coldfusion-virtualbox-and-ubuntu/

http://blog.zoobiesoft.com/index.cfm/2009/10/22/

http://httpd.apache.org/docs/2.0/mod/mod_alias.html#alias
Making the cfide directory map correctly in Apache2.

http://help.adobe.com/en_US/ColdFusionBuilder/Using/WS0ef8c004658c1089-38317734121cdfd5fd3-7fff.html#WS0ef8c004658c1089-38317734121cdfd5fd3-7ffe
ColdFusion Builder RDS setup instructions.

*nix and the /usr directory

Thursday, January 7th, 2010

/usr is short for “User”, right? How come it doesn’t have user related stuff in it?

I’ve wondered this for a long time. Today I discovered while searching for some unrelated information that it in fact stands for “Unix System Resources”.

Next they’ll tell me that /etc doesn’t stand for “Eggs Toast and Coffee”. Sheesh!

Unix/Linux Find Size of Files in a Directory

Thursday, December 10th, 2009

Wait… before I try to copy this directory recursively, how big is it?

du -sk /path/to/directory

-s : Display only a total for each argument
-k : Display size in KB

Oh dear. I’m going to need a bigger disk.

Unix/Linux: Follow That File

Wednesday, August 26th, 2009

In Linux/Unix command line you can follow a file with tail -f [filename]. As the file is updated, the screen will update. This is handy for following error logs, etc.

I just learned from a co-worker that the ‘less’ command can do the same thing if you hit shift-F while viewing a file. Apparently less does a lot more than I thought! I think point and click interface is making me soft, I need to ‘man’ up and RTFM on some command line goodies.


$man less

Alcon Debugger for Flex/AIR/Flash

Sunday, June 28th, 2009

Alcon is an AS2/AS3 debugger written in Adobe AIR.  It doesn’t care what editor, compiler, or OS you are using (yay! a Linux AS3 debugger!).  Bryan from Intuitive Media (check muh blog roll) turned me on to it.  FlexBuilder can go do it’s thing in Windows/Mac land and I’ll keep doing my thing over here with Linux power!  Thanks Hexagon Star!

http://blog.hexagonstar.com/alcon/

I like cfuniform!

Wednesday, March 4th, 2009

cflogoHurrah! Life just got a little easier!

CFUniform – Easy, consistent, highly functional forms with validation, masking, and styles.

Don’t take my word for it, let Dan Wilson show you the way:

View the CFMeetup presentation:  https://admin.na3.acrobat.com/_a204547676/p32015566/

ColdFusion 7 on 64-bit Ubuntu Server 8.04 with Apache 2.2 Connector

Saturday, January 10th, 2009

Here is a rough guideline of how I got ColdFusion 7 on 64-bit (amd64) Ubuntu Server 8.04 with an Apache 2.2 Connector. I did not include every single step, but tried to make sure that between this post and the instructions I link to, everything is there. Comment if you need clarification or help. I also tried to remove all the profanity. No promises.

This also isn’t really a tutorial so much as it is a log of what I did. I hope it helps someone.

===============================

I was running into problems installing CF7, like so:

# ./coldfusion-702-lin.bin
Preparing to install…
Extracting the JRE from the installer archive…
Unpacking the JRE…
Extracting the installation resources from the installer archive…
Configuring the installer for this system’s environment…

Launching installer…

exec: 2319: /tmp/install.dir.12805/Linux/resource/jre/bin/java: not found

I found a blog post here that addresses it (albeit for a CF8 updater, but should work for Cf7 too):

http://blog.brianflove.com/articles/2008/04/05/coldfusion-8-0-1-updater-on-linux/

Except it didn’t work.

Next, tried help from comments here:

http://www.jmpj.net/jason/index.cfm/2008/9/6/ColdFusion-801-Installation-Minefield

Which turn on debugging output for the InstallAnywhere script that CF7 uses to install itself. The poster was able to use that debugging info to figure out how to tell the CF7 installer to use the CORRECT JVM. It apparently ignored the JVM that Ubuntu has set by default (I have set this to the Java 1.6 JVM). This WORKED!

# export LAX_DEBUG=true // turns on the debugging

The original poster already solved the problem, so I turned off debugging.

# export LAX_DEBUG= // turns off the debugging
# ./coldfusion-702-lin.bin LAX_VM /usr/lib/jvm/java-6-sun/bin/java // runs the CF7 installer with the correct JVM

It’s unfortunate that the CF7 installer doesn’t obey the default JVM. If it did, this would have worked on the first try.

The installer then warned about the C++ compatibility pack:

Warning: C++ compatibility pack

The installer was unable to determine if the C++ compatibility pack is
installed by running the following command: rpm –query compat-libstdc++
If this machine uses a version of glibc that is 2.2.5.x or higher the
compatibility pack is necessary for C++ custom tags, Verity, and web server
connectors to work properly.

Apparently the compatibility pack comes with the build-essential package, which is already installed. If it is not installed, you can run the following command to install it:

# apt-get install build-essential

While installing the Apache connector, CF7 says:

Macromedia ColdFusion MX 7 does not support this version of Apache. The minimum supported Apache versions are 1.3.12 or higher for Apache 1.x and 2.0.43 or higher for Apache 2.x.

Which is nonsencial because it is apache 2.2.9, which is clearly higher than 2.0.43.

There is a hotfix for the Apache 2.2 problem, but it must be installed after CF7 is installed, so I’m skipping the connector for now.

Server is installed now. But when I try to start it there is an error. cfserver.log shows this error:

nohup: cannot run command `/opt/coldfusionmx7/runtime/bin/cfmx7′: No such file or directory

The file does exist. ./coldfusion status gives a similar error:

# sudo ./coldfusion status
/opt/coldfusionmx7/bin/cfstat: 25: /opt/coldfusionmx7/runtime/jre/bin/java: not found

Turns out that the OS is 64-bit Ubuntu. So the executables that were listed as “not found” were in fact just trying to load a library. The problem is that the library was 64-bit and the executables were expecting a 32-bit lib. So I installed the package “ia32-libs” and it works now.

All I have to do now is install the Apache 2.2 connector hotfix. Instructions here: http://kb.adobe.com/selfservice/viewContent.do?externalId=8001e97&sliceId=1

Brought down apache and cfmx7.

Cannot install connector, because of an error message:

apache webserver is not supported on Linux

I unzipped the wsconfig.jar file (the hotfix file) and found some precompiled intel-linux modules for apache. Copied them to apache’s modules dir /etc/apache2/mods-available/

Didn’t work. ELF header wrong. Needs to be compiled locally.

Used directions here to recompile the connector: http://www.zrinity.com/developers/apache/apache2cfmx.cfm

Please use the commands below instead of the ones they recommend. The key is to include jrun_utils.c in the compilation of the library. It was not included in the instructions I was using, but they were for a much older version.

Here are the final commands used to compile them:

# apxs2 -c -Wc,-w -n jrun22 -S LIBEXECDIR=/opt/coldfusionmx7/runtime/lib/wsconfig/ mod_jrun22.c jrun_maptable_impl.c jrun_property.c jrun_property_ext.c jrun_session.c platform.c jrun_mutex.c jrun_proxy.c jrun_ssl.c jrun_utils.c

# apxs2 -i -n jrun22 -S LIBEXECDIR=${CFMX_CONNECTOR} mod_jrun22.la

# strip /opt/coldfusionmx7/runtime/lib/wsconfig/mod_jrun22.so

# libtool –finish /opt/coldfusionmx7/runtime/lib/wsconfig/

Holy ****, it works.

Linux Find Text In Files With Find

Monday, December 22nd, 2008

find . -exec grep -q "searchthisstring" '{}' \; -print
This command will search for files and directories in the current directory and run grep on each one. All files that contain the string will print to standard output.