Вы находитесь на странице: 1из 2

Running Older PHP Versions on FreeBSD 11 | Shami's Blog https://shami.blog/2018/02/running-older-php-versions-on-freebs...

Shami's Blog
Sysadmin, Because Even Developers Need Heroes

Mohammad H. Al-Shami, 2019

1 of 2 04/06/19 00:23
Running Older PHP Versions on FreeBSD 11 | Shami's Blog https://shami.blog/2018/02/running-older-php-versions-on-freebs...

Running Older PHP Versions on FreeBSD


11
2018-02-19 by Mohammad H. Al-Shami

Why? You might ask yourself. Isn’t it just better to upgrade the web application and
save yourself the trouble of all the security issues? True, but sometimes it’s just not
possible or feasible. The other day I helped a friend of mine migreate from a VPS
he got in 2008 to a brand new FreeBSD 11 droplet on DigitalOcean. His customer
has still not updated their site, and they were paying the same rate they’ve been
paying since 2008. So it was better and cheaper to move them to a new VPS even
though we kept the same code. At least the OS and all other components in the
stack were updated.

First thing’s first. I maintain my own repo using Poudriere. So all installed packages
come from that. We’ll install everything from there except for PHP. I will be installing
both PHP 4.4 and PHP 5.2 (That’s what we used for the droplet).

We’ll be using FreeBSD 11.1. Also, we’ll be using jails to keep any security issues
with PHP from affecting the whole server. We’ll use NAT to provide internet access
to the jails.

Add a private network to the server, this will be used for communication between
the jails and the host

# /etc/rc.conf
cloned_interfaces="lo1"
ipv4_addrs_lo1="192.168.0.1/24"
gateway_enable="YES"
pf_enable="YES"
iocage_enable="YES"

Configure pf to NAT

# /etc/pf.conf
ext_if="MAIN_INTERFACE"
jail_if="lo1"

IP_PUB="YOUR_PUBLIC_IP_ADDRESS"

scrub in all

# nat all jail traffic


nat pass on $ext_if from 192.168.0.0/24 to any -> $IP_PUB

2 of 2 04/06/19 00:23

Вам также может понравиться