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: ,