Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

Try this:

rpm -qa | egrep '(http|php)'

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.

share|improve this answer
    
I tried running this command: rpm -qa | egrep '(http|php)' and nothing was shown, I now can be sure they were not installed using RPM. You are exactly correct, when I run yum install php, I can see the stock RPM versions of apache and PHP, and yum asked me if I'd like to download and install them. If I really want to upgrade apache, mysql and php to new versions, what steps do you suggest I should take? –  bobo Feb 7 '10 at 15:40
    
If you REALLY want new versions, and want RPMs, you'll either have to build them yourself, or find a repository that builds them for you. I suggest: jasonlitka.com/yum-repository. You might encounter the problem that Jason's custom build may not include all the modules that your hand-compiled version has. Remember to back up your configuration files! –  Joe Feb 7 '10 at 15:57
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.