Tag Archives: VirtualHost

Install Graphite under pyenv virtualenv on Ubuntu

It took me one and an half day to get the Graphite working…

1. Make sure you have pyenv and pyenv-virtualenv installed.

 

2. Install the following packages.

sudo apt-get install python-dev pkg-config libcairo2-dev memcached

 

3. Install Python 2.7 with enable-shared.

env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 2.7.8

Continue reading Install Graphite under pyenv virtualenv on Ubuntu

Advertisement

Apache – Enable Cross-origin resource sharing CORS

Long time ago, we talked about using JSONP to tackle to cross domain ajax issue.
jQuery & JSON – Make Cross Domain Request Using jQuery.getJSON() with JSONP

But this requires server side coding. If you are allow to edit the Apache config, you can simply Enable the CORS (Cross-origin resource sharing) in the VirtualHost file as follow.

1. Enable the mod_headers in Apache by entering the following command in shell.

a2enmod headers

Continue reading Apache – Enable Cross-origin resource sharing CORS

Nginx – Redirect a specific url

A client wants the old .aspx path could redirect the visitor to another URL. I don’t want to make the server to host a .aspx file so i add the redirection in the Nginx virtual host config.

Add the following lines insider the server { … }.

## Special redirect for the following
## old xxx.aspx to eureka.ykyuen.info
location /xxx.aspx {
  return 301 $scheme://eureka.ykyuen.info;
}

 

Done =)

Nginx – Enable Microcaching

Update @ 2013-05-09: I am not very sure if this could really enable the Nginx Microcaching as i couldn’t find the HIT value in the HTTP response. Please feel free to comment and let us know if you got the solution. Thanks. =D

Previous posts:

 

Enable Microcaching in Nginx could help making your website run much faster. Base on the setting we did in Nginx + PHP-FPM on Ubuntu Precise. Let’s edit the VirtualHost configuration file to enable Microcaching.
Continue reading Nginx – Enable Microcaching

Nginx + PHP-FPM on Ubuntu Precise

Previous post: Nginx – Installation on Ubuntu Precise

Most of the time we would like to run PHP on our web server. After you have installed Nginx following the post above. We can now enable PHP.

1. Install the PHP packages.

apt-get install php5-fpm
apt-get install php5-cli
apt-get install php5-gd
apt-get install php-pear

Continue reading Nginx + PHP-FPM on Ubuntu Precise

New Relic – Enable Drupal module monitoring

New Relic supports the following list of PHP frameworks.

  • Drupal 6 and 7
  • WordPress
  • CakePHP 1.2, 1.3 and 2.*
  • CodeIgniter 2
  • QDrupal
  • Joomla 1.5 and 1.6
  • Symfony 1
  • Yii
  • Zend Framework 1
  • Magento 1.5 and 1.6
  • MediaWiki
  • Kohana

If you are monitoring a Drupal website, you will find the module tab on the Application menu.

Continue reading New Relic – Enable Drupal module monitoring

New Relic – Monitor multiple web applications or virtual hosts

If you follow the New Relic instruction to setup the daemon. You will get all web applications as a single New Relic App named as PHP Application in the New Relic application console.

So how could we setup multiple New Relic Apps for different virtual hosts in Apache? Here you are.

1. Make sure you have enabled the Apache php5 module. If it is not enabled, enable it by the following command with root privilege.

a2enmod php5

Continue reading New Relic – Monitor multiple web applications or virtual hosts

DumpCamp – Introduction to New Relic


In the 2nd DumpCamp meeting, Ronnie showed us a SAAS service called New Relic which provides Application Performance Management solution mainly for web applications and servers. It’s capabilities include but not limit to:
 

  • Performance analytics on Ruby, Rails, PHP, Java, .Net, Python applications
  • Real User Monitoring
  • Server Monitoring
  • SQL/NoSQL Performance Monitoring
  • Web Application Transaction Tracing

The Lite account is free and i tried it today. The setup is easy and straight forward. Just register an account online with some configurations on your web server through SSH. Then you could views your server and web application performance online.
Continue reading DumpCamp – Introduction to New Relic