Mounting a shared windows drive

I’m about to setup a photoblog for a friend and since he currently got his machine/server standing here I thought it could be convinient if I could have his webfiles on that machine and somehow mount that into my FreeBSD machine. So sstarted to search for mounting samba and stumbled upon this article:
FreeBSD and Samba: Automounting

But I could not make it work, first I had Samba 2 so upgraded to 3, but still no progress. Got wierd errors when doing mount_smbfs. The first I got was: “mount_smbfs: vfsload(smbfs): File exists” which didnt make much sense. I tried a lot of things, nothing helped. Finally I rebooted and now I got “mount_smbfs: vfsload(smbfs): Exec format error” which was not much more informative…
Though I found some information about that one needed to have NETSMB option set when compiling the kernel so checked my Kernel config file. Had that already and also the other pre-requisits… Though after a while I realized that I was missing the SMBFS option! So recompiling the kernel with all of these options solved it:

options NETSMB
options NETSMBCRYPTO
options SMBFS
options LIBMCHAIN
options LIBICONV

IMAP stops responding

My qmail setup has worked quite well, though I have had a bit of irritating thing with it. After opening a number of folders in Thuderbird, it stopped responding. After reading and seraching a bit I discovered it was a configuration issue in the courier-imap server.

Probably didnt read it too well when installing but QmailRocks mentioned one should increase MAXPERIP if running in a small home or office network.

Now it works as a sharm.

Changing IP

So once more I changed ISP. Each time I do that the server gets really slow to ssh into, have not figured out yet why. But to speed up things a bit I’ll write down here which files I need to change.

First /etc/rc.conf which sets the IP
/etc/namedb/named.conf for the DNS
/etc/namedb/yelloworb.com
/etc/namedb/yelloworb.com.rev
/etc/ipfw.conf for the firewall
/etc/hosts

/usr/local/etc/dhcpd.conf
/usr/local/etc/proftpd.conf

Strange perl error while updating ports

When running

/usr/local/sbin/portupgrade -ra

I got several errors:

** Port marked as IGNORE: databases/p5-DBD-Pg:
        Needs DBI 1.38 which needs perl 5.6, install lang/perl5.8 and try again
	
  • Port marked as IGNORE: mail/p5-Mail-SpamAssassin: Needs perl 5.6.1 or higher, install lang/perl5.8 and try again

Could not figure out what was wrong since I just had installed perl5.8 from ports! After googling I found out that apparently this is a problem with old FreeBSD installations, 4.10 like I have. The problem is that the installation does not update some files that are automatically done on systems like 5.3. By issuing the command

/usr/local/bin/use.perl port

the updates are done.

Problems installing Horde again

I have just made a total upgrade of my ports tree and ran into some problems. One was that Horde or rather php couldnt load any dynamic libraries anymore. Don’t remember having any problems with that before. A search on hte net gave me the hint I needed. In the article “dBforums – unable to find php_mysql.dll” it is described how one should change extension_dir in /usr/local/etc/php.ini. After changing it to /usr/local/lib/php/20020429/ Horde installed nicely again.

Keeping installed packages up-to-date

This FreeBSDDiary article explains how to keep your installed packages from ports up-to-date. “The FreeBSD Diary—Got ports? Here is THE way to upgrade them!”

When I ran pkgdb -F I got some Stale Dependencies I could not solve since somehow installed packages like ImageMagick depended on fontconfig that was not installed. Have no idea how I have ended up in that situation.

But reading on I found information on the pkgdb man-page that said one should run portsdb -Uu after doing a cvsup on the ports tree. I have cvsuped my ports tree several times without running it so now I’m doing that.

Short summary:
cvsup -g -L 2 ./ports-supfile
portsdb -Uu
pkgdb -F
portupgrade -arp

Installing qmail

I have been planning on installing mail on this server for quite some time but never really got around to do it, until now. So qmail it is. Found the qmailrocks.org website and followed their FreeBSD installation guide.

The only thing that has not really been as described is the php.ini file. I didnt have any at all but I had the distribution one so I made a copy of it:

cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini

I got as far as to page 13, has to continue some other day.

Update 2004-07-21: Today I got a bit further and now I have both CLAM antivirus protection and SpamAssassin installed.
-more->
Update 2004-08-30: Today I finished the whole installation according to qmailrocks but there are still things to be done:

2004-09-03: Continuing with qmail. So I found out by reading LifeWithQmail that the /var/qmail/users/assign controlls which users that gets addresses. Though when I ran qmail-pw2u I got this error all the time:

qmail-pw2u: fatal: unable to find alias user

and I couldn’t figure out why. Reading in some forums I started to get a clue. If a include file exists it must list alias otherwise will qmail-pw2u give this error. Which is a bit strange, specifically since I had an assignment file without alias before I started to look into this. The assignment file that is produced from the QmailRocks installation doesn’t have it and qmail definetly works after that installation.

So should I edit my newly created assign file and remove alias or should it be kept? The generated file includes three different alias rules, and according to the documentation the alias user is a catch-all user.

Still cannot get it to work to send e-mail to an ordinary user: gets: Sorry, no mailbox here by that name. vpopmail (#5.1.1)

Upgrade 4.8 -> 4.10

So once more I upgraded my system. It gets smother and smother. This time, the only problem I had was that I could not the machine to route any traffic through. It turned out that I should not remove the IPDIVERT option from the kernel config. I dont really understand why since what I read on hte man-pages it should only be used if you divert traffic to a specific socket. I dont think I do that… but I must since I need it.

EDIT: Should have read the firewall configuration more carefully!
# Network Address Translation. This rule is placed here deliberately
# so that it does not interfere with the surrounding address-checking
# rules. If for example one of your internal LAN machines had its IP
# address set to 192.0.2.1 then an incoming packet for it after being
# translated by natd(8) would match the `deny’ rule above. Similarly
# an outgoing packet originated from it before being translated would
# match the `deny’ rule below.
case ${natd_enable} in
[Yy][Ee][Ss])
if [ -n ”${natd_interface}” ]; then
${fwcmd} add divert natd all from any to any via ${natd_interface}
fi
;;
esac

There is the rule that use DIVERT!