dd if=/dev/zero of=/usr/swap0 bs=1m count=128

chmod 0600 /usr/swap0

echo ‘md99 none swap sw,file=/usr/swap0 0 0’ >> /etc/fstab

swapon -aq

张贴在<a href="" rel="category tag">*BSD</a> 标签:<a href="" rel="tag">FreeBSD</a>、<a href="" rel="tag">设置swap分区</a> 发表回复


cd /usr/ports/sysutils/fusefs-ntfs && make BATCH=yes install clean
pkg install fusefs-ntfs
Then add to /boot/loader.conf

Now run it:

/usr/local/etc/rc.d/fusefs start

Now – make dir for NTFS partition, for example:

mkdir /mnt/ntfs

Now – you can mount your NTFS in rw mode:

ntfs-3g -o rw,locale=zh_CN.UTF-8 /dev/ada0s3 /mnt/ntfs

After all – add to /etc/fstab:

/dev/ada0s1 /mnt/ntfs ntfs-3g rw,locale=zh_CN.UTF-8, mountprog=/usr/local/bin/ntfs-3g,uid=1001,gid=1001,late 0 0

张贴在<a href="" rel="category tag">*BSD</a> 标签:<a href="" rel="tag">FreeBSD</a>、<a href="" rel="tag">mount ntfs</a> 发表回复

FreeBSD pkg仓库台湾的镜像 在这个页面上可以看到:

张贴在<a href="" rel="category tag">*BSD</a> 标签:<a href="" rel="tag">FreeBSD</a>、<a href="" rel="tag">pkg台湾镜像</a> 发表回复


第一步:ee /ec/rc.conf中加入




killall sendmail


pkg install ssmtp

ee /etc/mail/mailer.conf

sendmail /usr/libexec/sendmail/sendmail
send-mail /usr/libexec/sendmail/sendmail
mailq /usr/libexec/sendmail/sendmail
newaliases /usr/libexec/sendmail/sendmail
hoststat /usr/libexec/sendmail/sendmail
purgestat /usr/libexec/sendmail/sendmail

sendmail /usr/local/sbin/ssmtp
send-mail /usr/local/sbin/ssmtp
mailq /usr/libexec/sendmail/sendmail
newaliases /usr/libexec/sendmail/sendmail
hoststat /usr/libexec/sendmail/sendmail
purgestat /usr/libexec/sendmail/sendmail

pw useradd ssmtp -g nogroup -h – -s /sbin/nologin -d /nonexistent -c “sSMTP pseudo-user”


cd /usr/local/etc/ssmtp

chown ssmtp:wheel .

chmod 4750 .


cp ssmtp.conf.sample ssmtp.conf

chown ssmtp:wheel . ssmtp.conf

chmod 640 ssmtp.conf

cp revaliases.sample revaliases
chown ssmtp:nogroup /usr/local/sbin/ssmtp
chmod 4555 /usr/local/sbin/ssmtp

测试:echo “test” | mail -v -s “test mail”

张贴在<a href="" rel="category tag">*BSD</a> 标签:<a href="" rel="tag">FreeBSD</a>、<a href="" rel="tag">SSMTP</a> 发表回复

FreeBSD 10: Installing Apache 2.4, MySQL 5.5, and PHP5.5 — 找不到

今天装freebsd 10,然后装apache,再装php和php扩展.没有问题.


刚开始以为php5安装错误了,于是又重新安装一次,发现安装php5时里面没有apache选项了,整了半天也没有发现原因,以前用freebsd8配置apache+php+mysql从来没出现过这种问题,就再试一下php53目录,make config-recursive看看里面是有apache选项的,郁闷,于是又出墙google,终于找到答案了,ls /usr/local/libexec/apache22/ 没找到


make install clean;rehash安装,可是又遇到问题了,提示“Error from apache22 is installed (or APACHE_PORT is defined) and port requires apache”,郁闷之极,只能再google,呵呵,又被我找到答案了,万能的google啊,谢谢!关于“Error from apache22 is installed (or APACHE_PORT is defined) and port requires apache”请参考这篇文章

张贴在<a href="" rel="category tag">*BSD</a> 标签:<a href="" rel="tag">freebsd10</a>、<a href="" rel="tag">Installing Apache 2.4</a>、<a href="" rel="tag"></a>、<a href="" rel="tag">MySQL 5.5</a>、<a href="" rel="tag">PHP5.5</a> 发表回复

FreeBSD 11 on Raspberry Pi

Install FreeBSD 11 on a Raspberry Pi


It seems a nice project to try out FreeBSD on a Raspberry Pi.

There are ready made images available from, so this is not very hard to accomplish. Both for FreeBSD 10 as well as for FreeBSD 11. Feeling wild, I choose for FreeBSD 11 🙂

The image can be downloaded from the FreeBSD ftp-servers.

Bunzip your image and dd it to a SD-card


I got the FreeBSD-11.0-CURRENT-arm-armv6-RPI-B-20140811-r269824.img.bz2 but perhaps when you read this there are allready newer images available.

On a Debian GNU/Linux laptop I ran the command:

bunzip2 FreeBSD-11.0-CURRENT-arm-armv6-RPI-B-20140811-r269824.img.bz2

Followed by:

dd if=FreeBSD-11.0-CURRENT-arm-armv6-RPI-B-20140811-r269824.img of=/dev/mmcblk0 bs=1M

Be carefull when you issue this last command, when you got the of= part wrong, you might inreversable destroy things!

Now you have a 1Gb big image on your SD card.

Put the SD card in the Raspberry Pi and power up.

The very first time you boot FreeBSD on your Raspberry Pi it seems to take ages before you get a prompt. This is because FreeBSD is expanding the partion to fill your whole SD card. In my case it was a 8 Gb SD card. I rebooted the thing and now it did not take that long to give you a prompt.

When you have a prompt, press enter and log on as root, with an empty password (just hit Enter on the password prompt).

Now you first need to add a user, make that part of the group “wheel” and give this user a password. This is needed in order to log on to your FreeBSD Raspberry Pi over ssh.

Set fixed address

Default your FreeBSD Raspberry Pi will get its network configuration over DHCP. This is great if you want that, but I like my servers to have fixed addresses.

In /etc/rc.conf you can set the fixed address of the board and add a line with the default router:

ifconfig_ue0=”inet netmask″


Do not forget to check /etc/resolv.conf to see if this has the right nameserver(s).

Set timezone

Become root.

Make a symbolic link for your timezone to /etc:

ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime

Update the time on your board;

ntpdate -v -b

And edit /etc/rc.conf, add the following line:



Configure sshd


When your Raspberry Pi is connected to the internet, it is important to harden your sshd_config. The best is to disable password login, only allow public key authentication and only for restricted users. Something like “Match Group wheel” is a good start.

No pkg install


Unfortunately, installing pre-compiled binary packages with the new pkg will not work on your Raspberry Pi.

Hardware stability is an issue


I own several Raspberry Pies and not all of them are stable. Also the Raspberry Pi is notorious picky about the powersupply cable (USB cable) as well as the powersupply. Problems with the powersupply cable and the powersupply are hard to diagnose.

If you run into problems, the USB cable and the powersupply are the first things to check. I have seen Raspberries that, when powered on, only show a single, red, LED burning, with all the other LEDs are off. This often is the result of a USB-cable or power supply not playing nice with the Rapsberry – even if the same combination have run wihout problems for weeks.

On the other hand, there are also a couple Raspberries running in my network with high uptimes and never have shown any problem …

张贴在<a href="" rel="category tag">*BSD</a> 标签:<a href="" rel="tag">FreeBSD 11</a>、<a href="" rel="tag">Raspberry Pi</a> 发表回复

FreeBSD install shadowsocks-libev

cd /usr/ports/net/shadowsocks-libev

make install clean;rehash

ee /etc/rc.conf 加入

shadowsocks_libev_flags=”-c /usr/local/etc/shadowsocks-libev/config.json”


“server_port”:1234,             //服务端端口
“local_address”: “”,
“local_port”:4321,                 //客户端端口
“password”:”password”,      //客户端连接密码
“method”:”aes-256-cfb”     //加密方式



最后设置浏览器代理。Chrome 推荐使用 SwitchySharp 切换代理设置。把浏览器代理设为下列参数即可:

协议: socks5


端口: 你填的 local_port

service shadowsocks-libev restart


张贴在<a href="" rel="category tag">*BSD</a> 标签:<a href="" rel="tag">FreeBSD</a>、<a href="" rel="tag">shadowsocks-libev</a> 发表回复