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
# rpm -qa | grep mysql
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.
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.
For partition I choose to use all disk space.
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 :
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
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
15G 3,4G 10G 26% /
/dev/vda1 200M 15M 175M 8% /boot
tmpfs 393M 0 393M 0% /dev/shm
# rpm -qa | grep php
# rpm -qa | grep mysql
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 .