Latest blog entry

Quota getstat syscall: Inappropriate ioctl for device

December 30, 2009    |   Posted by admin   |    Category: VPS Management

You may receive the error message while starting a VPS on OpenVZ server.

vzquota : (error) Quota getstat syscall for id 101: Inappropriate ioctl for device
vzquota init failed [3]

This is a typical Quota error message on OpenVZ servers while starting a VPS. The message indicates that you need to initialize quota on the VPS. You can follow the below steps to correct the issue

rm -f /var/vzquota/quota.101
vzquota drop 101
vzctl start 101

where, 101 is the VPS ID.

If you continue to receive the same error message while starting the VPS,

1. Make sure the server is booted with the OpenVZ kernel, you can check that out using

uname -a

2. The vz service is online.

service vz status

if not, restart the vz service

service vz start

Once you confirm the above two things, start the vps again with the vzctl command.

How to redirect a website using .htaccess?

December 27, 2009    |   Posted by admin   |    Category: Linux Administration

How to redirect a website using .htaccess?

Redirect website http://mydomain.com to http://www.mynewdomain.com

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain\.com$
RewriteRule ^(.*)$ http://www.mynewdomain.com [R=301,L]

Redirect website mydomain.com with and without www requests to http://www.mynewdomain.com

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^mydomain\.com$
RewriteRule ^(.*)$ http://www.mynewdomain.com [R=301,L]

Redirect requests from http://mydomain.com to http://mydomain.com/subdirectory i.e. redirecting requests from main domain to a sub-directory.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^mydomain\.com$
RewriteRule ^(.*)$ http://www.mydomain.com/subdirectory/ [R=301,L]

Redirect all http (80) requests of a domain to https (443) i.e. redirecting requests from non-secure port to a secure port.

RewriteEngine On
RewriteCond %{SERVER_PORT}      !443
RewriteRule ^(.*)$ https://mydomain.com/$1 [R,L]

Comments Off on How to redirect a website using .htaccess?

Unable to delete an email account from cPanel

December 27, 2009    |   Posted by admin   |    Category: cPanel Management

The e-mail address postmaster@mydomain.com deleted successfully.
Sorry, you do not have access to the domain mydomain.com

The error message is displayed when you delete an email account of a domain from cPanel >> ‘Email Accounts’ that is either shifted under another users account OR usually happens when a domain is swapped from add-on domain to main domain OR vice-versa. You cannot delete an email account from cPanel, and in this case, you have to manually remove the email account entries for domain from the existing account.

The files you need to remove the entries from are

/home/user/etc/domainname.tld/passwd
/home/user/etc/domainname.tld/shadow
/home/user/.cpanel/email_accounts.yaml

The directory that need to be removed is

/home/user/mail/mydomain.com

where, ‘user’ is the one under who’s account the email address of ‘mydomain.com’ exist.

Comments Off on Unable to delete an email account from cPanel

How to install Zend Optimizer on a cPanel server?

December 25, 2009    |   Posted by admin   |    Category: cPanel Management

How to install Zend Optimizer on a cPanel server?

cPanel offers ‘phpextensionmgr’ script through which you can install various extensions. To list the available PHP extensions, execute the command as root

root@server [~]# /scripts/phpextensionmgr list
Available Extensions:
EAccelerator
IonCubeLoader
Zendopt
SourceGuardian
PHPSuHosin

To list the available Options and Actions, execute

root@server [~]# /scripts/phpextensionmgr –help
Usage:
phpextensionmgr [options] [action] [extension]

Options:
–help       Help message
–prefix     Installation prefix for PHP (normally /usr/local or /usr/local/php4)

Actions:
install      Install or update the extension
uninstall    Uninstall the extension
status       Display the installation status of the extension
list         Show available extensions

To install Zend Optimizer, execute the command

root@server [~]# /scripts/phpextensionmgr install Zendopt

To verify whether Zend Optimizer is installed, execute:

root@server [~]# php -v

You can install the other available extensions using the same command, just replace ‘Zendopt’ with the extension name you wish to install.

To remove ‘Zend Optimizer’ from the server, just execute

root@server[~]# /scripts/phpextensionmgr uninstall Zendopt

Or

Edit the php.ini file and comment the line that states

zend_extension=”/path/to/ZendOptimizer.so”

under the ‘[Zend]’ section. In this case, make sure you restart the httpd service for the changes to take affect.

Comments Off on How to install Zend Optimizer on a cPanel server?

Id “c1” respawning too fast: disabled for 5 minutes

December 21, 2009    |   Posted by admin   |    Category: Linux Administration

You may see the tty device error messages like ‘/dev/tty1: cannot open as standard input: Permission denied’ in the server logs and many more like

Jan 10 xx:xx:xx [agetty] /dev/tty1: cannot open as standard input: Permission denied
Jan 10 xx:xx:xx [agetty] /dev/tty2: cannot open as standard input: Permission denied
Jan 10 xx:xx:xx [agetty] /dev/tty3: cannot open as standard input: Permission denied
Jan 10 xx:xx:xx [init] Id “c1” respawning too fast: disabled for 5 minutes
Jan 10 xx:xx:xx [init] Id “c2” respawning too fast: disabled for 5 minutes
Jan 10 xx:xx:xx [init] Id “c3” respawning too fast: disabled for 5 minutes

The tty “Permission denied” error message is because of the misconfiguration in your /etc/inittab file in which case you have to edit the file and comment the agetty/getty lines. Login to your server as root and edit the file:

pico /etc/inittab

Search for the lines

c1:12345:respawn:/sbin/agetty 38400 tty1 linux

and comment the lines by placing a # in front of them.

Save the file and you won’t see the messages.

OR

you may try re-creating the terminals again from shell as root. Login to your server as root and execute the command:

/sbin/makedev /dev/tty1

and replace 1 with 2,3,4,5,6,7 for other terminals and reboot the server.