Wednesday, June 13, 2012

Setting up Log4PHP with Code-Igniter

No BS, the steps are as following -

1. Clone the github project at https://github.com/fukata/ci-log4php

 

>: git clone https://github.com/fukata/ci-log4php.git

2. The ci-log4php directory has 2 folders. Copy and paste the ci_log4php folder in /application/third_party/

3. From the other folder Copy MY_Log.php file. Open config.php.
If $config['subclass_prefix'] = 'MY_';
then place the MY_Log.php file in /application/libraries/

4. Similarly Place the log4php.properties in /application/config folder and log4php_helper.php in /application/helpers folder

 

5. Edit the log4php.properties file. Set logs logs folder path

log4php.appender.default.file = /path/to/ci-app/application/logs/%s.log

6. Set the $config['log_threshold'] = 4; in config.php according to :

  • | 0 = Disables logging, Error logging TURNED OFF
  • | 1 = Error Messages (including PHP errors)
  • | 2 = Debug Messages
  • | 3 = Informational Messages
  • | 4 = All Messages

7. Go inside the application folder and run > chmod -R 777 ./logs

8. Use these commands for logging -

  // log_error('thiserror');

// log_info('thisinfo');

// log_debug('thisdebug');

Enabling SSL on MAC OS-X Snow Leopard

cd /private/etc/apache2/

openssl req -keyout privkey-$(date +%Y-%m).pem -newkey rsa:2048 -nodes -x509 -days 365 -out cert-$(date +%Y-%m).pem

Country Name (2 letter code) [AU]:CH State or Province Name (full name) [Some-State]:Zurich Locality Name (eg, city) []:Zurich Organization Name (eg, company) [Internet Widgits Pty Ltd]:Entropy Organizational Unit Name (eg, section) []:Secure Server Administration Common Name (eg, YOUR name) []:www.entropy.ch Email Address []:liyanage@access.ch

Make sure to enter the sitename properly.

Make sure that TextEdit is not running, then type these lines into the terminal window:

chmod 600 privkey-YYYY-MM.pem

chown root privkey-YYYY-MM.pem

open -a TextEdit /etc/apache2/httpd.conf

Uncomment the lines -

  • LoadModule ssl_module libexec/apache2/mod_ssl.so
  • Include /private/etc/apache2/extra/httpd-ssl.conf 

open -a TextEdit /etc/apache2/extra/httpd-ssl.conf

Edit these lines -

  • SSLCertificateFile /etc/apache2/cert-YYYY-MM.pem
  • SSLCertificateKeyFile /etc/apache2/privkey-YYYY-MM.pem

Restart apache

Media Coverage!

Symynd - Share your M'yn'd

Today I was moved to Symynd [http://www.symynd.com], a project built in Django, a web-development Framework built upon Python. Setting up the project on mac took quite some effort since I had to install a lot of Python and Django libraries to get the project running.

I am thinking of writing a script to make the setup process easy. Will probably work on that tomorrow.

Hadoop!

Hadoop is a large-scale distributed batch processing infrastructure. Batch processing is execution of a series of programs (jobs) on a computer without manual intervention. 

Hadoop includes a distributed file system which breaks up input data and sends fractions of the original data to several machines in your cluster to hold. This results in the problem being processed in parallel using all of the machines in the cluster and computes output results as efficiently as possible. 

Hadoop is designed to handle hardware failure and data congestion issues very robustly.

In a Hadoop cluster, data is distributed to all the nodes of the cluster as it is being loaded in. [Data is distributed across nodes at load time.]

The Hadoop Distributed File System (HDFS) will split large data files into chunks which are managed by different nodes in the cluster. In addition to this each chunk is replicated across several machines, so that a single machine failure does not result in any data being unavailable. Even though the file chunks are replicated and distributed across several machines, they form a single namespace, so their contents are universally accessible.

 Hadoop will not run just any program and distribute it across a cluster. Programs must be written to conform to a particular programming model, named "MapReduce."

Powered By Blogger
Custom Search