Friday, December 28, 2007

pkg_add and an old FreeBSD 5.4 installation

Hellllo.

Just before the New Years, I got this need to upgrade our software on one of our servers. It requires some packages, and so I went to install them.

As I already knew, I was out of luck with pkg_add -r, since the files for FreeBSD 5.4 aren't on FreeBSD's FTP server anymore for a while already.

Minutes later, aunt Google came to help, suggesting that I read FreeBSD manual
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/packages-using.html

shortly, the solution was:
setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/Latest/

:)

Tuesday, December 25, 2007

nginx could not build the server_names_hash hash

When restarting nginx, suddenly I came accross this error message:

could not build the server_names_hash hash, you should increase server_names_hash_bucket_size: 32

Now, that's solved pretty easily - by increasing server_names_hash_bucket in config file to a bigger value. According to author, Igor Sysoev, even p4 can easily handle value of a 128.

So I put
server_names_hash_bucket_size 128;
in nginx.conf, and everything works fine.



Friday, November 9, 2007

Pass real IP for backend webserver

The problem: when nginx is serving front end in two layer webserver, with apache on backend, apache doesn't see clients ip address, just 127.0.0.1 for everybody.

The solution: install either mod_realip (apache 1.3.x only) or mod_rpaf (both apache 1.3.x and 2).

http://sysoev.ru/mod_realip/ - mod_realip
http://stderr.net/apache/rpaf/ - mod_rpaf

http://nginx.info/index.pl/ru/articles

Tuesday, October 30, 2007

After MySQL installation, do

mysql_install_db.

It wasn't so for some time, but now, for reasons unknown to me, it has to be done under FreeBSD.

more on the subject http://dev.mysql.com/doc/refman/5.0/en/unix-post-installation.html

also, chmod 777 /var/tmp.

Turn on SMART capability on a HDD

smartctl -s on /dev/da0

A nice network monitoring tool

A nice network monitoring tool is Ntop. Has its own webserver, and pretty good stats, to see which host is doing lots of traffic, what traffic it is, etc. Great!

DHCP - assign a fixed ip adress to a particular host

Been a while.. So, today I had to assign a fixed ip adress to one particular host, 'cause I had to make host-specific firewall rules, and make sure user doesn't get around them as easily as getting a new DHCP ip address. Here's a config I used (thanks to wikipedia)

host saturn {
hardware ethernet 00:50:04:53:F8:D2;
fixed-address 192.168.42.3;
}