FreeBSD

All posts tagged FreeBSD

This is probably the easiest thing I’ve done with FreeBSD yet.

As root, edit /etc/rc.conf and add the following 2 lines:

nisdomainname=”yourNISdomain”
nis_client_enable=”YES”

Then, edit your /etc/master.passwd (type: vipw) and add the following to the end:

+:::::::::

That tells passwd to consult NIS for users as well as any you’ve defined in your passwd file.

Then edit your /etc/group so we can also find groups from NIS. Add the following to the end:

+:*::

Now heres the trick – I’m not sure how to start ypbind without rebooting, so I had to reboot. Then I could log in and do:

ypcat passwd
and
ypcat group

and was able to see all my NIS users and groups! Man was that easy!

In my last post, I swore FreeBSD knew the hostname of my proxy server without me telling it – that was false. Here is what I had to do to install bash on a fresh install of FreeBSD 6.1 using a proxy:

Since the default shell (at least for root) is csh, use the setenv command to set the environment variable http_proxy like this:

setenv http_proxy http://proxyserver:port

Now, since the invalid attempts to retrieve source files by the ports system mucked up /usr/ports/shells/bash, do a:

make distclean

followed by:

make install

…ok thats not working either. To hell with this, we exported a proxy server, so:

pkg_add -r bash

DONE.

In my quest to figure out why Apache 2.2 on a Linux box seemed to outperform my Apache 1.3 / FreeBSD 6.1 box, I started to really muck up my server. I had started commenting individual LoadModule directives, then decided to try and run Apache 2.2 beside 1.3. Well the ports system complained, so I ended up removing 1.3 with the pkg_del command. Ugh, then 2.2 never did install right – would never listen on 80, so I took this opportunity to reinstall.

6 re-installs later, I’ve come up with the magic formula for installing FreeBSD 6.1. Always select at least User! Not selecting anything gives you no kernel! And while you can get away with Minimal – it won’t ask if you would like to include the ports system – something I couldn’t figure out how to add to my minimal system, yet.

Now heres another thing thats got me scratching my head. After the install I logged in as root so I could install bash. I cd’ed into /usr/ports/shells/bash and did a make install. How the hell did FreeBSD figure out how to get to my proxy server?

Not comparing apples to apples here, but my initial benchmarks turned up some interesting results.

Linux box ripon:
ab -n 1000 -c 5 http://ripon/snkpage.html

Server Software: Apache/2.0.46
Server Hostname: ripon
Server Port: 80

Document Path: /snkpage.html
Document Length: 187 bytes

Concurrency Level: 5
Time taken for tests: 0.275 seconds
Complete requests: 1000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 451000 bytes
HTML transferred: 187000 bytes
Requests per second: 3636.36 [#/sec] (mean)
Time per request: 1.38 [ms] (mean)
Time per request: 0.28 [ms] (mean, across all concurrent requests)
Transfer rate: 1640.00 [Kbytes/sec] received

Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 3
Processing: 0 1 0.2 1 4
Waiting: 0 0 0.1 0 3
Total: 0 1 0.2 1 4
WARING: The median and mean for the waiting time are not within a normal deviation
These results are propably not that reliable.

Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 1
80% 1
90% 1
95% 1
98% 1
99% 1
100% 4 (last request)

FreeBSD box mitnick:
ab -n 1000 -c 5 http://mitnick/snkpage.html

Server Software: Apache/1.3.34
Server Hostname: mitnick
Server Port: 80

Document Path: /snkpage.html
Document Length: 187 bytes

Concurrency Level: 5
Time taken for tests: 0.581414 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 467000 bytes
HTML transferred: 187000 bytes
Requests per second: 1719.94 [#/sec] (mean)
Time per request: 2.907 [ms] (mean)
Time per request: 0.581 [ms] (mean, across all concurrent requests)
Transfer rate: 784.29 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 2
Processing: 1 2 0.7 2 7
Waiting: 0 1 0.8 2 6
Total: 1 2 0.7 2 7
WARNING: The median and mean for the waiting time are not within a normal deviation
These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
50% 2
66% 2
75% 3
80% 3
90% 3
95% 3
98% 4
99% 4
100% 7 (longest request)

How can that be explained?