For allow pings from jail need add over webgui
System|Advanced|sysctl.conf tab
MIB security.jail.allow_raw_sockets
Value 1
For run Apache under jail I make next.
1.Install webmin ( may be not need, but I wont work from webgui )
2. pkg_add -r apache22.
3. I correct webmin for Apache configuration tab
In line
Path to httpd.conf or apache2.conf I insert valid path
/usr/local/etc/apache22/httpd.conf
Under webmin gui I go to unused modules and open Apache tab
4 . Edit httpd.conf on global section
Load module section - I comment
Code: Select all
# LoadModule unique_id_module libexec/apache22/mod_unique_id.so
and add line with myjail IP
Now Apache ask load module accf_http.co
I exit from jail and go to /jail/work
Code: Select all
cd /jail/work
fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/`uname -m`/`uname -m`/`uname -r | cut -d- -f1-2`/kernel.txz
tar xvf /jail/work/kernel.txz -C /jail/proto/
OK I have module. Native it placed now on /mnt/data/jail//boot/kernel/ folder.
For run jail and Apache after start I modify jail startup script
Code: Select all
#!/bin/tcsh -x
#mounting to /jail
mkdir /jail
mount_nullfs /mnt/data/jail /jail
# copy jail binaries to /usr
cp -r /jail/conf/root/ /
# link config files to /etc
ln -s /jail/conf/rc.conf.local /etc
# Add module for Apache
ln -s /jail/proto/boot/kernel/accf_http.ko /boot/modules/accf_http.ko
kldload accf_http
#start all jails
/etc/rc.d/jail start
Manualy, without restart server, from NAS4Free root
Code: Select all
ln -s /jail/proto/boot/kernel/accf_http.ko /boot/modules/accf_http.ko
kldload accf_http
Now I go to webmin section
Bootup and Shutdown, check Apache22 and in bottom page push on button <Start now and on boot>
I have
It works! on My jail's IP under browser. Apache is installed