Browsing all articles tagged with Tuning

Unfortunately, its back to the techie stuff for a few posts!

Here are my crib notes on installing NGinx on one of our client servers.

Add spawn-fcgi (cos its split from litettpd now) http://redmine.lighttpd.net/projects/spawn-fcgi/wiki/SVN


cd /downloads
svn co svn://svn.lighttpd.net/spawn-fcgi/trunk spawn-fcgi

No svn..grrr


apt-get install subversion subversion-tools
svn co svn://svn.lighttpd.net/spawn-fcgi/trunk spawn-fcgi
cd spawn-fcgi
./autogen.sh
./configure
make
make install

spawn-fcgi should be happily installed in /usr/local/bin/spawn-fcgi now

make sure we have php5-cgi
apt-get install php5-cgi

Check spawn-fcgi runs -
In my case not, had to rebuild eAccelerator @#$@#$!, did that, and all ok


/bin/spawn-fcgi -f /usr/bin/php5-cgi -a 127.0.0.1 -p 53217 -P /var/run/fastcgi-php.pid

Note port 53217 can be any unused port from some high unused number though to 65535
We’re going to be installing NGinx from debian packages, but probably better from source long term…

apt-get install nginx

pico /etc/nginx/nginx.conf

change some default settings


user www-data;
worker_processes 1;

error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

access_log /var/log/nginx/access.log;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 5;
tcp_nodelay on;

client_max_body_size 8m;

gzip on;
gzip_comp_level 9;
gzip_types text/plain text/html text/css text/xml application/xml application/xml+rss text/javascript application/x-javascript;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}

Now we add our virtual hosts in /etc/nginx/sites-available


pico /etc/nginx/sites-available

Lastly, we add our fast-cgi settings, using our port from above 53217


fastcgi stuff here

When I get time, I go through the logs and check out how the servers are doing.

One thing that I haven’t really done recently is to optimize the way things are configured.
The typical solution in most scenario’s is to throw faster hardware at things (something we do when necessary!), but sometimes a few minutes configuration can help speed things up tremendously.

Below are some tips for optimizing apache a little.

Read more »

Archives

Categories

Most Popular Posts

Tags

Apache Apple Apple Mail arm7 biltong china china telecom Chinese Spyware Removal Howto coffee cool debian dns dvd firmware foscam Google hacking how to howto icp Image ipcam Kitto lg dv340 licence Mac Moganshan nc745 nuvoton outage Picture problem region free hack Resize Search Engine Optimization SEO shanghai south africa spam taobao Thoughts Time Machine Tuning uclinux video

Recent Comments

  • jocc: finally. I done the installation properly. I made a USB drive (at less 8GB) formatted wih GUID labelled...
  • Lawrence Sheed: It gets an ip address via DHCP, so you need to provide DHCP service on something like a router or...
  • Denis: I Can noit connected to cam after RESET! What is my ip by factory ?
  • Lawrence Sheed: Yes, you need to have had a license for at least one year. Thats correct. When I’m back...
  • Lawrence Sheed: First off, do a list of your partitions. in the boot loader – ls If you really have erased...

PHOTOSTREAM

loz - yamaha - IMGP0106SDIM0437SDIM0436SDIM0435SDIM0434SDIM0433SDIM0432SDIM0431SDIM0430SDIM0429SDIM0428SDIM0427SDIM0426SDIM0425SDIM0424SDIM0423SDIM0422SDIM0421