Ruby On Rails Hosting -A Laymans Approach

Recently there is a lot of Hype in Ruby On Rails commonly called ROR . Ruby On Rails  claims to be a platform with Rapid development .The problem arises when when people used to the PHP hosting world switch to Rails Hosting . Then people start to realize whey there are millions of WebHosts offering PHP hosting and the joy of publishing by just uploading your files to your shared hosting account and viewing it via the browser.

Things arent that simple in Rails Hosting (at least as of now) causing the Ruby Hosting to be concentrated in the VPS and Dedicated server markets. Although they are few shared hosts ofering ROR, the number is far less compared to PHP hosts .

The current solutions that are being used for ROR hosting are :

1. Proxy pass the Ruby request to ruby specific web servers like Mongrel or Thin and use Apache ,Lighttpd ,Nginx etc as frontends ( The author highly recommends Nginx ) . The problem with this approach is the complexity why is a bit high for someone used to the php shared hosting environment

2. Use a Apache httpd module called mod_rails or mod_rack /Phusion Passenger to parse Ruby code .This projects goal is to achieve something similar to mod_php  in Ruby On Rails hosting . This solution is not widely used mainly because Phusion passenger is a new kid and people havent started using it much in production .But with more and more people using Ruby .I guess mod_rails would have greater acceptance in the future for production web hosting in Ruby on rails

* The author is into active Development of WebHosting solutions for Ruby on Rails and can be contacted at anoop@gnusys.net .If you want to implement a production ROR hosting

Posted under Ruby On Rails, hosting, nginx

This post was written by Anoop Alias on November 10, 2008

Tags:

List of Different web servers on GNU Linux

Today we have different web servers available on the GNU/Linux platform.Here i am listing only the web servers that can be used for a mainstream web hosting environment

The web servers can be classified basically into 2

1. Process based webserver - In a process based web server each new connection is handled by a new web server process or thread. Following are some of the process based servers available on the GNU /Linux platform.A notable draw back for a process based web server is the famous C10K problem ( http://www.kegel.com/c10k.html ).That said there are many implementations of this model that are high performance in nature

  • Apache HTTPD - http://httpd.apache.org/  - the most famous web server and the most widely used - supports a very large number of modules and very feature rich
  • Cherokee - http://www.cherokee-project.com/ - is a fast flexible easy to configure web server - A notable feature is the administrative interface available that lessens the burden of tampering with the configuration files
  • LiteSpeed - http://www.litespeedtech.com/ - Apache compatible web server ,but claimed to be of having improved perfomance

2- Asynchronus web server or non-blocking i/o webserver - Or in laymans words a web server that uses a single process to handle multiple request ,switching over to the next request when the previous one is waiting for an i/o request is to be fullfilled. This architecture is more scalable and theoretically solves the C10K problem.The famous members of this family of servers are

  • Nginx - http://wiki.codemongers.com/Main  - pronounced EngineX - is  a powerfull light weight web server and has a cleaner configuration -It is also feature rich and widely used
  • Lighttpd  - http://www.lighttpd.net/ -  This is another powerfull and light weight web server and has a very large number of modules and features

All the above mentioned web servers are widely used in the web hosting industry ,in dedicated ,vps and shared hosting environments

Posted under Apache, hosting, nginx, perl, php

This post was written by Anoop Alias on September 19, 2008

Tags:

Howto disable access log in nginx

The following configuration disables logging the http requests in nginx

=====
http {
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 64;

#log_format main '$remote_addr - $remote_user [$time_local] $request ‘
# ‘”$status” $body_bytes_sent “$http_referer” ‘
# ‘”$http_user_agent” “$http_x_forwarded_for”‘;

#access_log logs/access.log main;
access_log off;

====

Posted under hosting, nginx

This post was written by Anoop Alias on September 14, 2008

Tags: ,

Howto enable Directory Listing in nginx

To enable directory listing use the following configuration option:

autoindex on;

eg:
server {    listen 80;    server_name gnusys.net;    autoindex on;…………}

Posted under hosting, nginx

This post was written by Anoop Alias on September 1, 2008

Tags: ,

nginx server_names_hash_bucket_size error

The error:

Starting nginx daemon: nginx2008/08/25 00:29:09 [emerg] 4011#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32

The fix:

Within the http block of the nginx config file make sure you have the server_names_hash_bucket_size set higher than the minimum 32

something lik

http { server_names_hash_bucket_size 64;

}

explanation :

hash_max_size will control the
number of virtual host entries, while _hash_bucket_size will control
the maximum length of single entries
if you have a lot of virtual host entries, you should increase
hash_max_size, while I should increase hash_bucket_size if some
domain names are too long.

Posted under Uncategorized, nginx

This post was written by Anoop Alias on August 25, 2008

Tags:

Howto install Nginx from source

Nginx is a very fast ,powerful asynchronous web server that can be considered as a good replacement for the Apache HTTPD web server. Below are the steps required to get Nginx installed on your system. It is preffered to install Nginx from source as we get the latest stable version of this project as compared to installing from your operating systems package repository as this may be sometimes outdated

Get the latest stable release from http://nginx.net

At the time of writing i downloaded  http://sysoev.ru/nginx/nginx-0.6.32.tar.gz

I installed the following development libraries using apt-get

apt-get install libgcrypt11-dev libpcre3-dev libssl-dev

tar -xvzf nginx-0.6.32.tar.gz

cd nginx-0.6.32

mkdir /usr/local/nginx

./configure –prefix=/usr/local/nginx –user=nobody –group=nogroup –with-http_ssl_module –with-http_realip_module –with-http_addition_module –with-http_sub_module –with-http_gzip_static_module –with-http_stub_status_module –without-mail_pop3_module –without-mail_imap_module –without-mail_smtp_module –with-md5=/usr/lib

make

make install

Thats it we now have to configure nginx and start the daemon to start serving web

Posted under hosting, nginx

This post was written by Anoop Alias on August 13, 2008

Tags: ,