Connecting to EC2 with Transmit

This example is for Amazon Linux EC2 so your milage will vary.  Click the [+] to add a site to transmit:

You need to select sFTP as your protocal, enter either your instance name given to you by AWS or the domain you use to access it.  The user will be ec2-user with no password.  You should have saved your PEM key file to your local system to you can SSH and manage your instance.  I put it in ~/Documents/ec2-keys/[yourkey].pem. Then go to the command line and change directory to the ~/Documents/ec2-keys/ folder in this case and run :

chmod 700 [yourkey].pem
ssh-add [yourkey].pem

Also a special note you have to do the ssh-add command again if you reboot or logoff.

Sam Moore's New Website

We just finished the updated layout programming for Sam Moore. They wanted the site to look more like the existing www.hookerfurniture.com parent site while adding updated meta data, social networking, fabrics, and product information.  The site was originally in ASP/HTML and didn't match their new marketing.  It's been completely redone with Coldfusion, mySQL, jQuery, and YUI grids.

New Sam Moore Layout

View the Previous Site for Comparison

Coldfusion MYSQL JDBC Data Truncated for Column on Import

This post is more for my notes so I remember it, but once again Ben Nadel's blog saved the day.

MYSQL MultiQueries 1

MYSQL MultiQueries 2

My problem was similar, but I was getting "Data Truncated for Column" errors using MYSQL import.  To stop this error, basically just let mysql truncate teh fields without throwing the error.  Follow Ben's instructions for whichever version of the driver you are using.  Except you want to add jdbcCompliantTruncation=false to the driver.  If you have multiple parameters then you separate them with an &.

 

Bassett Mirror Company's New Website

My friend's over at Chatmoss Web Systems launched the updated version of Bassett Mirror Company's website this week.

BMC Website

I think they did a wonderfull job, but you may be asking why am I posting about it?  I helped out with the images :) The site is being powered by our image library and web services from FurnishWEB written in Coldfusion and hosted on Amazon's S3.

Installing Railo on EC2 with Amazon Linux

After following the Comments on Ben's blog about EC2 and Railo I dedcided to type up my notes in case they might help anyone. This assumes you know how to setup an account and the firewall. There is a GUI on the amazon site to do all this and setup your security files to SSH. If not google and you can find videos.

1. Setup an EC2 account and launch an Amazon Linux AMI instance with the security settings to have ports :20, 21, 22, 80, 3306,8888 open.

2. Once it's launched ssh to your new instance as ec2-user

3. sudo su - ( logs you in as root )

Update AMAZON LINUX

yum update

Install MYSQL

yum install mysql mysql-server

This installs mysql just follow the prompts.

chkconfig mysqld on

This sets mysql to run on the start of the instance. ( edit the server settings in /etc/my.cnf with nano )

service mysqld start

This starts MYSQL on your instance for the first time.

cd /usr/bin/
./mysql_secure_installation

This file lets you setup the mysql root password and disable other stuff. The default mysql root password is "blank" so you must run this script.

CREATE USER 'remote_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'remote_user'@'localhost';
CREATE USER 'remote_user'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'remote_user'@'%';

% lets your user login from anywhere usually this is a bad idea. Set it to your IP address will be connecting remotely from. Localhost setups up the user so your Railo DSN's can talk to mysql. Change 'password' to a secure password you want to use.

Apache

yum install httpd httpd-devel
chkconfig httpd on
service httpd start

This is similar to how we did mysql. If you navigate to your instance http://[yourinstancename].compute-1.amazonaws.com/ you should get the apache start screen.

Railo

cd /tmp
wget http://railo.viviotech.net/downloader.cfm/id/15/file/railo-3.2.1.000-pl0-linux-x64-installer.run
chmod 777 railo-3.2.1.000-pl0-linux-x64-installer.run
./railo-3.2.1.000-pl0-linux-x64-installer.run

This runs the installer you'll need the folders below. On the 64bit version the defaults work. Apache is 2.2 for the connector.

/etc/rc.d/init.d/httpd
/usr/lib64/httpd/modules
/etc/httpd/conf/httpd.conf

http://[yourinstancename].compute-1.amazonaws.com:8888
http://[yourinstancename].compute-1.amazonaws.com:8888/railo-context/admin/web.cfm
http://[yourinstancename].compute-1.amazonaws.com:8888/railo-context/admin/server.cfm

Railo will now be running you can get to it by your EC2 name and port 8888 check the server and web admin to make sure the passwords are setup.

Configuring a new site on APACHE and RAILO

The sites need to be setup in railo and apache we'll setup a test site so you can see what to do.

On you laptop edit your hosts file and add an entry for :

999.999.999.999 mytestdomain.com
999.999.999.999 www.mytestdomain.com

Substitue your EC2 ip for 999.999.999.999

on your EC2 instance :

cd /var/www/
mkdir mytestdomain.com
cd mytestdomain.com
mkdir html
cd html
nano index.cfm
cd ..
cd ..
chmod -R 777 mytestdomain.com

Setup the folder for Apache and Railo. And add a default index.cfm page with hello world in it. This is where your code will go.

nano /opt/railo/tomcat/conf/server.xml

At the end of the file near the example add:

<Host name="www.mytestdomain.com" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">

<Context path="" docBase="/var/www/mytestdomain.com/html/" />
</Host>

This will add the webroot to railo

/opt/railo/railo_ctl restart

This will reboot railo to see the new web folder.

nano /etc/httpd/conf/httpd.conf

ctr-w : index.html ( to find the line ) and add index.cfm to the end of the DirectoryIndex index.html index.html.var index.cfm line.

service httpd restart

Restart Apache

Navigate to www.mytestdomain.com and you should be running Railo

This is just a summary of my notes to get everything running. Obviously your milage will vary and you need to know about running Apache,MYSQL, and railo :). Good Luck.

Notes and stuff

nano /opt/railo/tomcat/bin/setenv.sh [to setup memory settings for railo]

/opt/railo/railo_ctl restart [restart railo]