Hi everyone!! I am NOT Topher Grace, nor do I want to be. I am just Topher Scribbles and just for kicks, I really want to out-rank Topher Grace's IMDB website. If you want to help, just link to me. Thanks and enjoy some boring fun!!

FreeBSD Samba

So you want to mount a network drive with Samba?

First thing you do is install Samba via ports on both systems. (Be sure to update your ports with cvsup, that will be in a future article)

# cd /usr/ports/net/samba3
# make install clean

Next, on the server machine, in order to make Samba run, you will need to add it to /etc/rc.conf. Just add this line:

samba_enable="YES"

On the client machine, you don’t have to start Samba. In fact, for added security, I remove the samba.sh startup script like so:

# rm /usr/local/etc/rc.d/samba.sh

Now we add the user on the server machine. You will be adding an actual Unix user, but without a login and home directory.

# adduser SambaUser

Username : SambaUser
Password : *****
Full Name : Samba User
Uid : 1004
Class :
Groups : SambaUser
Home : /dev/null
Shell : /usr/sbin/nologin
Locked : no

Add a Samba password:

smbpasswd -a SambaUser

Now we edit the Samba service in smb.conf located at /usr/local/etc/smb.conf with…

[SambaUserdir]
comment = SambaUser's Network Drive
path = /path/to/directory
valid users = SambaUser
public = no
writeable = yes
printable = no

Be sure to create the directory (/path/to/directory) and make that writable to the SambaUser.

To test your server, you should be able to do this:

# smbclient -L 127.0.0.1 -U SambaUser

If no errors, then you are good to go. If you get an error, please refer to Samba’s site, or you can google the error message.

We can start Samba now with this:

# /usr/local/etc/rc.d/samba.sh start

Now we mount the drive. Create the directory in the client machine where you would like the mounted network drive at, and then mount it. (NOTE: Below is all one line)

mount_smbfs -I 192.168.0.2 //SambaUser@ServerName/SambaUserdir /path/to/mount

That’s pretty much it!!

Done!!

Reinstalling PHP

So you want to reinstall PHP??

This is how you would reinstall php, for whatever reason, and keep the same config options.
First of all, you need to find out what ./configure options you used to install PHP in the first place. Go to the source folder, usually /usr/local/php-(version number). Open up config.status in your favorite editor and copy the ./configure line, which is probably at or around line 7.

Change directory into the PHP source folder. Run a clean, distclean, patch (if needed), configure (with the same options as in the config.status file), make, install, and finally restart apache.

# make clean
# make distclean
# ./configure (paste from config.status file)
# make && make install
# apachectl restart

Done!!

Fresh Install From Scratch

OK..Roll up your sleeves. It’s time to get dirty (not as dirty as installing KDE via ports though). So here we go.

I’m just going to talk about post-installation. Yeah, yeah, I’ll get to the install later. Anyway, the first thing I install is cvsup. You can install this via ports:

# cd /usr/ports/net/cvsup-without-gui && make install clean

I installed cvsup-without-gui because, well, I never actually used just cvsup.

After it installs, it will create a ports-supfile file at

/usr/share/examples/cvsup/ports-supfile

or

/usr/src/share/examples/cvsup/ports-supfile.

Just copy it to your root folder. Then, just change

*default host=CHANGETHIS.FreeBSD.org

to a cvsup server near you. To find a cvsup server near you, just go to

After that, run cvsup:

# /usr/local/bin/cvsup /root/ports-supfile

Oh yeah, if you are behind a firewall, make sure to open port 5999.

Done!!