On the VPS (CentOS), after running the following commands,
[root@yukiko local]# pwd
/usr/local
[root@yukiko local]# ls
Zend apache bin etc games include lib lib64 libexec man mysql php sbin share src var
[root@yukiko local]# find / -iname httpd.conf
/usr/local/apache/conf/httpd.conf
/usr/local/apache/conf/original/httpd.conf
[root@yukiko local]# find / -iname php
/usr/local/php
/usr/local/php/lib/php
/usr/local/php/include/php
/usr/local/php/bin/php
[root@yukiko local]# /usr/local/php/bin/php -v
PHP 5.2.9 (cli) (built: Mar 18 2009 01:02:07)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
[root@yukiko local]# yum list installed | grep php
[root@yukiko local]# yum list installed | grep apache
[root@yukiko local]# yum list installed | grep mysql
I suspect that apache, mysql and php were not installed using yum. I don't know how they were installed but they were already there since day one the VPS was rented. Now I would like to know how to upgrade them to newer version to be safe from security holes.
Currently, in phpmyadmin, I already found there are three databases (information_schema, mysql, webmail_horde) and the /home/httpd/html/htdocs/ folder also contains some webpage files of this VPS admin web interface (allows the start, stop, restart...etc of the VPS).
Since they were not installed using yum, I cannot use yum update to upgrade them.
I also heard that there are some couplings among apache, mysql and php. How can we upgrade them safely?
Many thanks to you all.
Try this:
If you don't see the packages listed in that output, then you can generally be assured that those services were not installed using RPM (yum uses RPM packages).
The good news is that you probably can install the RPM versions of these utilities using RPM, and they won't conflict with your currently installed versions, since they'll install in different directories than the ones you have listed (at least on CentOS) -- just make sure to backup your important configuration files and the init script. You could then edit the configuration files side-by-side, to make sure that the new version is set up like the old version.
The bad news is that the stock RPM versions of apache and PHP may not support the full feature set of the hand-compiled software. Certain features, such as XSLT are not part of most apache RPM compilations. Also, the stock RPM versions may be older than what you currently are using. CentOS, for example, only ships with Apache 2.2.3 and PHP 5.1.6.
If they weren't installed via yum, your only choice is stop the old server, install the new via yum, copy the content and config files.