yum fails on my VPS / the RPM database on my VPS is corrupt

14 January, 2015 (19:01) | VPS | By: sblogadmin

Under certain conditions the RPM database used by yum will become corrupt. Here is how to resolve this issue. You may see an error such as “Warning: RPMDB altered outside of yum” or “error: rpmdbNextIterator”

1. Take a backup FIRST, before trying to have rpm repair the database.

cd /var/lib
tar zcvf /var/preserve/rpmdb-[today's date].tar.gz rpm

Verify integrity with

cd /var/lib/rpm
rm -f __db*      # to avoid stale locks
/usr/lib/rpm/rpmdb_verify Packages

Next run the following:

mv Packages Packages.orig
/usr/lib/rpm/rpmdb_dump Packages.orig | /usr/lib/rpm/rpmdb_load Packages
/usr/lib/rpm/rpmdb_verify Packages
rpm -qa

Finally rebuild the database:


rpm -vv --rebuilddb

for the error :


error: rpmdbNextIterator

run:


mv /var/lib/rpm/Pubkeys /var/lib/rpm/Pubkeys.backup
rpm --rebuilddb -vv to recreate the index.

from : https://bugzilla.redhat.com/show_bug.cgi?id=108915

reference : http://kbase.redhat.com/faq/docs/DOC-6904#

Quickly test various services using telnet

19 June, 2014 (18:27) | Advanced Topics | By: sblogadmin

If you are attempting to diagnose mail on your server or VPS, you can quickly test POP3 without setting up an account in a mail program using telnet :


telnet server-name.com 110

USER email_address@domain.com

PASS unencrypted-password here

LIST

where email_address@domain.com is the pop3 login your are testing. Usually this is the same as the email address.

 

List should return the messages number or a single period if no messages are available

Note that in this test the password is unencrypted. You should set a temporary test password during the test.

 

What is the quickest way to add development tools (compilers, etc.) to my VPS?

4 June, 2014 (18:08) | VPS | By: sblogadmin

Assuming you are using CentOS/Fedora/RedHat , as root type :

<pre>yum -y groupinstall ‘Development Tools'</pre>

If you are using a debian-based distribution, as root type :

<pre>apt-get -y install build-essential</pre>

 

Install newer python version

12 May, 2014 (14:19) | Python, shell | By: sblogadmin

Depending upon your server OS, you may find the Python version to be out-of-date. This is often due to the OS relying on a particular version for system scripts, etc.

 

On some servers we have installed additional python versions and named them python3, python2, etc. If your server does not have these you can request and install or you can make a private python install to your shell account.

 

It is quick and easy to install your own python version to your shared hosting shell account.

 

1. Download python (change this to the version you need)

 

wget https://www.python.org/ftp/python/3.4.0/Python-3.4.0.tgz

 

2. configure to use your local dirs:

 

./configure --prefix=$HOME/python

make

make install






php-cgi does not give proper 404 errors

8 May, 2014 (13:38) | CGI, php | By: sblogadmin

When using php-cgi via .htaccess you will find that missing files give “No input file specified” instead of a proper 404 error.

To fix this, add :

 

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule ^.+\.php$ /file_name_that_does_not_exist

to your .htaccess

replace “file_name_that_does_not_exist” with any file name that does not exist – ie. something that will trigger a 404 error.

 

 

How can I reset my email master password

14 December, 2013 (05:20) | mail, passwords | By: sblogadmin

I’ve lost my master email password – how can I retrieve it?

Due to the encryption, your passwords cannot be retrieved. However you can reset the master password : postmaster@your-domain.com in your control panel. You can then use the new password to administer/change/view/etc. all your other email accounts.

When you first login to the control panel, choose the link:

Password: change

this will bring you to a page to set a new password. It will set the new password for several parts of you account – including the postmaster@your-domain.com password. After you change the password, go to the Email section and select “Configure your email accounts”

 

Switching to php 5.4 causing my site to crash

4 September, 2013 (14:05) | php | By: sblogadmin

With versions 5.4 and onward, certain php.ini directives can cause your site to no longer load.

Make sure all references to the following are removed from your php.ini:

allow_call_time_pass_reference
magic_quotes_gpc

You can place a semi-colon in front of those lines to preserve the old values in case you need them for future reference.

;allow_call_time_pass_reference
;magic_quotes_gpc

Enabling apc (php alternative cache) on your Centos VPS

9 July, 2013 (18:05) | php, VPS | By: sblogadmin

Here is how to enabled php’s apc on a CentOS VPS:

1. yum -y install php-pear pcre-devel php-pear php-devel httpd-devel gcc
2. pecl install apc (press enter to accept the default response for each option)
3. echo “extension=apc.so” > /etc/php.d/apc.ini
4. service httpd restart
5. cp /usr/share/pear/apc.php /home/YOUR_USER_NAME/www/some_private_file_name.php

The apc.php page can be loaded to view the cache status. We recommend you rename it to something other than apc.php

Setting up yum for end-of-life CentOS 4 VPS

24 June, 2013 (19:39) | VPS | By: sblogadmin

CentOS 4 is no longer supported by the developers and we do not recommend you install it. If you have a special case which requires CentOS 4, you will find that yum will not update or perform installs because the repository URL’s are no longer valid.

To make yum work with vault.centos.org, edit your :

/etc/yum.repos.d/CentOS-Base.repo

to have these lines:


[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://vault.centos.org/4.9/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1

#released updates
[update]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://vault.centos.org/4.9/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1

yum update, yum install, etc. will now work.

I’ve lost my email password. How can I reset it?

23 May, 2013 (18:26) | mail | By: sblogadmin

[ Note : These are the complete step-by-step instructions. In many cases, your email password is the same as your control panel password. You may wish to try that password first.]

Here is the best method to reset an email password.

1. Login to your hosting control panel at:

https://phpwebhosting.com/login/

2. If you know your “postmaster” (master) password, skip to step 3. If you do not know your “postmaster” (master) password, click on :

“Password: change”

in the side left section of your control panel.

Here you can change your password. The new password will affect your hosting control panel, ftp and master email password.

3. After you have your master email password, click the “email” link near the top of the control panel.

4. Click “Configure your email accounts”

5. Login here with :

POP Account: postmaster
password: your postmaster password set in step #2
domain: your-domain.com

6. Click :

Edit existing address:

7. Click the red circle under “Modify User” for the user you wish to change the password for.