Webmin not allowing database creation, user creation

Q: Inside webmin I cannot create new databases or users, I get the error:

DBI connect failed : Access denied for user ‘my_user_nam_here’@’%’ to database ‘mysql’

How can I fix this?

A: You need to login to mysql as the mysql admin user (usually called root). Normally if you login to webmin as root it will login you into MySQL as root too. If this does not work, fix it with:

Inside webmin:

Click “servers”
Click “MySQL Databaseservers”
Click “Module Config” on the MySQL screen (top left)
Change “Administration login” to either automatic (should work) or “root”

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

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#

Enabling apc (php alternative cache) on your Centos VPS

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

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.

Webmin crashing / unresponsive on my VPS – how to fix?

Question: Webmin keeps crashing on my VPS. Why does this happen and how can I fix it?

Answer:

From our experience, webmin seems to become non-responsive when running on “low memory” VPS’s (typically those with 256 megs of ram or less).

If you attempt to connect to webmin (port 10000 by default) and get an unable to connect message, do the following:

1. ssh in to your server
2. as root, type :

/sbin/service webmin restart

Note, that “service” will restart webmin on a RedHat/Centos based VPS. If you are running a different Linux flavor you’ll need to use the service management for that distribution.

You should also make sure webmin is set to start automatically on reboots by running:

/sbin/chkconfig webmin on

I can’t connect to webmin on my VPS

Question:

I tried to connected to webmin on my VPS today and got the error :

Firefox can’t establish a connection to the server at 100.100.100.100:10000.

(where 100.100.100.100 is the IP of your VPS)

What is wrong?

Answer:

Hi,

This means webmin has crashed and is a warning sign that you are likely using more memory than your VPS has installed. On VPS’s with low memory, webmin seems to be one of the first things to lock up.

You can restart it by ssh’ing to the server and typing:

/sbin/service restart webmin

You could also reboot the entire VPS in your control panel as last resort if you do not have ssh access from your current location.

If you would like to purchase more memory contact support. Memory upgrades are quick and do not require any downtime to your VPS>

All commands on my VPS return “fork: Cannot allocate memory”

Question:

No matter what I do, my VPS returns “fork: Cannot allocate memory”. What is happening?

Answer:

“fork: Cannot allocate memory” means that you have locked up the VPS by allocating too much memory (and thereby no memory is left to start (ie. fork) any new processes). You can try to kill -9 processes that are running but many times you need to reboot the VPS from the control panel.

How do I upgrade php on a VPS?

Question:

The php version on my VPS is out of date. How do I update it?

Answer:

Using the OS vendors normal update command can get you some updates (but perhaps not what you want – see below). For example on RedHat/CentOS run:

yum update php

However usually the OS vendors versions are not the latest. The update them to patch security issues but many times are far out of date from what you may require.

To update RedHat/CentOS to a newer php run these commands:


yum erase php-pdo php-xml php-mysql php php-common php-cli php-gd php-mbstring php-devel

yum install php53-pdo php53-xml php53-mysql php53 php53-common php53-cli php53-gd php53-mbstring

/sbin/service httpd restart

A note:

These are “unofficial” RPM’s as RedHat only official supports a particular (semi-old) version and backports security fixes to it – good for large corporate users but not so great for active developers). However the RPMS’s above are widely used in the community and most developers view them as trustworthy (just important to note that they are not actually from RedHat).