Sunday, November 1, 2009

Unable to open pty: No such file or directory

While trying to SSH or enter into a VPS from the node, you may get the following error :

Unable to open pty: No such file or directory

or

root@tip~]# vzctl enter 900
enter into VE 900 failed
Unable to open pty: No such file or directory

There is a temporary and permenant fix for this issue.

Temporary Fix :-

Execute the following commands from the node

vzctl exec VEID /sbin/MAKEDEV pty

vzctl exec VEID /sbin/MAKEDEV tty

vzctl enter VEID

Where VEID is the VPS id.

Permanent Fix :-

First temporarly fix the issue and enter into the VPS.

1) vzctl enter VEID

2) Edit the file /etc/rc.sysinit of the VPS

vi /etc/rc.sysini

3) Search for the line /sbin/start_udev and comment it

#/sbin/start_udev

4) Add the following two lines under /sbin/start_udev

#/sbin/start_udev
/sbin/MAKEDEV tty
/sbin/MAKEDEV pty

Logout from your VPS (Ctrl d)

5) Reboot the VPS and you are done!

vzctl restart VEID

scripts

ls -1A *.tar.gz | cut -d "_" -f 3 | cut -d "." -f 1 > sharaf
for i in `cat sharaf` ; do /scripts/restorepkg --force $i ; done







#cat /etc/trueuserdomains | cut -d ":" -f 2 | cut -d " " -f2
#cat /etc/trueuserdomains | cut -d ":" -f 2 | cut -d " " -f2 > cpusers
(#for i in `cat cpusers` ; do /scripts/pkgacct $i ;
#grep -i nuzkistah /etc/userdomains
#
# for i in `cat cpusers` ; do /scripts/pkgacct $i ; scp -P 2121 /home/cpmove-$i.tar.gz IP:/home ; ssh -t -p 2121 -q IP /scripts/restorepkg $i ; done

awstats in DA

http://www.directadmin.com/features.php?id=894

Symlink ownership problem

ln -s /home/com/public_html/LiveZilla /home/com/public_html/dom.com/LiveZilla

cd /home/com/public_html/LiveZilla/

chown -h getcom.getcom LiveZilla

vnc

VNCSERVERS="3:root 2:user"
VNCSERVERARGS[3]="-geometry 1024x768 -depth 16"
VNCSERVERARGS[2]="-geometry 1024x768 -depth 16"



#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
startkde &
#gnome-session&
#startx &


http://codeghar.wordpress.com/2007/11/28/centos-5-post-install-customization/
# yum groupinstall "X Window System" "GNOME Desktop Environment"

time

rdate -s rdate.cpanel.ne

php.ini

php.ini
=========

max_execution_time = 60
max_input_time = 60
memory_limit = 16M
post_max_size = 16M
upload_max_filesize = 16M

.htaccess
=============

php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value max_execution_time 200
php_value max_input_time 200
info.php
=========

SCRIPT Install FFmpeg + FFmpeg-PHP + Mplayer + Mencoder + flv2tool + LAME MP3

mkdir ~/ffmpeg-packages
cd ~/ffmpeg-packages
wget http://trulymanaged.com/ffmpeg/ffmpeginstall.tar.gz
tar -xvzf ffmpeginstall.tar.gz
cd ffmpeginstall

Change time zone

cd /usr/share/zoneinfo
cp GMT /etc/localtime
try to change it for example to UCT
try like cp UCT /etc/localtime

How to disable gzip output for lightspeed

php_flag zlib.output_compression Off
RewriteEngine On
RewriteRule . - [E=no-gzip:1]
RewriteRule ^(.*)$ $1 [E=no-gzip:1]

Native SSL support failed to pass the startup test

Native SSL support failed to pass the startup test. stunnel was started instead.
The exact error was: [linktest=/usr/local/cpanel/bin/linktest-ssl: error while loading shared libraries: /usr/local/cpanel/perl/Net/SSLeay/SSLeay.so: cannot open shared object file: No such file or directory
] [binary=/usr/local/cpanel/cpsrvd-ssl] [cpsrvd=/usr/local/cpanel/cpsrvd-ssl: error while loading shared libraries: /usr/local/cpanel/perl/Net/SSLeay/SSLeay.so: cannot open shared object file: No such file or directory
]

/usr/local/cpanel/bin/nativessl-install

rvsite builder issue

Cannot detect your system information, you have to install ionCube loader manually. Please contact your provider.

FIRST, login SSH and run
perl /var/cpanel/rvglobalsoft/rvsitebuilder/panelmenus/cpanel/scripts/autofixphpini.pl

Then restart cPanel service:
/usr/local/cpanel/startup


Now the autofixphpini.pl has fixed the post_max_size and upload_max_filesize, BUT it has messed up your ioncube loader setting, so you need to fix that next. To do this, in SSH type or paste:

pico /usr/local/cpanel/3rdparty/etc/php.ini

Then do CTRL-W to find zend_extension

Add following line at the end of the zend section, before the line where it says Windows extension:

zend_extension="/usr/local/cpanel/3rdparty/fantastico/loaders/ioncube_loader_lin_5.2.so"

CTRL-x to exit, then Y, and Enter to save the file.

Then restart cPanel service again:

/usr/local/cpanel/startup

REF : http://forums.rvskin.com/index.php?showtopic=2920

configure logrotate on cPanel (daily rotation and 7 days retention).

vi /etc/logrotate.d/httpd

/usr/local/apache/logs/*.log {
daily
rotate 7
compress
missingok
notifempty
sharedscripts
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
}

backup list

ls backup-11.1.2009_0* | cut -d "_" -f 3 | cut -d "." -f 1 > newlist
for i in `cat newlist` ; do /scripts/restorepkg $i ; done

Imagemagic

/scripts/checkimagemagick
ok
root@cpane [/usr/src]# /scripts/installimagemagick
==================

Disable IDENT for exim.

post_max_size = 100M

upload_max_filesize = 100M

Fantastico installation

1. cd /usr/local/cpanel/whostmgr/docroot/cgi

2. wget -N http://files.betaservant.com/files/free/fantastico_whm_admin.tgz

3. tar -xzpf fantastico_whm_admin.tgz

4. rm -rf fantastico_whm_admin.tgz

5. login to WHM as root and

6. Under Tweak Settings -> PHP - enable ioncube

7. Under Plugins - You will find Fantastico De Luxe WHM Admin

8. Click install

To find a listening port

To find a listening port

netstat -tlpn | grep

eg:

netstat -tlpn | grep ssh

netstat -tlpn | grep telnet

Creating MySQL Dump

cd /var/lib/mysql

ls -l | grep

mysqldump |db| > |db|.sql

mysqladmin create |newdb|

mysql |newdb| < |db|.sql

*-------------------------------------------------------------------------------------------------------------------------------------------------*

Get MySQL version

mysql -i;

or

login to mysql and run the following command this returns the servers
version.

mysql> select version();
+-----------+
| version() |
+-----------+
| 3.23.58 |
+-----------+
1 row in set (0.02 sec)

*-------------------------------------------------------------------------------------------------------------------------------------------------*

MySQL Error Log

/var/lib/mysql/server.hostname.err

*-------------------------------------------------------------------------------------------------------------------------------------------------*