Hello. My name's Kate. I love Linux, WordPress - own a WordPress dedicated design studio, a beginner entrepreneur who co-founded Asia software company. This is where i blog about Linux, WordPress, daily life and other interesting stuff
Status: available

You are on the archives for the CentOS/RHEL category.

OUR CATEGORY : CentOS/RHEL

New Information:Updating Plesk 7.5.4 (Plesk 7.5 Reloaded) PHP (4) and MySQL (3) to PHP 5.0 and MySQL 4.1

Has been 4 days since my last post, i had (tons of) things to do from my office, so i didn’t have time to update Nineteen Labs. And now, I’m back with few information to update, such as updating PHP and MySQL.

I stopped httpd and plesk/psa and, started them again after yum update on how to Update Plesk 7.5.4 (Plesk 7.5 Reloaded) PHP and MYSQL (i have new information, read this post).This must be working in a situation below :

  • CentOS/RHEL 4.x
  • Non VPS

The actions will be different in CentOS3/RHEL3 and VPS

  • Stop MySQL first before starting all process
    # /etc/rc.d/init.d/mysqld stop
  • Check yum packages available before running yum update
    # yum check-update
  • No need to update Open SSL, it depends on yum packages available
  • stop httpd only, do not stop psa/plesk after updating
    # /etc/init.d/httpd stop
    Stopping psa/plesk causing psa off
  • Add this : old_passwords=1 in /etc/my.cnf

The mbstring php extension error issue

After php and mysql updated, i logged on to phpMyAdmin,then phpMyAdmin shows an error, The mbstring PHP extension is not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.

Look for mbstring in the system
# yum search mbstring

Yum will inform you, if mbstring already installed or not. If not,

Install mbstring
# yum install php-mbstring

Restart server
# reboot

Update Plesk 7.5.4 (Plesk 7.5 Reloaded) PHP and Mysql (to PHP 5.0 and MySQL 4.1)

This post has some additional informations. There is new actions here while updating Plesk 7.5 Reloaded PHP and MySQL, add command old_passwords=1 in /etc/my.cnf (please read below)

Update PHP, MYSQL and OpenSSL
# yum update php
# yum update mysql
# yum update openssl

Stop httpd
# /etc/init.d/httpd stop

Stop plesk/psa
# /etc/init.d/psa stop

Start all of them (httpd,named and psa)
# /etc/init.d/psa start

Check PHP version
# rpm -q php

Check mySQL version
# rpm -q mysql

Update php and mysql library
libphp5.so located in /usr/lib/httpd/modules
mysql.so located in /usr/lib/php/modules

PHP
edit # vi /etc/httpd/conf.d/php.conf
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .inc .php5 .php .php4 .php3 .phtml

MySQL
edit # vi /etc/php.ini
in paths and directories
extension_dir = /usr/lib/php/modules
in dynamics extensions
Dynamic extension=mysql.so

edit # vi /etc/php.d/mysql.ini
extension=mysql.so

MySQL
edit # vi /etc/my.cnf
old_passwords=1

Stop httpd and psa, then start again (restart)

Remove CentOS httpd/CentOS Apache

Check whether httpd list in system services
# chkconfig --list

Turn off httpd service
# chkconfig --levels 235 httpd off

Search httpd
# rpm -qa httpd

Remove httpd
# rpm -e --noscripts httpd

Why do we want to remove httpd/apache? In this case, there are another httpd/apache packages installed in the system, somehow causing a trouble and we don’t use CentOS httpd/apache

Listing installed software in CentOS

Get list all installed software :
# rpm -qa > /tmp/installed.log
note : /tmp/installed.log -> log directory can be change to other directory

Search software in log
# grep 'psa' /tmp/installed.log

Remove or Deinstall Plesk

This is happening in one of servers, my colleagues used it as an experiment, install webmin and plesk at once. Plesk wasn’t perfectly install, so i have to clean this up.

Use deinstall plesk command
# /usr/local/psa/admin/bin/deinstall.sh deinstall

Since plesk isn’t a clean and perfect installation (too many components missing), then above command doesn’t work at all. Perhaps this is a special case, in normal situation above command probably work

So use ‘manual’ removal.
Look in to system startup to check whether there are any services belongs to plesk
# chkconfig --list

If there are no services status ‘on’ in system startup, let’s remove plesk (if there is services status ‘on’, stop services)

Since I don’t know what components (the titles of RPM packages) from plesk in the system, find that first
# yum search psa

Now removal process :
# rpm -e psa psa-qmail psa-proftpd psa-autoinstaller psa-hotfix2 psa-pylibplesk psa-proftpd-xinetd psa-selinux psa-courier-imap-add psa-libpam psa-api psa-imp psa-mailman-configurator psa-tomcat-configurator psa-spamassassin psa-locale-base-en-US psa-logrotate psa-php4-configurator psa-horde

There are dependencies error, removal process stop

# rpm -e --nodeps psa

The –nodeps option tells the rpm command to skip the test of dependencies. Only psa removed in command, since dependencies error said psa needed by all components, and psa removed first. Then there is error: %trigger scriptlet failed warning, use :

rpm -q psa --triggers

this –triggers check what happen

then remove using :
rpm -e psa --notriggers

–notriggers ask rpm to remove psa without running the triggers

Plesk is really messed, above command doesn’t work also (i don’t know what my colleague did when he handled that server) so:

rpm --force -e psa
PSA removed, then remove other components (packages)

rpm -e psa-qmail psa-proftpd psa-autoinstaller psa-hotfix2 psa-pylibplesk psa-proftpd-xinetd psa-selinux psa-courier-imap-add psa-libpam psa-api psa-imp psa-mailman-configurator psa-tomcat-configurator psa-spamassassin psa-locale-base-en-US psa-logrotate psa-php4-configurator psa-horde

Shows up %preun and %postun scriptlets error, then

rpm -e --noscripts psa-qmail psa-proftpd psa-autoinstaller psa-hotfix2 psa-pylibplesk psa-proftpd-xinetd psa-selinux psa-courier-imap-add psa-libpam psa-api psa-imp psa-mailman-configurator psa-tomcat-configurator psa-spamassassin psa-locale-base-en-US psa-logrotate psa-php4-configurator psa-horde

Plesk components or packages removed

In normal situation, according to SWSOFT, to deinstall plesk just do following :
1. Need to know the titles of RPM packages
2. To deinstall run the command rpm -e

Now after plesk components removed,
1. Check and delete all databases and database tables used by Plesk
drop database psa;
drop database horde;

2. Open /etc/psa/psa.conf and look up the value assigned to the ‘HTTPD_VHOSTS_D’ variable, and delete : # rm-rf /directory-name/*
3. Delete all data related to mailboxes
# rm -rf /var/qmail/mailnames/*
4. Delete other directories used by plesk
# rm -rf /usr/local/psa
# rm -rf /etc/psa
# rm -rf /var/mailman
# rm -rf /var/drweb
# rm -rf /var/lib/wabalizer
# rm -rf /var/tomcat4 or # rm -rf /var/tomcat5

a command to ’shutdown’ proftpd (permanent/temporarily)

Someday, i want to ‘close’ proftpd. But i’ve found that stopping and restarting proftpd are complicated tasks, and a consideration that i can ‘reactivate’ proftpd again in the future, use ftpshut. This also useful in situation where filesystem maintainenance or work needs to be done in the area from which the FTP server is serving files .

#/usr/local/sbin/ftpshut -l 1 -d 1 0901

Synopsis
ftpshut [ -l min ] [ -d min ] time [ warning-message ]

Options
time
The time at which the ftp servers will be brought down. It may be the word `now’, indicating an immediate shutdown, or a future time in one of two formats: +number or HHMM. The first form brings the servers down in number minutes, while the second form indicates an exact time of day, using a 24-hour clock format.

-l min
Specifies the number of minutes before shutdown that new ftp access will be disabled. If the -l option is not specified, a default of 10 minutes (or immediately, if less than 10 minutes remains until shutdown) is used.

-d min
Specifies the number of minutes before shutdown that existing ftp connections will be disconnected. If the -d option is not specified, a default of 5 minutes (or immediately, if less than 5 minutes remains until shutdown) is used.

warning-message
Optionally provide a message which will be sent to new connections (if denied) and existing connections (when disconnected). The message can contain the following magic cookies, which will be replaced as follows before being sent to new or existing connections:
%s : time proftpd is being shut down
%r : time new connections will be denied
%d : time current connections will be dropped
%C : current working directory (where applicable)
%L : local host name (of virtualhost name)
%R : remote host name
%T : local time (format Thu Nov 15 17:12:42 1990)
%U : username given at login time

In case above, i don’t need a warning message, so there are no warning message. This is important, Proftpd servers can only be shutdown via ftpshut if a master daemon is running in standalone mode

ftpshut create file shutmsg (/etc/shutmsg)

Reactivate proftpd
Delete file shutmsg

Stop postgresql

PostgreSQL is a powerful, open source relational database system.It offers an alternative to other database systems, such mySQL.

In this case, i want to stop postgresql, both services and system startup
# chkconfig --list
# chkconfig --levels 235 postgresql off
# service postgresql stop

To turn on system startup and start postgresql

# chkconfig --levels 235 postgresql on
# service postgresql start

This site powered : WordPress. Made with PC (sorry, MAC), Coffee and Tofu