I’ve been wanting to get a write up done for WordPress on AWS, the fact that it is free for a year, since they’ve released the free-tier many months ago. Well I finally got around to it, however it isn’t a write up. I went ahead and put the work in to produce a video of the steps for setup & configuration. Enjoy.
<iframe allow="clipboard-write; presentation" allowfullscreen="" aria-label="VideoPress Video Player" data-resize-to-parent="true" frameborder="0" height="538" src="https://videopress.com/embed/VAiI7dqy?hd=1&cover=1&loop=0&autoPlay=0&permalink=1&muted=0&controls=1&playsinline=0&useAverageColor=0&preloadContent=metadata" title="VideoPress Video Player" width="862"></iframe>
The commands to install php, mysql, httpd (apache), and manipulate the config files are included below for copy and paste needs.
Create a Linux Instance on AWS – create & assign an IP Address
Login with ‘ec2-user’
sudo -i
lsof -i
yum -y install httpd
service httpd start
yum -y install php mysql
yum install mysql-server
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
yum install phpmyadmin
vi /etc/httpd/conf.d/phpmyadmin.conf
Hit insert hey to make changes to the conf file.
————————————————————————————
Web application to manage MySQL
Order Deny,Allow
Deny from all
Allow from all
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin
————————————————————————————
service httpd restart
service mysqld start
/usr/bin/mysqladmin -u root password ‘somepassword’
vi /etc/httpd/conf.d/phpmyadmin.conf
vi /usr/share/phpmyadmin/config.inc.php
————————————————————————————
[…] /* Authentication type */
$cfg[‘Servers’][$i][‘auth_type’] = ‘http’;
[…]
————————————————————————————
Watch the video for the WordPress Database creation in mysql w/ phpmyadmin.
wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz -C /var/www/html/
cp -avr /var/www/html/wordpress/* /var/www/html/
rm -rf /var/www/html/wordpress/
cd /etc/httpd/conf
vi httpd.conf
Find the user here… it should be ‘apache’
cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
vi /var/www/html/wp-config.php
…Add the database settings.
chown -R apache /var/www/html
chmod -R 755 /var/www/html
Here’s the basic outline of what I intend to speak on at the upcoming presentation I have for the Bellingham, Washington .NET Users Group. If you happen to be in the area you should swing by and give it a listen (or heckle, whatever you feel like doing).
On April 5th I have a talk lined up with the Bellingham .NET Users Group. So far here’s a quick one over of the talk:
What Cloud Computing REALLY is to us techies
- Geographically dispersed data centers.
- Node based – AKA grid computing configurations that are…
- Highly Virtualized – thus distributed.
- Primarily compute and storage functionality.
- Auto-scalable based on demand.
What kind of offerings exist out in the wild?
- Amazon Web Services
- Rackspace
- Orcs Web
- GoGrid
- Joyent
- Heroku
- EngineYard
…many others and then the arrival in the last year”ish” of…
Developing for the cloud, what are the fundamentals in the .NET world?
Well, let’s talk about who has been doing the work so far, pushing ahead this technology.
- Linux is the OS of choice… free, *nix, most widely used on the Internet by a large margin, and extremely capable…
- Java
- Ruby on Rails
- Javascript & jQuery, budding into Node.js via Google’s V8 Engine
- The Heroku + EngineYard + Git + AWESOMESAUCE capabilities of pushing… LIVE to vastly scalable and distributable cloud provisions!
So where does that leave us .NETters?
AWS .NET SDK released a few years ago.
Windows Azure & SDK released about a year ago.
These two have however been lacking compared to Heroku and EngineYard for those that want something FAST,
something transformative, easy to use, without extra APIs or odd tightly coupled SDKs.
Enter…
AppHarbor
In Summary the .NET Platform has primarily:
AWS for the top IaaS and most widely available zones & capabilities at the absolutely lowest prices,
Windows Azure for the general build to PaaS Solution, and for the people lucky enough to be going the Git +
MVC + real Agile route, AppHarbor is the peeminent solution.
Demo Time…
Windows Azure Demo
AWS Demo
AppHarbor Demo
Here’s the class that has a Func setup as a property. The reason this is setup, is so that the stream can actually be stubbed on the ComplianceReportingJob. Otherwise if the Stream was just being used as is, instantiated in the class, or passed in via injection, we still couldn’t get it mocked or stubbed. Especially if the class ComplianceReportingJob is under test.
public class ComplianceReportingJob : IJob
{
readonly ITradeRepository tradeRepo;
readonly IFileSystem fileSys;
public ComplianceReportingJob(ITradeRepository tradeRepository, IFileSystem fileSystem)
{
tradeRepo = tradeRepository;
StreamedFile = filename => new FileStream(filename, FileMode.Create);
}
public Func<string, Stream> StreamedFile { get; set; }
}
What we have here is the context being setup, with the property being stubbed with a fake StreamedFile = filename => new MemoryStream(). So if you’re looking for a way to test streams with .NET, this is a way around the limitations of the framework.
public class with_a_compliance_report_job
{
protected static ITradeRepository tradeRepository;
protected static IFileSystem fileSys;
protected static ComplianceReportingJob job;
Establish context = () =>
{
tradeRepository = Substitute.For<ITradeRepository>();
fileSys = Substitute.For<IFileSystem>();
reportContent = FizzWare.NBuilder.Builder<TradeComplianceViewModel>.CreateListOfSize(10).Build().ToList();
tradeRepository.GetComplianceReport().Returns(reportContent);
fileSys.DirectoryExists(string.Empty).ReturnsForAnyArgs(true);
job = new ComplianceReportingJob(tradeRepository, fileSys)
{StreamedFile = filename => new MemoryStream()};
};
protected static List<TradeComplianceViewModel> reportContent;
}
This is a pretty sweet solution, for now. The ideal solution however, would be that Microsoft fixes the framework, which is very unlikely to happen. The whole closed, sealed, and otherwise locked up framework stack is a massive problem with testability. Which then directly impacts maintainability and other things over time.

Still not sure what to call the infrastructure project. One suggestion that came up was, “Visual Fluent NInfrastructure .NET Sharp“. It’s all trendy and wordy and can be turned into an unpronouncable acronym, VFN.NET#. Anyway, got ideas? Throw a comment on the post! 🙂
I got the multiple project completed and uploaded as template v1.1.
For information on how I put together the multiple project template, check out the links on the wiki here:
Also am working to add a basic vertical implementation of NHibernate up to the views with basic CRUD operations just for an example. I’m pondering if that should be done as a separate template, maybe titled something like “template w/ samples”? Then keeping the core template with only the skeleton code.
For more information on the project, check out the github infrastructure project page.
I was looking through some code and found this class recently. It almost reminds me of a class I saw called a speed up loop. This however, is obviously more important to the grand scheme of politics eh!
public class BureaucratJob : IJob
{
readonly ITradeReconciler reconciler;
readonly ICalculationQueue queue;
ILog log;
public BureaucratJob(ITradeReconciler reconciler, ICalculationQueue queue)
{
this.reconciler = reconciler;
this.queue = queue;
}
public void RedTape(object[] formsInTriplicate)
{
// intentionally doing nothing, just like any good ol American Bureaucrat!
}
public void Execute(JobExecutionContext context)
{
RedTape(new[] { "formsInTriplicate", "formsInTriplicate", "formsInTriplicate" });
log = LogManager.GetLogger(typeof(BureaucratJob));
log.Info(string.Format("Job Executing, it's currently {0} and all is well", DateTime.Now));
log.Info("Reconciliation is starting.");
var work = IoC.Resolve<IUnitOfWorkManager>();
work.Begin();
reconciler.Go();
log.Info("Reconciliation has finished. Calculation queue is now processing.");
queue.Process();
work.Commit();
work.Complete();
log.Info("Calculation queue is queued out n' done.");
}
}
Hope you enjoyed the code read. 🙂 Cheers!
