Jail: web

one time

create jail
export JAIL=web
export JAILHOSTNAME=web
export JAILDOMAIN=ahlawat.com
export JAILIP=51
export JAILUSER=X
export JAILUSERID=1000
export JAILUSERVNC=false

/root/FreeBSD/jails/create.sh $JAIL $JAILHOSTNAME $JAILDOMAIN $JAILIP $JAILUSER $JAILUSERID $JAILUSERVNC

iocage exec $JAIL "pkg install -r pkgp123 apache24 apr openldap26-client php83-ldap"
iocage exec $JAIL "pkg lock -y openldap-sasl-client"
## check php73-ldap is still installed after an upgrade - it gets autodelted sometimes

iocage exec $JAIL "pkg install -y php83 php83-bcmath php83-ctype php83-curl php83-dom php83-exif php83-fileinfo php83-filter php83-ftp php83-iconv php83-mbstring php83-mysqli php83-gd php83-session php83-sockets php83-sodium php83-tokenizer php83-xml php83-zip php83-zlib"

#iocage exec $JAIL "pkg install -y apr apache24 php81"
#php81-mysqli php81-session for phpadmin/adminer
#php81-xml php81-gd php81-ftp php81-curl php81-tokenizer php81-zlib php81-zip for wordpress
#php81-sockets required for akismet plugin
#php81-filter required for caxton plugin
#php81-exif required for "ultimate member"
#php81-ctype required for wpForo

iocage exec $JAIL "sysrc apache24_enable=YES"
iocage exec $JAIL "cp /mnt/config/httpd.conf /usr/local/etc/apache24/"
iocage exec $JAIL "cp /mnt/config/020_mod_ssl.conf /usr/local/etc/apache24/modules.d/"
iocage exec $JAIL "cp /mnt/config/php.ini /usr/local/etc/php.ini"

iocage exec $JAIL "sysrc php_fpm_enable=YES"
iocage exec $JAIL "cp -f /mnt/config/www.conf /usr/local/etc/php-fpm.d/"
iocage exec $JAIL "service php-fpm start"

iocage exec $JAIL "service apache24 restart"

# manual install
#iocage exec $JAIL "pkg install -y rainloop-community-php81"

iocage exec $JAIL "cp /mnt/config/htaccess-rainloop /usr/local/www/rainloop/data/.htaccess"
iocage exec $JAIL "ln -s /usr/local/www/rainloop/ /usr/local/www/apache24/data/mail"
iocage exec $JAIL "cp /mnt/config/secret/application.ini /usr/local/www/rainloop/data/_data_/_default_/configs"
iocage exec $JAIL "cp /mnt/config/plugin-ldap-change-password.ini /usr/local/www/rainloop/data/_data_/_default_/configs"
iocage exec $JAIL "cp /mnt/config/ahlawat.com.ini /usr/local/www/rainloop/data/_data_/_default_/domains"
iocage exec $JAIL "cp /mnt/config/disabled /usr/local/www/rainloop/data/_data_/_default_/domains"


# update dns (bind) and proxy (haproxy) configurations if required

Notes:
cd /usr/local/www/apache24/data/
wget https://wordpress.org/latest.tar.gz
tar -xvzf /mnt/config/latest.tar.gz
mv wordpress XYZ

chown -R www:www /usr/local/www/apache24/data

INTERIM: pkg lock libxml2 - mismatch in php packages - 8.1.5 vs 8.1.4 

pkg install apache24 apr openldap24-client php81-ldap \
php81 php81-bcmath php81-ctype php81-curl php81-dom php81-exif php81-fileinfo php81-filter php81-ftp php81-iconv php81-mbstring php81-mysqli php81-gd php81-session php81-sockets php81-sodium php81-tokenizer php81-xml php81-zip php81-zlib \
bash bash-completion nano




Showcased here is a capital and operational cost effective approach, using minimal server and networking hardware with multiple virtualized applications for Home and Business. This solution template can be easily scaled out and adapted for larger Enterprise deployments.
drop by the diyIT Matrix public room at #diyit:matrix.ahlawat.com
if you have any IT questions/feedback or to request pro bono consulting for a nonprofit

message me privately at @sharad:matrix.ahlawat.com
or email me at - sharad@ahlawat.com - pgpkey: 68DD6B89
Networking and Security Technologist.
EngineerĀ andĀ an avid Programmer.

https://sharad.ahlawat.com
strive to learn and pass on the knowledge to the next generation
one day humanity will understand the meaning of life and hopefully it will be more than ASCII 42 = "*" regex for whatever you want it to be,
and destiny is more than just a roll of a pair of dice with 42 dots (Lets nail down Quantum Entanglement)

May you Live Long (Intelligently) and Prosper and work on technology that matters.
© 2024 Sharad Ahlawat

No personal identifying data is collected or any form of analytics/metrics reported to a third-party by this website.