HostwareSupport-Linux Hosting technical support for cPanel, Plesk, Directadmin servers

Linux Hosting technical support for cPanel, Plesk, Directadmin and No control panel servers offers and listing
http://hostwaresupport.com/

Oct 28, 2010

How to read your VPS's /proc/user_beancounters in details

If you are having trouble running or installing applications on your VPS, one good way to find the source of the problem is to use the special file /proc/user_beancounters which shows the resource control information about running virtual environments.

To view /proc/user_beancounters on your VPS, login to your VPS via SSH.
In the SSH Terminal you will type:

cat /proc/user_beancounters

Then hit Enter.

After you hit Enter, you should see something that looks similar to the following:



That is your /proc/user_beancounters file.

If you look at the top line where you see uid to the left of it, that line is the field that displays the numeric identifier of the Virtual Environment.

The field held shows the current counter for the Virtual Environment (resource "usage").
The field maxheld shows the counter's maximum for the lifetime of the Virtual Environment. The lifetime of the Virtual Environment is usually just the time between the start and stop of your VPS.
The barrier and limit fields are resource control settings. For some parameters only one of them may be used, for others, both. These fields may display resource limits or guarantees, and the exact meaning of them is parameter-specific.
The field failcnt shows the number of refused "resource allocations" for the lifetime of the Virtual Environment. Failcnt counter is increased only for accounting parameters.The field failcnt is the field you will be looking at for errors.

If you look at the example above, you will see that the parameter kmemsize has a failcnt of 129. That is because in this example, the VPS did not have enough memory available to install an application. Therefore, the failcnt counter recorded the 129 memory failures, next to the parameter kmemsize in it's /proc/user_beancounters file. We know the problem was memory since the failcnt next to kmemsize increased after trying to install the application.

In this article, we will concentrate on the following parameters:

* kmemsize
This is the parameter that shows the size of unswappable memory, allocated by the operating system kernel. If the failcnt value increases on this parameter, most likely there is not a sufficient amount of memory available to run the application.
* lockedpages
This is process pages not allowed to be swapped out. The size of these pages is also accounted into kmemsize. Note that typical server applications like Web, FTP, and mail servers do not use memory locking features. If the failcnt value increases on this parameter, most likely there is not a sufficient amount of memory available to run the application.
* privvmpages
This is the memory allocation limit. This parameter allows controlling the amount of memory allocated by applications. If the failcnt value increases on this parameter, most likely there is not a sufficient amount of memory available to run the application.
* shmpages
This is the total size of the shared memory (IPC, shared anonymous mappings and tmpfs objects). These pages are also accounted into privvmpages. Its configuration affects functionality and resource shortage reaction of the applications in the given Virtual Environments only. Again, If the failcnt value increases on this parameter, most likely there is not a sufficient amount of memory available to run the application.
* physpages
This is the total number of RAM pages used by processes in this virtual environment. Unlike other accounting methods, the sum of physpages usage for all Virtual Environments yields to the total number of pages used in the system by all Virtual Environments. This is currently an accounting-only parameter. It does not set any limits or barriers. If the failcnt value increases on this parameter, most likely there is not a sufficient amount of memory available to run the application.
* vmguarpages
This parameter controls how much memory is available to the Virtual Environment. The vmguarpages parameter does not have its own accounting. The current amount of allocated memory is accounted into another parameter (privvmpages). If the failcnt value increases on this parameter, most likely there is not a sufficient amount of memory available to run the application.
* oomguarpages
This is the guaranteed amount of memory in case the memory is "over-booked" (out-of-memory kill guarantee). The failcnt counter of oomguarpages parameter increases when a process in this Virtual Environment is killed because of an out-of-memory situation, but not when the barrier is reached. Again, If the failcnt value increases on this parameter, most likely there is not a sufficient amount of memory available to run the application.
* numfile
This is the number of "files" in use, including real files, sockets and pipes. The configuration of this parameter affects functionality and resource shortage reaction of applications in the given Virtual Environment only. If the failcnt value increases on this parameter, you are trying to have too many files open at once.

Oct 27, 2010

How to reset Kloxo password

How To reset the Kloxco admin password through Shell..
Try the following step it will help you..


Fist step:

Go to the Directory :

# cd /usr/local/lxlabs/kloxo/httpdocs

Then apply the command :

# lphp.exe ../bin/common/resetpassword.php master admin

(at admin you can change any name what password you need...)


You are done..Try login your kloxo..

Oct 7, 2010

Mysql-web.linux command

How to Back Up and Restore a MySQL Database..

If you're storing anything in MySQL databases that you do not want to lose, it is very important to make regular backups of your data to protect it from loss. This tutorial will show you two easy ways to backup and restore the data in your MySQL database. You can also use this process to move your data to a new web server.


Back up From the Command Line (using mysqldump)

If you have shell or telnet access to your web server, you can backup your MySQL data by using the mysqldump command. This command connects to the MySQL server and creates an SQL dump file. The dump file contains the SQL statements necessary to re-create the database. Here is the proper syntax:

# mysqldump --opt -u [uname] -p[pass] [dbname] > [backupfile.sql]


  • [uname] Your database username
  • [pass] The password for your database (note there is no space between -p and the password)
  • [dbname] The name of your database
  • [backupfile.sql] The filename for your database backup
  • [--opt] The mysqldump option
For example, to backup a database named 'Tutorials' with the username 'root' and with no password to a file tut_backup.sql, you should accomplish this command:

# mysqldump -u root -p Tutorials > tut_backup.sql

This command will backup the 'Tutorials' database into a file called tut_backup.sql which will contain all the SQL statements needed to re-create the database.

With mysqldump command you can specify certain tables of your database you want to backup. For example, to back up only php_tutorials and asp_tutorials tables from the 'Tutorials' database accomplish the command below. Each table name has to be separated by space

# mysqldump -u root -p Tutorials php_tutorials asp_tutorials > tut_backup.sql

it is necessary to back up more that one database at once. In this case you can use the --database option followed by the list of databases you would like to backup. Each database name has to be separated by space.

mysqldump -u root -p --databases fresh_linuxweb > content_backup.sql

If you want to back up all the databases in the server at one time you should use the --all-databases option. It tells MySQL to dump all the databases it has in storage.

# mysqldump -u root -p --all-dbinserver > alldb_backup.sql

The mysqldump command has also some other useful options:

--all-drop-tables Tells MySQL to add a DROP TABLE statement before each CREATE TABLE in the dump.

--no-data: Dumps only the database structure, not the contents.

--add-locks: Adds the LOCK TABLES and UNLOCK TABLES statements you can see in the dump file.

The mysqldump command has advantages and disadvantages. The advantages of using mysqldump are that it is simple to use and it takes care of table locking issues for you. The disadvantage is that the command locks tables. If the size of your tables is very big mysqldump can lock out users for a long period of time.

Back up your MySQL Database with Compress

If your mysql database is very big, you might want to compress the output of mysqldump. Just use the mysql backup command below and pipe the output to gzip, then you will get the output as gzip file.

# mysqldump -u [uname] -p[pass] [dbname] | gzip -9 > [sqlfile.sql.gz]

If you want to extract the .gz file, use the command below:

# gunzip [backupfile.sql.gz]

Restoring your MySQL Database

Above information is we backup the Tutorials database into tut_backup.sql file. To re-create the Tutorials database you should follow two steps:

  • Create an appropriately named database on the target machine
  • Load the file using the mysql command:
# mysql -u [uname] -p[pass] [db_to_restore] < [sqlbackupfile.sql]

Have a look how you can restore your tut_backup.sql file to the Tutorials database.

# mysql -u root -p Tutorials <>

To restore compressed backup files you can do the following:

If you need to restore a database that already exists, you'll need to use mysqlimport command. The syntax for mysqlimport is as follows:

# mysqlimport -u [uname] -p[pass] [dbname] [backupfile.sql]

Backing Up and Restoring using PHPMyAdmin

It is assumed that you have phpMyAdmin installed since a lot of web service providers use it. To backup your MySQL database using PHPMyAdmin just follow a couple of steps:

  • Open phpMyAdmin.
  • Select your database by clicking the database name in the list on the left of the screen.
  • Click the Export link. This should bring up a new screen that says View dump of database (or something similar).
  • In the Export area, click the Select All link to choose all of the tables in your database.
  • In the SQL options area, click the right options.
  • Click on the Save as file option and the corresponding compression option and then click the 'Go' button. A dialog box should appear prompting you to save the file locally.

Restoring your database is easy as well as backing it up. Make the following:

  • Open phpMyAdmin.
  • Create an appropriately named database and select it by clicking the database name in the list on the left of the screen. If you would like to rewrite the backup over an existing database then click on the database name, select all the check boxes next to the table names and select Drop to delete all existing tables in the database.
  • Click the SQL link. This should bring up a new screen where you can either type in SQL commands, or upload your SQL file.
  • Use the browse button to find the database file.
  • Click Go button. This will upload the backup, execute the SQL commands and re-create your database.
============================================================================