Today task is little different. Old php script that run on PHP 5.2.9 and utilize mysql 5.0.88 need to rebuild in other place. That way another group of developer can add or inspect why new injected code can behave odd in such environment (they already try new code using newer PHP and it work well).
As far I can see from server log in message its Fedora 10 and using old PHP and old Mysql version. I need to replicate it in some place. Where we (I and developer) can log in and see it together.
Target for this server is same php and same mysql version :
#rpm -qa | grep php
php-common-5.2.9-2.fc10.i386
php-pgsql-5.2.9-2.fc10.i386
php-pecl-apc-3.0.19-1.fc10.i386
php-5.2.9-2.fc10.i386
php-gd-5.2.9-2.fc10.i386
php-mysql-5.2.9-2.fc10.i386
php-ldap-5.2.9-2.fc10.i386
php-mbstring-5.2.9-2.fc10.i386
php-mcrypt-5.2.9-2.fc10.i386
php-odbc-5.2.9-2.fc10.i386
php-pear-1.7.2-2.fc10.noarch
php-cli-5.2.9-2.fc10.i386
php-pdo-5.2.9-2.fc10.i386
phpMyAdmin-3.2.3-1.fc10.noarch
# rpm -qa | grep mysql
mysql-5.0.88-1.fc10.i386
mysql-server-5.0.88-1.fc10.i386
php-mysql-5.2.9-2.fc10.i386
mysql-connector-odbc-3.51.26r1127-1.fc10.i386
libdbi-dbd-mysql-0.8.3-2.fc10.i386
mysql-libs-5.0.88-1.fc10.i386
VPS is my option and Vultr (I choose $5/month specs that come with 15GB SSD storage and 768MB memory) can help me for this case .
Log in to Vultr and upload iso
Since I need to replicate it with minimum hassle I decide to use 64 bit in DVD format.
Create Server
After iso file successfully uploaded then I Choose custom iso selected Fedora 10 file.
After hit ‘deploy server’ wait for moment to take control.
Install Fedora Server in VPS
In case you see ipxe message in ‘console’ then you must make sure iso file attached. Check from virtual iso menu. If it’s not then select Fedora images and click ‘attach iso and reboot’ button.
This view is the right one.
Go back to manage server menu and choose ‘console’ link. If you see this then iso attach process working well.
The rest of installation step is as usual.
For partition I choose to use all disk space.
Web server and repositories (installation repo, Fedora 10 -x86_64 and updates).
Reboot and configure it for first time as usual till you see this view (already login)
Disable GUI login and X-Window on Fedora
Yes, of course its server. No X windows please 🙂
Open terminal from console and edit /etc/inittab and change this line :
id:5:initdefault:
into
id:3:initdefault:
save.
In this stage also make sure to remove iso from custom iso menu for this server.
After server reboot you’ll see no more X-Window.
Control Fedora Server using ssh
By default ssh server already installed and running. Vultr system will make sure right ip assigned for this VPS and you just need to access it from ipv4 provided.
free -m
# free -m
total used free shared buffers cached
Mem: 748 169 578 0 6 57
-/+ buffers/cache: 105 642
Swap: 1503 0 1503
# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
15G 3,4G 10G 26% /
/dev/vda1 200M 15M 175M 8% /boot
tmpfs 393M 0 393M 0% /dev/shm
Check PHP
# rpm -qa | grep php
php-5.2.9-2.fc10.x86_64
php-ldap-5.2.9-2.fc10.x86_64
php-common-5.2.9-2.fc10.x86_64
php-pdo-5.2.9-2.fc10.x86_64
php-cli-5.2.9-2.fc10.x86_64
php-mysql-5.2.9-2.fc10.x86_64
Check MySQL
# rpm -qa | grep mysql
mysql-libs-5.0.88-1.fc10.x86_64
php-mysql-5.2.9-2.fc10.x86_64
I can see the result is different. I use 64 bit while existing server use 32 bit and few extension not installed. In general Vultr can help me rebuild the server. I just need to more careful and diligent 🙂
# yum install php-gd php-mcrypt php-mbstring php-pecl-apc mysql-server
For iptables etc remain same as Install PHP 5.2.17 on CentOS 5.10.
For Selinux case I prefer to disable it :
# nano /etc/selinux/config
change enforcing to disabled .