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 :
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
For Plesk 7.5 Reloaded with PHP version 5.0 :
Download php-mcrypt package
# wget http://3es.atomicrocketturtle.com/atomic-testing/art/4ES/RPMS/php-mcrypt-5.0.4-14.rhel4.art.i386.rpm
Install php-mcrypt package
# rpm -i php-mcrypt-5.0.4-14.rhel4.art.i386.rpm --nodeps
Note : –nodeps needed to avoid ‘failed dependencies’ warning
For Plesk 7.5 Reloaded without PHP version 5.0 (still in original version) :
# wget http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
# rpm --import RPM-GPG-KEY.dag.txt
# wget http://dag.wieers.com/rpm/packages/libmcrypt/libmcrypt-devel-2.5.7-1.2.el4.rf.i386.rpm
# rpm -i libmcrypt-devel-2.5.7-1.2.el4.rf.i386.rpm
# wget http://dag.wieers.com/rpm/packages/libmcrypt/libmcrypt-2.5.7-1.2.el4.rf.i386.rpm
# rpm -i libmcrypt-2.5.7-1.2.el4.rf.i386.rpm
# wget http://dag.wieers.com/rpm/packages/libmhash/libmhash-0.9.1-1.2.el4.rf.i386.rpm
# rpm -i libmhash-0.9.1-1.2.el4.rf.i386.rpm
# wget http://dag.wieers.com/rpm/packages/libmhash/libmhash-devel-0.9.1-1.2.el4.rf.i386.rpm
# rpm -i libmhash-devel-0.9.1-1.2.el4.rf.i386.rpm
# wget http://prdownloads.sourceforge.net/phprpms/php-mhash-4.3.9-3.2.1.i386.rpm?download
# rpm -i php-mhash-4.3.9-3.2.1.i386.rpm
# http://prdownloads.sourceforge.net/phprpms/php-mcrypt-4.3.9-3.2.1.i386.rpm?download
# rpm -i php-mcrypt-4.3.9-3.2.1.i386.rpm
This installation produced “/etc/php.d/mcrypt.ini” as an additional .ini files which contains extension=mcrypt.so. mcrypt.so�is�in /usr/lib/php4 directory. You should copy mcrypt.so to /usr/lib/php/modules (# cp mcrypt.so /usr/lib/php/modules)
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
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)
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
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
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
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