Plesk DNSZone.php error

If you get the following error while managing a domain in parallels plesk control panel

=====

0: /usr/local/psa/admin/plib/dns/DNSZone.php:49
DNSZone->DNSZone(string ‘1′)
1: /usr/local/psa/admin/plib/common_func.php3:2875
objectMaker(string ‘DNSZone’, string ‘1′)
2: /usr/local/psa/admin/plib/dns/DNSManager.php:39
DNSManager::getDNSZone(string ‘1′)
3: /usr/local/psa/admin/plib/dns/DNSManager.php:75
DNSManager::getDefaultDNSZone()
4: /usr/local/psa/admin/plib/dns/DNSManager.php:104
DNSManager::syncDNSZoneAdminEmail(string ‘plesk@white.nl’, string ‘plesk2@white.nl’)
5: /usr/local/psa/admin/htdocs/server/admin_ed.php3:88
admin_ed(array, array, array)
6: /usr/local/psa/admin/htdocs/server/admin_ed.php3:171

====

chances are that you have manually removed some entry from the psa database

Please insert the following into the psa database dns_zone table

mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa

and exacute

INSERT INTO `dns_zone` (`id`, `name`, `displayName`, `status`, `email`, `type`, `ttl`, `ttl_unit`, `refresh`, `refresh_unit`, `retry`, `retry_unit`, `expire`, `expire_unit`, `minimum`, `minimum_unit`) VALUES (1, ‘yourserver.domain.com’, ‘yourserver.domain.com’, 1, ‘plesk@white.nl’, ‘master’, 86400, 1, 10800, 1, 3600, 1, 604800, 1, 10800, 1);

Please note that the field id has to be replaced by whatever is shown in DNSZone->DNSZone(string ‘id’) in the error report

You can also find the bad domain name by executing the following command

select * from domains where dns_zone_id=’id’;

where id has to be replaced by the id you get in error report

Posted under plesk

This post was written by Anoop Alias on May 13, 2008

Tags: ,

mysqlhotcopy a low resource consuming mysql backup

mysqlhotcopy is a perl script that can backup mysql databases using the MyISAM engines(InnoDb is not supported!) in a faster and efficient way

Following is a simple script to backup all your database to a directory (Preferably this directory should be in a hard drive different from your mysql databases so that there is no data loss in the event of a hard drive failure)

for db in `ls /var/lib/mysql`; do if [ -d $db ];then mysqlhotcopy $db /opt/db_backups;fi; done

You can use the –user=<mysql-user> and –password=<password> options if your mysql server requires it to be passed via command line . Here the database will be backed up in the folder /opt/db_backups ; you can change this to your requirement

Posted under mysql

This post was written by Anoop Alias on May 12, 2008

Tags:

Howto Install Xcache

Xcache is a very good php cache that can accelerate php page deliveries .The following example uses xcache version 1.2.2.Please check the website http://xcache.lighttpd.net/ before you start the installation for the latest available release of this actively maintained software

neutron:~# wget http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz

neutron:~# tar -xvzf xcache-1.2.2.tar.gz

neutron:~# cd xcache-1.2.2/

neutron:~/xcache-1.2.2# phpize

neutron:~/xcache-1.2.2# ./configure –enable-xcache –enable-xcache-optimizer

neutron:~/xcache-1.2.2# make

neutron:~/xcache-1.2.2# make install

neutron:~/xcache-1.2.2# cat xcache.ini >> /etc/php5/apache2/conf.d/xcache.ini

neutron:~# touch /tmp/xcache

neutron:~# chmod 666 /tmp/xcache

Edit the file /etc/php5/apache2/conf.d/xcache.ini according to your requirements .My xcache.in file is included below

[xcache-common]
;; install as zend extension (recommended), normally “$extension_dir/xcache.so”
zend_extension = /usr/lib/php5/20060613+lfs/xcache.so
; zend_extension_ts = /usr/local/lib/php/extensions/non-debug-zts-xxx/xcache.so
;; For windows users, replace xcache.so with php_xcache.dll
zend_extension_ts = c:/php/extensions/php_xcache.dll
;; or install as extension, make sure your extension_dir setting is correct
; extension = xcache.so
;; or win32:
; extension = php_xcache.dll

;[xcache.admin]
;xcache.admin.enable_auth = On
;xcache.admin.user = “mOo”
; xcache.admin.pass = md5($your_password)
;xcache.admin.pass = “”

[xcache]
; ini only settings, all the values here is default unless explained

; select low level shm/allocator scheme implemenation
xcache.shm_scheme = “mmap”
; to disable: xcache.size=0
; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
xcache.size = 16M
; set to cpu count (cat /proc/cpuinfo |grep -c processor)
xcache.count = 1
; just a hash hints, you can always store count(items) > slots
xcache.slots = 8K
; ttl of the cache item, 0=forever
xcache.ttl = 86400
; interval of gc scanning expired items, 0=no scan, other values is in seconds
xcache.gc_interval = 86400

; same as aboves but for variable cache
xcache.var_size = 16M
xcache.var_count = 1
xcache.var_slots = 8K
; default ttl
xcache.var_ttl = 86400
xcache.var_maxttl = 86400
xcache.var_gc_interval = 300

xcache.test = Off
; N/A for /dev/zero
xcache.readonly_protection = Off
; for *nix, xcache.mmap_path is a file path, not directory.
; Use something like “/tmp/xcache” if you want to turn on ReadonlyProtection
; 2 group of php won’t share the same /tmp/xcache
; for win32, xcache.mmap_path=anonymous map name, not file path
xcache.mmap_path = “/tmp/xcache”

; leave it blank(disabled) or “/tmp/phpcore/”
; make sure it’s writable by php (without checking open_basedir)
xcache.coredump_directory = “”

; per request settings
xcache.cacher = On
xcache.stat = Off
xcache.optimizer = On

[xcache.coverager]
; per request settings
; enable coverage data collecting for xcache.coveragedump_directory and xcache_coverager_start/stop/get/clean() functions (will hurt executing performance)
xcache.coverager = Off

; ini only settings
; make sure it’s readable (care open_basedir) by coverage viewer script
; requires xcache.coverager=On
xcache.coveragedump_directory = “”

Please note that i am installing xcache on a Debian GNU/Linux system .You must generally have the xcache.ini file contents in the main php.ini file or any other included file.

You can use xcache only with php running as a apache httpd module or with fastcgi . xcache will not work with php workinng as a cgi .

Posted under php

This post was written by Anoop Alias on May 12, 2008

Tags:

neutron.gnusys.net

I am expecting good number of visitors for the blog in the near future.So i have to think of scaling up NEUTRON which is the smart boy hosting this site

NEUTRON is a XEN domU running 2.6.18-53.1.13.el5xen in the hood and on skin its Debian GNU/Linux Etch (4.0)

======

neutron:~# free -m
total used free shared buffers cached
Mem: 64 62 2 0 0 23
-/+ buffers/cache: 38 26
Swap: 127 32 95
=====

I am running apache2,with php 5.2.0-8 and MySQL 5.0.32

Today i added xcache with WordPress xcache pluginĀ  to speed up my php a little bit

GNUSYS.NET and all its subprojects are currently running on this smart small boy and i shall keep you posted when this is gonna upgrade

If you wish to sponsor the hosting you are welcome to mail me at anoop[at]gnusys[dot]net or send me dollars vide PayPal to technomenace[at]gmail[dot]com

A index page banner saying “Proudly hosted by YOU!” will just cost you 100 USD

Posted under hosting

This post was written by Anoop Alias on May 8, 2008

Tags:

pecl install -gcc error

If you get the following error while trying to install pecl packages

=============

pecl install xmlrpci-1.0
WARNING: channel “pear.php.net” has updated its protocols, use “channel-update pear.php.net” to update
downloading xmlrpci-1.0.tgz …
Starting to download xmlrpci-1.0.tgz (9,668 bytes)
…..done: 9,668 bytes
4 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
1. Enable Improved XML-RPC Support? : autodetect

1-1, ‘all’, ‘abort’, or Enter to continue:
building in /var/tmp/pear-build-root/xmlrpci-1.0
running: /usr/temp/download/xmlrpci-1.0/configure –enable-xmlrpci=autodetect
checking for egrep… grep -E
checking for a sed that does not truncate output… //bin/sed
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… configure: error: cannot run C compiled programs.
If you meant to cross compile, use `–host’.
See `config.log’ for more details.
ERROR: `/usr/temp/download/xmlrpci-1.0/configure –enable-xmlrpci=autodetect’ failed
==========================

The cause is that your /tmp is mounted noexec ,You can fix this error by mounting /tmp with exec option

mount -o,remount,rw,exec /tmp

Posted under php

This post was written by Anoop Alias on May 8, 2008

Tags:

yum sqlite error

Sometimes you may get the following error while working with yum:

root@server2 [~]# yum install kernel-smp
Setting up Install Process
Setting up repositories
update                    100% |=========================|  951 B    00:00
base                      100% |=========================| 1.1 kB    00:00
addons                    100% |=========================|  951 B    00:00
extras                    100% |=========================| 1.1 kB    00:00
Reading repository metadata in from local files
update    : ################################################## 372/372
Traceback (most recent call last):
  File “/usr/bin/yum”, line 29, in ?
    yummain.main(sys.argv[1:])
  File “/usr/share/yum-cli/yummain.py”, line 97, in main
    result, resultmsgs = do()
  File “/usr/share/yum-cli/cli.py”, line 470, in doCommands
    return self.installPkgs()
  File “/usr/share/yum-cli/cli.py”, line 836, in installPkgs
    self.doRepoSetup()
  File “/usr/share/yum-cli/cli.py”, line 75, in doRepoSetup
    self.doSackSetup(thisrepo=thisrepo)
  File “__init__.py”, line 260, in doSackSetup
  File “repos.py”, line 287, in populateSack
  File “sqlitecache.py”, line 96, in getPrimary
  File “sqlitecache.py”, line 89, in _getbase
  File “sqlitecache.py”, line 373, in updateSqliteCache
  File “/var/tmp/python-sqlite-root//usr/lib/python2.3/site-packages/sqlite/main.py”, line 244, in execute
_sqlite.DatabaseError: unable to open database file

To fix this
You will have to erase the sqlite, sqlite-devel,python-sqlite rpm packages in your system

Matching packages have to be manually downloaded and installed 

You can use http://rpm.pbone.net/ to download the package for the particular release of your operating system

rpm -qa|grep -i sqlite
rpm -e sqlite python-sqlite sqlite-devel

Then install the packages downloaded from rpm.pbone.net

Posted under apt, yum

This post was written by Anoop Alias on May 7, 2008

Tags: ,

Custom Adobe ColdFusion 404 error page

If you request a non existent page on a coldfusion site .It will not show up your normal Apache custom 404 page.

A trick to show a custom page ( eg: cferror.cfm ) when a non existant cfm page is accessed is:

Add the following entry to the .htaccess file in your DocumentRoot

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /cferror.cfm?%{REQUEST_URI}

All request to the non existent pages are passed to cferror.cfm page with the requested URL as argument

Posted under coldfusion

This post was written by Anoop Alias on May 7, 2008

Tags: