Posts

Showing posts from January, 2013

SE Linux Cure (mini mini post)

I think its only natural for admins to avoid SELinux. Having SELinux enabled can make your simplest changes resulting in system failures. Or maybe even no change at all (no changes that you remember..). The Cure In the past, I depend upon a few commands that might shed some light on SELinux troubles. The commands are : ls -Z : this parameter shows additional column, named the security context, that is owned by each file chcon : this command changes a file's context to the given context argument. Example, chcon -t mysqld_db_t mysql - this command sets the security context of the mysql directory to mysqld_db_t restorecon : this command restores a file's context to default But a recent trouble opened my mind that more tools are needed. For example, in Ubuntu systems, we might need to poke the directory /etc/apparmor.d and edit rule files there. In recent CentOS trouble, these commands are handy : yum install setroubleshoot - this installs sealert, semanage tools

MySQL Corrupt Tables and How to Avoid it

Once in a while MySQL's tables became corrupted. This post is not interested in repair process (you should see other posts, but the most general advice is to do a REPAIR TABLE table ; ) In my humble opinion, a real life production database must not have any corruption, it must have sufficient failsafe mechanisms to avoid such corruption. Causes of Corruption MyISAM tables could became corrupted by  (refer http://dev.mysql.com/doc/refman/5.1/en/corrupted-myisam-tables.html) : mysqld is being killed in the middle of write unexpected computer shutdown occured hardware failures running an external program (example: myisamchk) while mysqld is running software bug in Mysql/myISAM code Tips to mitigate data corruption Do not use MyISAM for long lasting data. Use InnoDB. InnoDB is less corruption prone than MyISAM.  Use file per table option for InnoDB. Check your disk space and database availability periodically. On one occasion, my mysql data partition is full, and

Learning Cloud Foundry - NATS

All Cloud Foundry components communicates with each other using NATS publish-subscribe mechanism. Lets see in detail what is NATS like. Cloud Foundry Router as NATS client During startup of Cloud Foundry Router ( router.rb ), there is a call to start NATS client below : NATS . start ( :uri => config [ 'mbus' ] ) It means that NATS client will be started with the uri parameter obtained from configuration parameter 'mbus'.  config_path = ENV [ "CLOUD_FOUNDRY_CONFIG_PATH" ] || File . join ( File . dirname ( __FILE__ ), '../config' ) config_file = File . join ( config_path , 'router.yml' ) ... opts . on ( "-c" , "--config [ARG]" , "Configuration File" ) do | opt |      config_file = opt    end ... We find that the configuration parameter will be read from a YAML (yet Another Markup Language) that whose location could came from multiple sources, in these order : specified fro

Learning Cloud Foundry Router

Background The Cloud Foundry PaaS platform serves web applications. The Cloud Foundry router components is different from a router in the plain IT-talk, the Cloud Foundry router is a Ruby-based software component that determines which backend droplet that should serve (each and every) http request that are requested to one of the applications deployed on the platform. Starting Point In order to understand the mechanism of the router, we start from nginx, the http server that serves as the primary gatekeeper. Nginx configuration is my primary concern. So lets see the vcap source code that describes nginx configuration on each and every Cloud Foundry server. In the vcap/dev_setup/cookbooks/nginx folder we found a templates directory that stores nginx configuration templates.  The templates I suppose being used by the dev_setup installation procedure. Configuration templates We have cc-nginx.conf.erb Ruby template along with router-nginx.conf.erb template and some other

Learning Cloud Foundry PHP staging and deployment

Image
Background VMWare Cloud Foudry is an open source Platform for PaaS (platform as a service). I see cloud foundry as a tool to simplify multiple application deployment in multiple servers. This post will describe things I found by reading source code of vcap (Vmware Cloud Application Platform) at github here and here . My point of interest is php deployment capability that exists on vcap, which are contributed by phpfog developers. My previous exploration of Cloud Foundry resulted in this picture below, which describe  my current understanding of the Cloud Foundry platform. Starting point The starting point of php support is given an interesting commit I had seen before, where phpfog team implements php functionality. At first it took me about 10 minutes browsing the vcap network graph (https://github.com/cloudfoundry/vcap/network), then I just realized there is a distinct phpfog branch in the vcap git..  The interesting commit is titled 'Support for deploying PH

Interfacing Joget Workflow Engine with .NET and PHP

Image
The Joget Workflow Engine have JSON API interface which could be used to query and control workflow processes. This will be useful if we need to implement a custom front-end UI for joget workflow. Especially if the development team have minimum or even zero Java development experience. I have created two API test applications, one is using PHP and the other is written in C# using .NET framework. The PHP version is written using the wonderful Yii Framework. The C# version is a windows forms application, but the WorkflowService class theoretically could be used in ASP.NET application. Feel free to download and try ... jogettestnet (C# .NET Windows Forms App) jogettestphp (Yii-based PHP App) To start using this test application, you must first configure joget to allow login using master login username and master password (click System Settings:General Setting, find the section System Administration Settings). Fill the master login & password (in my example, superuser and