Help - Setup Squid Proxy Cache & Webmin on Nas4Free
Posted: 14 Feb 2013 16:44
Hi Guys,
I am just trying to get a Jail running so that i can install squid and webmin to administer squid. squid's cache will probably be big so installing it on the 16gb memory stick would not be an option as it will probably fill up very quickly, it has to run on the data drive on ZFS
Senario: ZFS pool (called pool), dedicated dataset for the jail (called pjail), so what you would see is the following: /mnt/pool/pjail/.....
I did the following:
mkdir /jail
mkdir /mnt/pool/pjail/jail
mkdir /mnt/pool/pjail/jail/{work,proto,conf}
mount_nullfs /mnt/pool/pjail/jail /jail
cd /jail/work
fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/`uname -m`/`uname -m`/`uname -r | cut -d- -f1-2`/base.txz
fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/`uname -m`/`uname -m`/`uname -r | cut -d- -f1-2`/lib32.txz
tar xvf /jail/work/base.txz -C /jail/proto/
tar xvf /jail/work/lib32.txz -C /jail/proto/
cd /jail
mkdir -p conf/root/{etc/rc.d/,usr/bin,usr/sbin}
cp proto/etc/rc.d/jail conf/root/etc/rc.d/
cp proto/usr/sbin/{jail,jexec,jls} conf/root/usr/sbin/
cp proto/usr/bin/mktemp conf/root/usr/bin/
cp /etc/resolv.conf /jail/proto/etc/
touch /jail/conf/fstab.proto
cp /jail/proto/usr/share/zoneinfo/Europe/London /jail/proto/etc/localtime
nano conf/rc.conf.local
jail_enable="YES" # enable jails YES|NO
jail_list="proto" # name of the jails to start "proto http://www...
jail_proto_rootdir="/jail/proto" # path to our jail
jail_proto_hostname="proto.local" # hostname
jail_proto_ip="192.168.100.20" # ip of the jail
jail_proto_interface="em0" # Network Interface to use, replace on your NAS interface name
jail_proto_devfs_enable="YES" # use devfs
jail_proto_mount_enable="YES" # mount YES|NO
jail_proto_fstab="/jail/conf/fstab.proto" # File with Filesystems to mount
nano /jail/conf/jail_start
#!/bin/tcsh -x
#mounting to /jail
mount_nullfs /mnt/data/jail /jail
# Attach jail files to /usr and /etc
mount_unionfs /jail/conf/root/etc/ /etc
mount_unionfs /jail/conf/root/usr/ /usr
rehash
#start all jails
/etc/rc.d/jail start
chmod 777 /jail/conf/jail_start
Questions:
1. Why can't someone just get the jail functionality that is in freenas ported into nas4free, it took me 5 minutes on freenas to get jail functionality working, surely you can make it easier, especially for newbes, to get it up and running?
2. When my server reboots i noticed when it comes to the point when it is supposed to run the postini script to start the jail, it says file not found, possibly due to ZFS not being loaded yet ? How do i get around this ?
I have been at this from 8am to 4pm and I am more than just $%^$&$£ frustrated.
Regards
DC
I am just trying to get a Jail running so that i can install squid and webmin to administer squid. squid's cache will probably be big so installing it on the 16gb memory stick would not be an option as it will probably fill up very quickly, it has to run on the data drive on ZFS
Senario: ZFS pool (called pool), dedicated dataset for the jail (called pjail), so what you would see is the following: /mnt/pool/pjail/.....
I did the following:
mkdir /jail
mkdir /mnt/pool/pjail/jail
mkdir /mnt/pool/pjail/jail/{work,proto,conf}
mount_nullfs /mnt/pool/pjail/jail /jail
cd /jail/work
fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/`uname -m`/`uname -m`/`uname -r | cut -d- -f1-2`/base.txz
fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/`uname -m`/`uname -m`/`uname -r | cut -d- -f1-2`/lib32.txz
tar xvf /jail/work/base.txz -C /jail/proto/
tar xvf /jail/work/lib32.txz -C /jail/proto/
cd /jail
mkdir -p conf/root/{etc/rc.d/,usr/bin,usr/sbin}
cp proto/etc/rc.d/jail conf/root/etc/rc.d/
cp proto/usr/sbin/{jail,jexec,jls} conf/root/usr/sbin/
cp proto/usr/bin/mktemp conf/root/usr/bin/
cp /etc/resolv.conf /jail/proto/etc/
touch /jail/conf/fstab.proto
cp /jail/proto/usr/share/zoneinfo/Europe/London /jail/proto/etc/localtime
nano conf/rc.conf.local
jail_enable="YES" # enable jails YES|NO
jail_list="proto" # name of the jails to start "proto http://www...
jail_proto_rootdir="/jail/proto" # path to our jail
jail_proto_hostname="proto.local" # hostname
jail_proto_ip="192.168.100.20" # ip of the jail
jail_proto_interface="em0" # Network Interface to use, replace on your NAS interface name
jail_proto_devfs_enable="YES" # use devfs
jail_proto_mount_enable="YES" # mount YES|NO
jail_proto_fstab="/jail/conf/fstab.proto" # File with Filesystems to mount
nano /jail/conf/jail_start
#!/bin/tcsh -x
#mounting to /jail
mount_nullfs /mnt/data/jail /jail
# Attach jail files to /usr and /etc
mount_unionfs /jail/conf/root/etc/ /etc
mount_unionfs /jail/conf/root/usr/ /usr
rehash
#start all jails
/etc/rc.d/jail start
chmod 777 /jail/conf/jail_start
Questions:
1. Why can't someone just get the jail functionality that is in freenas ported into nas4free, it took me 5 minutes on freenas to get jail functionality working, surely you can make it easier, especially for newbes, to get it up and running?
2. When my server reboots i noticed when it comes to the point when it is supposed to run the postini script to start the jail, it says file not found, possibly due to ZFS not being loaded yet ? How do i get around this ?
I have been at this from 8am to 4pm and I am more than just $%^$&$£ frustrated.
Regards
DC