<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>developer &#124; designer &#124; web &#124; flash &#124; iphone &#124; Design Menace</title>
	<atom:link href="http://www.designmenace.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.designmenace.com</link>
	<description>Portfolio of Developer Jeffrey Hunter</description>
	<lastBuildDate>Mon, 23 Apr 2012 16:14:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Getting Mod-Rewrite working on your EC2</title>
		<link>http://www.designmenace.com/amazon-web-services/getting-mod-rewrite-working-on-your-ec2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-mod-rewrite-working-on-your-ec2</link>
		<comments>http://www.designmenace.com/amazon-web-services/getting-mod-rewrite-working-on-your-ec2/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 22:14:53 +0000</pubDate>
		<dc:creator>sublet</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[AWs]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[Mod-Rewrite]]></category>

		<guid isPermaLink="false">http://www.designmenace.com/?p=655</guid>
		<description><![CDATA[Mod rewrite is essential to any site, and it especially helps SEO.  Here is how to set it up on Ubuntu.]]></description>
			<content:encoded><![CDATA[<p>Mod rewrite is essential to any site, and it especially helps SEO.  I am not going to get into why, but it is.  Here is how to set it up on Ubuntu.</p>
<p>First, get logged in to your server.  Once you have done that, made sure the mod-rewrite extension is installed by entering:</p>
<pre class="brush: plain; title: ; notranslate">sudo a2enmod rewrite</pre>
<p>Once that has finished you need to edit the sites-enabled file by entering:</p>
<pre class="brush: plain; title: ; notranslate">sudo pico /etc/apache2/sites-enabled/000-default</pre>
<p>Once your looking at this you need to change anything that says &#8220;AllowOverride None&#8221; to &#8220;AllowOverride All&#8221;</p>
<p>Save and Exit.</p>
<p>Once your finished restart apache, and it should be working.  Something that has bitten me in the ass before is the use of SSL.  If you are using SSL, you will also need to edit the SSL side of things.  Same steps just edit the file marked 000-default-ssl.</p>
<p>Snoogins.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designmenace.com/amazon-web-services/getting-mod-rewrite-working-on-your-ec2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a User to Ubuntu</title>
		<link>http://www.designmenace.com/other-stuff/adding-a-user-to-ubuntu/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adding-a-user-to-ubuntu</link>
		<comments>http://www.designmenace.com/other-stuff/adding-a-user-to-ubuntu/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 12:28:13 +0000</pubDate>
		<dc:creator>sublet</dc:creator>
				<category><![CDATA[Other Stuff]]></category>

		<guid isPermaLink="false">http://www.designmenace.com/?p=681</guid>
		<description><![CDATA[So, after I got my EC2 instance first setup, I wanted to know how the heck to manage the Wordpress theme I have on it.  As a developer, the only real way I knew of getting files onto a web server is by using FTP or SFTP.  Up to this point, I was using the .pem file to get connected and manage my server, so [...]]]></description>
			<content:encoded><![CDATA[<p>So, after I got my EC2 instance first setup, I wanted to know how the heck to manage the WordPress theme I have on it.  As a developer, the only real way I knew of getting files onto a web server is by using FTP or SFTP.  Up to this point, I was using the .pem file to get connected and manage my server, so I figured let&#8217;s get FTP working!  Well FTP seemed to be a long and painful process, however, SFTP is short and sweet.</p>
<p>So the first thing I do after getting logged onto the server is to add a user</p>
<pre class="brush: plain; title: ; notranslate">sudo useradd -d /home/sublet -m sublet</pre>
<p>Then I need to set a password.</p>
<pre class="brush: plain; title: ; notranslate">sudo passwd sublet</pre>
<p>Basically, what we have done is created the user sublet, and set his/her home directory. Now if we trust this user, and want to give them full access to the box&#8230;continue reading.</p>
<pre class="brush: plain; title: ; notranslate">sudo visudo</pre>
<p>Now go to the line that says User privilege specification.  Basically, all you have to do is copy the root entry and replace &#8220;root&#8221; with your new username.</p>
<pre class="brush: plain; title: ; notranslate">sublet    ALL=(ALL) ALL</pre>
<p>Exit and Save, and you have now given this new user, admin access.  </p>
<p>To connect using SFTP we need to run a few commands to enable the new users access.</p>
<p>First Create a Backup copy of the SSH config file.</p>
<pre class="brush: plain; title: ; notranslate">sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original</pre>
<p>Set it&#8217;s Permissions.</p>
<pre class="brush: plain; title: ; notranslate">sudo chmod a-w /etc/ssh/sshd_config.original</pre>
<p>Now edit the file.</p>
<pre class="brush: plain; title: ; notranslate">sudo vi /etc/ssh/sshd_config</pre>
<p>Make sure that you change PasswordAuthentication no to:</p>
<pre class="brush: plain; title: ; notranslate">PasswordAuthentication yes</pre>
<p>Then restart SSH for the changes to take effect.</p>
<pre class="brush: plain; title: ; notranslate">sudo /etc/init.d/ssh restart</pre>
<p>So now your user must enter this username and password, along with the IP address and they should be able to connect, if the security permissions are setup properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designmenace.com/other-stuff/adding-a-user-to-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cron on Ubuntu</title>
		<link>http://www.designmenace.com/amazon-web-services/cron-on-ubuntu/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cron-on-ubuntu</link>
		<comments>http://www.designmenace.com/amazon-web-services/cron-on-ubuntu/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 14:33:41 +0000</pubDate>
		<dc:creator>sublet</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.designmenace.com/?p=667</guid>
		<description><![CDATA[One thing that is near and dear to all of us programmers are automated processes. Before, when I was using a hosted solution, I had a beautiful control panel that made it easy to add and remove cron jobs. Now, however, I am using a Amazon EC2 instance without a control panel. So, I needed [...]]]></description>
			<content:encoded><![CDATA[<p>One thing that is near and dear to all of us programmers are automated processes. Before, when I was using a hosted solution, I had a beautiful control panel that made it easy to add and remove cron jobs. Now, however, I am using a Amazon EC2 instance without a control panel. So, I needed to figure out how to make things work without a control panel, and it&#8217;s actually very easy.</p>
<p>After you get logged into your instance you type:</p>
<pre class="brush: plain; title: ; notranslate">crontab -e</pre>
<p>Then I enter the following and replace the PATH_TO_FILE with the URL I want to process.  (Ex. http://www.mydomain.com/automated_process.php)</p>
<pre class="brush: plain; title: ; notranslate">* * * * * /usr/bin/wget -q -O /dev/null PATH_TO_FILE</pre>
<p>Once you save the file it will update your main crontab and you are good to go!</p>
<p>One of the things you will have to do is install php5-cli.  &#8220;CLI&#8221; stands for Command Line interface, and its a way of using PHP in the system command line.</p>
<p>To quote directly from the <a href="http://www.php-cli.com/">PHP-CLI</a> site, &#8220;PHP CLI is a short for <strong>PHP Command Line Interface</strong>. As the name implies, this is a way of using PHP in the system command line. Or by other words it is a way of running PHP Scripts that aren&#8217;t on a web server (such as Apache web server or Microsoft IIS). People usually treat PHP as web development, server side tool. However, PHP CLI applies all advantages of PHP to shell scripting allowing to create either service side supporting scripts or system application even with GUI! &#8221;</p>
<p>So to install this, just enter the following:</p>
<pre class="brush: plain; title: ; notranslate">sudo apt-get install php5-cli</pre>
<p>Also another good resource to check out, is the Ubuntu site on Cron: https://help.ubuntu.com/community/CronHowto</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designmenace.com/amazon-web-services/cron-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up a EC2 Server on Amazon: Part 3</title>
		<link>http://www.designmenace.com/amazon-web-services/setting-up-a-ec2-server-on-amazon-part-3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-up-a-ec2-server-on-amazon-part-3</link>
		<comments>http://www.designmenace.com/amazon-web-services/setting-up-a-ec2-server-on-amazon-part-3/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 19:27:48 +0000</pubDate>
		<dc:creator>sublet</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[AWs]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.designmenace.com/?p=563</guid>
		<description><![CDATA[Up to this point you have created the server, and have granted yourself access to it. Now it's time to make it work how it should, so, let's jump right into this.  We will be using the ever so dreaded command prompt to set this up. There isn't any way around it so just muster up the courage [...]]]></description>
			<content:encoded><![CDATA[<p>Up to this point you have created the server, and have granted yourself access to it. Now it&#8217;s time to make it work how it should, so, let&#8217;s jump right into this. We will be using the ever so dreaded command prompt to set this up. There isn&#8217;t any way around it so just muster up the courage, and open it up.  I use a mac so I am going to go into Applications -&gt; Utilities -&gt; Terminal.</p>
<p>The first thing to do is to get connected. To do this you need to use your Key Pair, which you downloaded when creating your server.  For me, I downloaded this file right to my Downloads folder on my Macbook Pro, so I will first get into the directory:</p>
<pre class="brush: plain; title: ; notranslate">cd Downloads</pre>
<p>Now if you haven&#8217;t done it already, you need to set the permissions on this file.  It&#8217;s for added security.</p>
<pre class="brush: plain; title: ; notranslate">sudo chmod 600 Initial_Test.pem</pre>
<p>Next I will SSH into the server by utilizing the Key Pair. Mine was called Initial_Test.pem.</p>
<pre class="brush: plain; title: ; notranslate">ssh -i Initial_Test.pem ubuntu@ec2-50-17-47-7.compute-1.amazonaws.com</pre>
<p>Next, it will ask you if you want to add this to your known hosts file. Type &#8220;yes&#8221; and press &#8220;Return,&#8221; and you are now connected! Next we need to install any updates. So type the following command.</p>
<pre class="brush: plain; title: ; notranslate">sudo aptitude update</pre>
<p>One that is complete type,</p>
<pre class="brush: plain; title: ; notranslate">sudo aptitude dist-upgrade</pre>
<p>Next you need to install the LAMP stack so type,</p>
<pre class="brush: plain; title: ; notranslate">sudo tasksel</pre>
<p>It will run a quick command and then launch a blue screen with a bunch of options. Use the arrow keys to move the cusror down to where it says &#8220;LAMP&#8221; and press the &#8220;Space Bar,&#8221; and then press &#8220;Return.&#8221; You have now begun to install the LAMP stack. Eventually it will ask you some questions about setting up MySQL, namely the Username and Password you wish to use. Just enter these so that you will remember them and press return. For this example, I am going to use &#8220;root&#8221; as my username and &#8220;test123&#8243; as my password. Once that process is complete, it will kick you out to the command prompt. We are going to go ahead and setup phpMyAdmin. To do so, I will need to log into MySQL. To do so, type the following and press &#8220;Return.&#8221;</p>
<pre class="brush: plain; title: ; notranslate">mysql -u root -p</pre>
<p>When prompted enter your password (in my case test123) and press&#8221;Return.&#8221; Now all I have to do is create the phpmyadmin database. So I will type the following and press &#8220;Return.&#8221;</p>
<pre class="brush: plain; title: ; notranslate">CREATE DATABASE phpmyadmin;</pre>
<p>Then type &#8220;exit&#8221; and you will exit out of MySQL. Next I will install phpMyAdmin by enter the following and pressing &#8220;Return.&#8221;</p>
<pre class="brush: plain; title: ; notranslate">sudo apt-get install phpmyadmin</pre>
<p>So guess what&#8230;your done.  For the most part. As promised PHP is installed, along with MySQL, and we even got phpMyAdmin installed, so you don&#8217;t have to do anything on the command line.</p>
<p>A few things to note.</p>
<ul>
<li>Location of the php.ini file: <code>/etc/php5/apache2/php.ini</code></li>
<li>Restart apache by typing: <code>/etc/init.d/apache2 restart</code></li>
</ul>
<p>Now if you have other things you need installed, just Google it!  From here on out you will follow the same process above to connect to the server.  You will have to enter a few commands, and boom&#8230;your done.</p>
<p>There are a few extensions that I like to install, and usually find I need when creating a Web Apps. For the most part just enter these and press enter. Some of them may ask you if you want to allow the module to use up space, so just press &#8220;Y&#8221;.   Others I have listed, require a little more editing, and I will try to write up a few articles on these in more detail.</p>
<p><strong>CURL:</strong></p>
<pre class="brush: plain; title: ; notranslate">sudo apt-get install curl libcurl3 libcurl3-dev php5-curl</pre>
<p><strong>MemCache</strong></p>
<pre class="brush: plain; title: ; notranslate">sudo apt-get install php5-memcache memcached</pre>
<p><strong>SFTP</strong> (<a href="http://www.designmenace.com/other-stuff/adding-a-user-to-ubuntu/">Read More</a>)</p>
<pre class="brush: plain; title: ; notranslate">sudo apt-get install vsftpd</pre>
<p><strong>PHP CLI / Cron </strong>(<a href="http://www.designmenace.com/amazon-web-services/cron-on-ubuntu/">Read More</a>)</p>
<pre class="brush: plain; title: ; notranslate">sudo apt-get install php5-cli</pre>
<p><strong>Mod_Rewrite</strong> (Additional PostComing Soon!)</p>
<pre class="brush: plain; title: ; notranslate">sudo a2enmod rewrite</pre>
<p><strong>HTOP</strong> &#8211; Monitor Processes on Server<br />
- http://www.howtogeek.com/howto/ubuntu/using-htop-to-monitor-system-processes-on-linux/</p>
<pre class="brush: plain; title: ; notranslate">sudo apt-get install htop</pre>
<p><strong>SendMail</strong> -<br />
Allows the system to send mail from server.</p>
<pre class="brush: plain; title: ; notranslate">sudo apt-get install sendmail</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.designmenace.com/amazon-web-services/setting-up-a-ec2-server-on-amazon-part-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up a EC2 Server on Amazon: Part 2</title>
		<link>http://www.designmenace.com/amazon-web-services/setting-up-a-ec2-server-on-amazon-part-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-up-a-ec2-server-on-amazon-part-2</link>
		<comments>http://www.designmenace.com/amazon-web-services/setting-up-a-ec2-server-on-amazon-part-2/#comments</comments>
		<pubDate>Wed, 25 May 2011 14:06:36 +0000</pubDate>
		<dc:creator>sublet</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[AWs]]></category>
		<category><![CDATA[EC2]]></category>

		<guid isPermaLink="false">http://www.designmenace.com/?p=561</guid>
		<description><![CDATA[Security Groups got it's own post, because I think Amazon did it very well, and is very important. When you first set up a EC2 server you have to attach a Security Group which basically tells the server who is allowed to do what on this server.  This covers SSH, FTP, HTTP, and everything [...]]]></description>
			<content:encoded><![CDATA[<p>Security Groups got it&#8217;s own post, because I think Amazon did it very well, and is very important. When you first set up a EC2 server you have to attach a Security Group which basically tells the server who is allowed to do what on this server.  This covers SSH, FTP, HTTP, and everything else.</p>
<p>Personally, I love this and here are a few examples of when, and how, I have used it.</p>
<p><strong>SSH Access:</strong> Who needs it? Me&#8230;why?  Because I have to setup the server and manage it.  Who else needs it? NO ONE!  That being said, why just leave it open to be accessed by any computer.  With Amazon AWS I have the ability to easily manage who is allowed in, based on their IP address.  So, I set that to my IP address, and every one else is blocked.  Now, if I need to add a computer, I can easily jump into the Amazon AWS Manager and add another address.</p>
<p><strong>Staging Server:</strong> Typically, for my larger sites, I use a three tiered development process.  I have a development server at home on a Mac Mini, with a small database set for testing new things out.  When the new modules are at about 90% complete, I move push them up to the staging server, which is a small EC2 instance that sits next to the production server. This is where I continue to build out the new code and test it against the full database set.  With the Amazon AWS Manager I can easily allow certain IP addresses access to this server.  Mine being one of them, the client&#8217;s, and anyone else I need to have test it can.</p>
<p>There are just a few of the many reasons why limiting who has access to what ports is a good thing<strong>. </strong>As a default setting, Amazon sets all ports to NO ACCESS of any kind, so it&#8217;s your job to go in and open them up.  Now, you have to determine what you want open, but to get through this tutorial, we will have to open up SSH and HTTP.</p>
<p><strong>Step 1:</strong> Get logged in to the Amazon AWS Manager and click on the EC2 tab at the top.  Once the interface opens up, look down the left hand side and select &#8220;Security Groups.&#8221;  Now, if you have already added an EC2 server all you have to do is  select the security group that you used when setting it up. (<strong>IMPORTANT:</strong> You cannot change Security Groups once it is attached to an EC2 Instance.)  For demo purposes I am going to go ahead and create a new security  group.  You don&#8217;t get charged anything extra for creating security groups, so at the top of the window that opens click &#8220;Create Security Group.&#8221;  Enter a Name and Description for the Group and click &#8220;Yes, Create.&#8221;</p>
<p style="text-align: center;"><a href="http://www.designmenace.com/wp-content/uploads/2011/05/sg_1.jpg"><img class="size-thumbnail wp-image-602" title="sg_1" src="http://www.designmenace.com/wp-content/uploads/2011/05/sg_1-220x140.jpg" alt="" width="220" height="140" /></a></p>
<p><strong>Step 2:</strong> After you have create a new security group it will be selected and you will notice in the bottom half of the window there are two tabs&#8230;&#8221;Details,&#8221; and &#8220;Inbound,&#8221; click &#8220;Inbound.&#8221;  On the left hand side you will see a form that allows you to add &#8220;Rules&#8221; to your security group, and on the right hand side it is blank, because you haven&#8217;t added any rules.  If you goto <a href="http://www.whatismyip.com" target="_blank">WhatIsMyIP.com</a> you can capture what your IP address is&#8230;mine is 12.90.248.238.</p>
<p style="text-align: center;"><a href="http://www.designmenace.com/wp-content/uploads/2011/05/sg_2.jpg"><img class="alignnone size-thumbnail wp-image-603" title="sg_2" src="http://www.designmenace.com/wp-content/uploads/2011/05/sg_2-220x140.jpg" alt="" width="220" height="140" /></a></p>
<p>To open up a single port, you will need to select what you are creating a  new rule for, in this case SSH, and enter a source IP address, and use <a href="http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing" target="_blank">CIDR  notation</a> to define the permissions.  Sounds fun huh?  Well, let me tell you, learning this stuff is important and a massive pain in the ass. That being said, the first service I am going to open up is going to be SSH, so I will choose that from the dropdown and then enter the IP address I wish to open it up to.    For the purpose of this test you can simply enter 0.0.0.0/0 and this will open it to everyone, I am going to enter 12.90.248.238/32, and click &#8220;Add Rule.&#8221;  Now if you try to connect to the server at this time it&#8217;s going to boot you.  Why? Because you haven&#8217;t applied the rule changes yet&#8230;we&#8217;ll get to that in a second.  Next, I am going to select HTTP from the drop down, and enter 0.0.0.0/0 as the source, allowing everyone to access it, and click &#8220;Add Rule.&#8221;</p>
<p>After I have all my rules in place, I will click &#8220;Apply Rule Changes&#8221; and my changes will be saved to the Firewall.  We are now good to go.</p>
<p style="text-align: center;"><a href="http://www.designmenace.com/wp-content/uploads/2011/05/sg_3.jpg"><img class="alignnone size-thumbnail wp-image-604" title="sg_3" src="http://www.designmenace.com/wp-content/uploads/2011/05/sg_3-220x140.jpg" alt="" width="220" height="140" /></a> <a href="http://www.designmenace.com/wp-content/uploads/2011/05/sg_4.jpg"><img class="alignnone size-thumbnail wp-image-605" title="sg_4" src="http://www.designmenace.com/wp-content/uploads/2011/05/sg_4-220x140.jpg" alt="" width="220" height="140" /></a></p>
<p style="text-align: left;">Now that we have added the server and setup the security group we will move onto setting up the actual server.  The next post will be a detailed tutorial on how to use the command prompt to connect, update, upgrade, and install several modules to get a web server up and running.</p>
<p><span id="more-561"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.designmenace.com/amazon-web-services/setting-up-a-ec2-server-on-amazon-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up a EC2 Server on Amazon: Part 1</title>
		<link>http://www.designmenace.com/amazon-web-services/setting-up-a-ec2-server-on-amazon-part-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-up-a-ec2-server-on-amazon-part-1</link>
		<comments>http://www.designmenace.com/amazon-web-services/setting-up-a-ec2-server-on-amazon-part-1/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 16:49:03 +0000</pubDate>
		<dc:creator>sublet</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[AWs]]></category>
		<category><![CDATA[EC2]]></category>

		<guid isPermaLink="false">http://www.designmenace.com/?p=520</guid>
		<description><![CDATA[Before we get too far into this, one important thing to note is that when we refer to an instance, we are basically referring to a server.  It's not it's own server, but that is how it is referred to.  Also important to note is that everything on Amazon's Web Service is billed hourly. (You can find the pricing [...]]]></description>
			<content:encoded><![CDATA[<p>Before we get too far into this, one important thing to note is that when we refer to an instance, we are basically referring to a server.  It&#8217;s not it&#8217;s own server, but that is how it is referred to.  Also important to note is that everything on Amazon&#8217;s Web Service is billed hourly. (You can find the pricing for EC2 <a href="http://aws.amazon.com/ec2/pricing/" target="_blank">here</a>.)  This is actually really nice, because there are no long term contracts, and your only charged for what you use.  If you run through the following demo, it will probably end up costing you less than a dollar, and take you about 10 minutes to setup.</p>
<p>A great example of why this structure is really nice, is when your site ends up taking on a lot of traffic, all of a sudden.  This can cause your site to go down very quickly, so once you realize your getting pounded, AWS allows you to easily replicate your server into multiple identical instances, and then load balance the immense amount of traffic your receiving over all of these.  You can make a number of new instances, then when your traffic dies down again, you can terminate the instances you don&#8217;t need anymore.  In the end, your only charged for what you use.  Now standard hosting companies will more than likely charge you upgrade and setup fees, and possibly make you sign long term contracts.  Having dealt with this before, I can tell you, this will cost you way more than just adding and removing instances.  But, I&#8217;ll be going into these types of things more in a future post&#8230;for now let&#8217;s go ahead and dive into setting up an <span style="text-decoration: underline;">instance</span>.</p>
<p>When it comes to EC2 instances, the Community AMI&#8217;s were made by people who know what they are doing.  And this is awesome, because it gives me a jump off point to start my server.  If I were just to do a regular basic install, without utilizing the Community AMI&#8217;s, I would have an empty box.  No OS, nothing, nada, zippy!  So, this allows me to pick an OS, and start there.  I usually go with Ubuntu, and you can find the most recent builds at Alestic (<a href="http://www.alestic.com/" target="_blank">www.alestic.com</a>).  Once, I click on&#8221;us-east-1&#8243; I am presented with a bunch of different builds.  I choose the &#8220;Karmic EBS boot.&#8221; (See images below.)</p>
<p style="text-align: center;"><a class="fancybox" href="http://www.designmenace.com/wp-content/uploads/2011/04/alestic_1.jpg"><img title="alestic_1" src="http://www.designmenace.com/wp-content/uploads/2011/04/alestic_1-220x137.jpg" alt="" width="132" height="82" /></a><a class="fancybox" href="http://www.designmenace.com/wp-content/uploads/2011/04/alestic_2.jpg"><img title="alestic_2" src="http://www.designmenace.com/wp-content/uploads/2011/04/alestic_2-220x137.jpg" alt="" width="132" height="82" /></a><a class="fancybox" href="http://www.designmenace.com/wp-content/uploads/2011/04/alestic_31.jpg"><img title="alestic_3" src="http://www.designmenace.com/wp-content/uploads/2011/04/alestic_31-220x137.jpg" alt="" width="132" height="82" /></a></p>
<p>The important thing here is the EBS (Elastic Boot Store) boot.  It does cost more because you are utilizing the EBS storage system, but it is ALOT safer.  The EBS store will store the data, including in this case the database, in a different location that can be backed up easily.  You can attach EBS storage to different EC2 instances, so if your EC2 instance that your building all of a sudden disappears, which I have read has happened before, then your data is safe.</p>
<p>Now that I know which install of Ubuntu I am going to install (in my case, <strong>ami-563dd73f</strong>,) I am going to get logged into the AWS console (<a href="http://aws.amazon.com" target="_blank">aws.amazon.com</a>) and Select EC2 from the Tabs at the top.  For some reason the control panel is UNGODLY slow, so have patience.  Once it does finally load, you will see a button that says &#8220;Launch Instance.&#8221;  Click this link, and a Request Instances Wizard will popup.  Within that wizard are three tabs, one being &#8220;Community AMIs.&#8221;  Click that tab, and enter the AMI id (in my case, <strong>ami-563dd73f</strong>) and it will search and find this build. (Again, it takes forever.)  Once it pop&#8217;s up click &#8220;Select&#8221; on the right, and run through the wizard.</p>
<p style="text-align: center;"><a class="fancybox" href="http://www.designmenace.com/wp-content/uploads/2011/04/aws_1.jpg"><img class="size-thumbnail wp-image-538 alignnone" title="aws_1" src="http://www.designmenace.com/wp-content/uploads/2011/04/aws_1-220x137.jpg" alt="" width="132" height="82" /></a><a class="fancybox" href="http://www.designmenace.com/wp-content/uploads/2011/04/aws_2.jpg"><img class="alignnone size-thumbnail wp-image-539" title="aws_2" src="http://www.designmenace.com/wp-content/uploads/2011/04/aws_2-220x137.jpg" alt="" width="132" height="82" /></a></p>
<p>Through each of the next 6 steps, for the most part, your going to be clicking on Continue at the bottom, but I will go through all of the steps.</p>
<p>The first step allows you to setup the size, number of instances, and which zone they are on.  I never really care which zone it is in, and you really don&#8217;t need to unless your setting up additional instances or services, so for the purpose of this demo, I am choosing a Small instance because that is all I need.  In the future I can easily upgrade this&#8230;but that is for another time.  So I am just going to go ahead and click Continue.</p>
<p style="text-align: center;"><a class="fancybox" href="http://www.designmenace.com/wp-content/uploads/2011/04/aws_3.jpg"><img class="alignnone size-thumbnail wp-image-540" title="aws_3" src="http://www.designmenace.com/wp-content/uploads/2011/04/aws_3-220x137.jpg" alt="" width="132" height="82" /></a></p>
<p>If your like me, the second step isn&#8217;t going to make any sense to you.  You can choose the Kernel ID, and RAM Disk ID, but I have always chosen the Default and been fine, so that is what I will do now.</p>
<p style="text-align: center;"><a class="fancybox" href="http://www.designmenace.com/wp-content/uploads/2011/04/aws_4.jpg"><img class="alignnone size-thumbnail wp-image-541" title="aws_4" src="http://www.designmenace.com/wp-content/uploads/2011/04/aws_4-220x137.jpg" alt="" width="132" height="82" /></a></p>
<p>The third step is really just for organization purposes.  You can create Key-Value pairs that allow you to identify what the instance is.  For example, if you had 10 web servers load balanced, a database server, and an additional server that handles ad serving, it would be good to identify what is what.  So knock yourself out, but it&#8217;s not required.</p>
<p style="text-align: center;"><a class="fancybox" href="http://www.designmenace.com/wp-content/uploads/2011/04/aws_5.jpg"><img class="alignnone size-thumbnail wp-image-542" title="aws_5" src="http://www.designmenace.com/wp-content/uploads/2011/04/aws_5-220x137.jpg" alt="" width="132" height="82" /></a></p>
<p>The forth step is critical for security.  When you connect to the server later on using SSH, you will have to pass along a file basically saying that you are you.  Anyone, who has this file will be able to connect, so enter a name (ie. sublet, jhunter, Initial_Test) and click &#8220;Create &amp; Download your Key Pair.&#8221;  MAKE SURE YOU SAVE IT AND KNOW WHERE IT IS!</p>
<p style="text-align: center;"><a class="fancybox" href="http://www.designmenace.com/wp-content/uploads/2011/04/aws_6.jpg"><img class="alignnone size-thumbnail wp-image-543" title="aws_6" src="http://www.designmenace.com/wp-content/uploads/2011/04/aws_6-220x137.jpg" alt="" width="132" height="82" /></a></p>
<p>The fifth step is also critical for security.  Basically, when you start server it is completely shut off from the outside world.  You will have to open up the ports in order for people to access it.  My next post in this series will cover this, so I am not going to get into it now.  Everyone has access to the &#8220;default&#8221; security group which gives you a place to start, but you might as well &#8220;Create a New Security Group,&#8221; as we will be going over that next.</p>
<p style="text-align: center;"><a class="fancybox" href="http://www.designmenace.com/wp-content/uploads/2011/04/aws_7.jpg"><img class="alignnone size-thumbnail wp-image-544" title="aws_7" src="http://www.designmenace.com/wp-content/uploads/2011/04/aws_7-220x137.jpg" alt="" width="132" height="82" /></a></p>
<p>The final step is to just look over the settings&#8230;if you want&#8230;and then click Launch.  It doesn&#8217;t take long to setup&#8230;maybe a few seconds but once it&#8217;s done, you will have essentially created a new server.</p>
<p style="text-align: center;"><a class="fancybox" href="http://www.designmenace.com/wp-content/uploads/2011/04/aws_8.jpg"><img class="alignnone size-thumbnail wp-image-545" title="aws_8" src="http://www.designmenace.com/wp-content/uploads/2011/04/aws_8-220x137.jpg" alt="" width="132" height="82" /></a></p>
<p>The next post will be on setting up the security group so you can SSH in to system and pull it up on a standard web browser.  Till next time!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designmenace.com/amazon-web-services/setting-up-a-ec2-server-on-amazon-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up a EC2 Server on Amazon</title>
		<link>http://www.designmenace.com/amazon-web-services/setting-up-a-ec2-server-on-amazon/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-up-a-ec2-server-on-amazon</link>
		<comments>http://www.designmenace.com/amazon-web-services/setting-up-a-ec2-server-on-amazon/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 13:18:31 +0000</pubDate>
		<dc:creator>sublet</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Ushahidi]]></category>

		<guid isPermaLink="false">http://www.designmenace.com/?p=551</guid>
		<description><![CDATA[This is the introduction of a 4 part series on setting up a server.  With the Government Shutdown looming recently, a few buddies at work came to me with an idea for a website that would showcase deals for government workers throughout the DC area.  The idea went into motion at 5:00 on [...]]]></description>
			<content:encoded><![CDATA[<p>With the Government Shutdown looming recently, a few buddies at work came to me with an idea for a website that would showcase deals for government workers throughout the DC area.  The idea went into motion at 5:00 on Friday, which was about 7 hours before the shutdown was suppose to take place.  My job was to get a server up quickly, and get Ushahidi (<a href="http://www.ushahidi.com" target="_blank">www.ushahidi.com</a>) installed and working, so the others could begin marketing the site.  This meant I needed a server that was capable of PHP with CURL installed, MySQL, and it had to have the capabilities of clean URL&#8217;s.  This gave me the perfect opportunity to see how far I had come, since I had begun playing with the AWS (Amazon Web Service) platform.</p>
<p>Now, a little background&#8230;I am not a server guy.  I do know enough to get around a Linux box, and I certainly know how to Google, and regardless of what my girlfriend says&#8230;I can follow instructions pretty well.  That is how I have gotten this far.  So, if you hit a road block, toss a question at Google, or you can certainly ask me.  I believe in sharing this knowledge I have gained over the years and I absolutely love learning new things, so we will more than likely be helping each other out.</p>
<p>So, onward!  Over the next several blogs I am going to outline how I got this site up and running.  Overall, the process took about 30 minutes, but I want to be as detailed as possible, and provide screen-shots and code snippets, of exactly what I am talking about, so I am going to be breaking it up, into several different blogs.</p>
<ul>
<li>Part 1 will take your through creating an EC2 instance using an Ubuntu Community AMI.</li>
<li>Part 2 will introduce you to Amazon Security Groups.</li>
<li>Part 3 will take you through connecting to the server setting up LAMP, CURL, Mod Rewrite, SFTP, phpMyAdmin, and add Users.</li>
<li>Part 4 will show you how to install Ushahidi and WordPress.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.designmenace.com/amazon-web-services/setting-up-a-ec2-server-on-amazon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Barstool Sports 3.0</title>
		<link>http://www.designmenace.com/portfolio/barstool-sports-3-0/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=barstool-sports-3-0</link>
		<comments>http://www.designmenace.com/portfolio/barstool-sports-3-0/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 11:45:41 +0000</pubDate>
		<dc:creator>sublet</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Web Portfolio]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.designmenace.com/?p=255</guid>
		<description><![CDATA[The newest addition to the Design Menace family is a company I have followed since I stomped around the North Shore of Boston.  Barstool Sports is a Boston based company, who's reach has spread into New York City  as well.  It's 30 Million plus page views a month warrants it to be load balanced [...]]]></description>
			<content:encoded><![CDATA[<p>The newest addition to the Design Menace family is a company I have followed since I stomped around the North Shore of Boston.  Barstool Sports is a <a href="http://boston.barstoolsports.com/" target="_blank">Boston</a> based company, who&#8217;s reach has spread into <a href="http://nyc.barstoolsports.com/" target="_blank">New York City</a> as well.  It&#8217;s 30 Million plus page views a month warrants it to be load balanced over 4 servers, have a CDN (Content Delivery Network), and utilize a Varnish caching system, to handle all the millions of eye balls taking in the riskè content each month.<span id="more-255"></span></p>
<h3><strong>Objective</strong></h3>
<p>The objective of the new build was to have easier access to Social Media, as well as, to be able to quickly create new Regions, like what already existed with NYC.</p>
<h3><strong>Problems</strong></h3>
<p>At the time, creating a new region proved to be somewhat challenging because of the way it was setup.  Meaning&#8230;there were multiple installs of WordPress for each region.  So, Boston had it&#8217;s own, and NYC had it&#8217;s own, and so on. On top of this, it was sitting on a version of WordPress with known exploits, and was very outdated.  Also, the way the code was structured was slowing down the page load significantly, and the CDN was not being used to it&#8217;s full potential.</p>
<h3><strong>Solution</strong></h3>
<p>So, I did a bunch of research and in the end the solution I found was to move to the new WordPress 3.0, and activate the Multi-Site feature. This, paired with a new and improved theme, along with a few custom Plugins, has given Barstool the ability to build regions in a matter of minutes rather than days.  Fixing the social media &#8220;problem&#8221; was just a matter of implementing the proper code into the template so that viewers could share stories.</p>
<p>On the back-end, I did create a new Plugin that enables you to be able to automatically publish stories to Facebook and Twitter (and soon Digg if they ever get off their arses.)  Why create one, there are several out there, you ask?  Plain and simple&#8230;because they didn&#8217;t fulfill my client&#8217;s expectations.  Anyway, it has all come together nicely.</p>
<h3><strong>Biggest Challenge</strong></h3>
<p>Re-launching a site that gets over 30 Million page views a month, has over 2 Million database entries, hundreds of thousands of photos, and 400 people signing up daily, is a challenge no matter how you look at it. Especially when you have to combine 2 old builds of WordPress, into one new build, and re-populate a new database from multiple sources.  So, inevitably, I had to take the site down late Friday evening for several hours while I transferred all of the information, and brought it back up live in the early hours of Saturday morning.</p>
<p>Yes, there were a few hitches along the way, but as always that is to be expected.  All in all, it went very smoothly.</p>
<h3><strong>What I Learned</strong></h3>
<p>I&#8217;m not going to lie&#8230;to date this is the &#8220;biggest&#8221; site I have ever handled.  Sure, I had read about large sites and scaling them upward (<a href="http://www.amazon.com/Building-Scalable-Web-Sites-Applications/dp/0596102356" target="_blank">Building Scalable Web Sites: Building, Scaling, and Optimizing the Next Generation of Web Applications</a> by Cal Henderson is amazing), but getting your hands dirty is always the tough part.  No one wants to trust you.  Bottom line there are three things that made this possible.</p>
<ol>
<li>Doing my Research.</li>
<li>Have a good support crew (Hosting company and colleagues).</li>
<li>Test your launch process for a few weeks.</li>
</ol>
<p>I will go into detail more on this in a future post.  Overall, this was a huge success and I couldn&#8217;t be happier with the result.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designmenace.com/portfolio/barstool-sports-3-0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Connect to Webtrends using PHP, through ODBC.</title>
		<link>http://www.designmenace.com/web-back-end/how-to-connect-to-webtrends-using-php-through-odbc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-connect-to-webtrends-using-php-through-odbc</link>
		<comments>http://www.designmenace.com/web-back-end/how-to-connect-to-webtrends-using-php-through-odbc/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 16:18:06 +0000</pubDate>
		<dc:creator>sublet</dc:creator>
				<category><![CDATA[Web: Back-end]]></category>
		<category><![CDATA[ODBC]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WebTrends]]></category>

		<guid isPermaLink="false">http://www.designmenace.com/?p=19</guid>
		<description><![CDATA[So I spent a few days, on and off, pounding my head against the desk trying to get a ODBC Connection to a WebTrends OnDemand Account using PHP.  Now 99% of you will probably never run into this, but I learned some things, and since it isn't documented at all, and I don't have anything else to write about now...let me share [...]]]></description>
			<content:encoded><![CDATA[<p>[youtube-popup-display 1]</p>
<p>So I spent a few days, on and off, pounding my head against the desk trying to get a ODBC Connection to a WebTrends OnDemand Account using PHP.  Now 99% of you will probably never run into this, but I learned some things, and since it isn&#8217;t documented at all, and I don&#8217;t have anything else to write about now&#8230;let me share.</p>
<p>Now if you spend some time running through the <a href="http://developer.webtrends.com/index.jspa" target="_blank">Developers Network</a> you might think I am an idiot because it is fairly well documented on how to do so.  The <a href="http://product.webtrends.com/dxapi/index.html" target="_blank">Developers API</a> is a very thorough, and the forums answer a lot of other questions.  But most of it is geared towards version 9.0+, which is the kicker, because I was being forced to come up with a solution to make it work with 7.5.</p>
<p>Another big thing&#8230;This won&#8217;t work on Mac OS or any Linux Box, which leaves you with the dreaded Windows 2003 or 2008 Server.  Reason???  You have to download and install the Webtrends ODBC Driver.  (This can be found in your Webtrends control panel under Administration -&gt; Install Components.)  So yippie&#8230;Windows.</p>
<p>Also, something that is good to checkout is the &#8220;<a href="http://www.arena.no/dokumentasjon/wt81/MarketingLabProgrammersReference.pdf" target="_blank">Marketing Warehouse Programmer&#8217;s Reference</a>.&#8221;   It&#8217;s a 90 page document that has a pile of stuff you can reference and should know when querying the &#8220;database&#8221; on the Webtrends server.</p>
<p>Anyway, once you see it there isn&#8217;t a lot to it.  It&#8217;s a simple ODBC connection, but to access the data you first have to pull the Profile ID that you want (Line 15-18,) and then use this Profile ID to get the Database ID (Line 20-21.)  Once you have these two variables you can connect to the Report Server (Line 25,) and then run your query (Line 27.)</p>
<p>As always, if you have any questions, abuse the comments area, so that we can all enjoy the useless banter of one-upping each other until the others don&#8217;t care anymore.</p>
<h2>WebTrends Class</h2>
<pre class="brush: php; title: ; notranslate">class WebTrends {

     private $user, $pass, $server, $port;
     private $database, $connect;

     public function __construct($user,$pass,$server,$port,$query) {

          $this-&gt;user     = $user;
          $this-&gt;pass     = $pass;
          $this-&gt;server   = $server;
          $this-&gt;port     = $port;

          $this-&gt;buildDatabaseString('WTSystem');

          $this-&gt;connect  = odbc_connect($this-&gt;database, '', '');
          $row    = $this-&gt;queryIt(&quot;CALL wtGetProfileList&quot;);

          $prof   = $row['PROFILE_GUID'];

          $row    = $this-&gt;queryIt(&quot;CALL wtGetTemplateList('&quot;.$prof.&quot;')&quot;);
          $db     = $row['TEMPLATE_GUID'];

          $this-&gt;buildDatabaseString($prof,$db);

          $this-&gt;connect  = odbc_connect($this-&gt;database, '', '');

          $row    = $this-&gt;queryIt($query);

          echo 'Results:&lt;br/&gt;&lt;br/&gt;';
          print_r($row);

     }

     private function buildDatabaseString($prof,$db='WTSystem') {

          $this-&gt;database = &quot;
          Driver={WebTrends ODBC Driver};
          DATABASE=$db;
          SERVER=$this-&gt;server;
          PORT=$this-&gt;port;
          AccountId=1;
          UID=$this-&gt;user;
          PASSWORD=$this-&gt;pass;
          ProfileGuid=$prof;
          SSL=0;
          &quot;;

     }

     private function queryIt($query) {
          $result  = odbc_exec($this-&gt;connect, $query);
          $row  = odbc_fetch_array($result);
          return $row;
     }

     private function closeOdbc() {
          odbc_close_all();
     }

     public function __destruct() {
          $this-&gt;closeOdbc();
     }

}

$query = &quot;SELECT * FROM visitstrend WHERE timeperiod='%YESTERDAY%'&quot;;

$wt  = new WebTrends('{USERNAME}','{PASSWORD}','{SERVER}',{PORT},$query);</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.designmenace.com/web-back-end/how-to-connect-to-webtrends-using-php-through-odbc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Designing for iOS4</title>
		<link>http://www.designmenace.com/ios4-development/designing-for-ios4/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=designing-for-ios4</link>
		<comments>http://www.designmenace.com/ios4-development/designing-for-ios4/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 15:09:56 +0000</pubDate>
		<dc:creator>sublet</dc:creator>
				<category><![CDATA[iOS4 Development]]></category>
		<category><![CDATA[iphone ipad ios4]]></category>

		<guid isPermaLink="false">http://www.designmenace.com/?p=15</guid>
		<description><![CDATA[With all of the different devices out there for just the iOS, how does one go about designing for all, without having to backtrack again and again. What am I talking about specifically? Well let&#8217;s review Apple&#8217;s current iOS line of products. The older iPhone 3 displays at 320&#215;480, the new retina display on the [...]]]></description>
			<content:encoded><![CDATA[<p>With all of the different devices out there for just the iOS, how does one go about designing for all, without having to backtrack again and again.</p>
<p>What am I talking about specifically?  Well let&#8217;s review Apple&#8217;s current iOS line of products.</p>
<p>The older iPhone 3 displays at 320&#215;480, the new retina display on the iPhone 4 sports a resolution twice that size, and the iPad sits at a monstrous 1024&#215;768.  Oh, and let&#8217;s not forget that Apple will more than likely introduce an iPad with the retina display in the not to distant future, as well as, rumors have been circling about the Apple TV getting App capabilities.</p>
<p>I ran into this issue when developing a new App for the iPad and iPhone back before the iPhone 4 was released.  So what is the best course of action?  I found a great write up today over at Global Moxie with an in depth look into how to design for what seems to be a never ending problem.</p>
<p>http://globalmoxie.com/blog/designing-for-iphone4-retina-display.shtml</p>
<p>Cheers!</p>
<p><strong>UPDATE:</strong> Apple TV was not updated with the App capabilities, I was thinking it SHOULD HAVE!  However, from everything I have read, it is built on the iOS platform&#8230;so it is a possibility in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designmenace.com/ios4-development/designing-for-ios4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

