Gadget Reviews, Tech Tips, Computer Optimization, Tech News, Vista Tweak, Software Tricks, Blogging Tips, Downloads


Triple Your PC Performance with Perfect Optimizer!

Archive for the Linux

vpsinfo Remote Server Monitoring Tools

Have you ever heard of vpsinfo? Its a tiny script that let you monitor almost everything on your vps server.

vpsinfo shows the following output:

- Output from top;
- Processed /proc/user_beancounters (VPS resources);
- Output from netstat -nt (current TCP connections);
- Output from netstat -ntl (listening TCP ports);
- Output from pstree (tree view of running processes);
- Output from ls -a /tmp (and ls -al /tmp);
- Output from vnstat (an application that monitors traffic at the network interface) using its various commandline switches;
- Output from mytop (an application that monitors MySQL) or from mysqlreport (a perl script which generates a mysql status report);
- Status monitoring of daemon processes;
- Summary section showing:
o Values for oomguarpages and privvmpages (or free RAM and swap usage on a dedicated machine);
o Data transfer today through the network interface (from vnstat);
o Current number of TCP connections;
o Current number of Apache and MySQL threads, and MySQL queries (from mytop or mysqlreport)
o Disk usage.

Installation

This is extremely easy because you just have to upload the file to the webserver and thats it.

Here are the instruction:

1. Get the file here (save as .php extension)
2. Edit the configuration variables at the top;
3. Save it with a .php extension and place it on your webserver.

Popularity: 3%

Please Share and Bookmark :)
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Reddit
  • BlinkList
  • Facebook
  • Mixx
  • Twitter

Lxadmin RoundCube Error – Undefined index: HTTPS

Here is another minor problem in roundcube after lxadmin upgraded to latest version.

“Notice: Undefined index: HTTPS in /home/lxadmin/httpd/webmail/roundcube/program/include/iniset.php on line 56″

This error message will appear in the roundcube header page.

To overcome this problem, you need to do some modification on this:
/home/lxadmin/httpd/webmail/roundcube/program/include/iniset.php

Below is a simple workaround:

simply change this

ini_set('session.cookie_secure', ($_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off')));
ini_set('error_reporting', E_ALL&~E_NOTICE);

to

ini_set('error_reporting', E_ALL&~E_NOTICE);
ini_set('session.cookie_secure', ($_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off')));

Just alter the sequence will do.

Good Luck.

Popularity: 3%

Please Share and Bookmark :)
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Reddit
  • BlinkList
  • Facebook
  • Mixx
  • Twitter

SSHD Stopped Working After Reboot

Today after I upgraded some new packages for my server, some new updates modified my /dev/null. After a hard reboot, SSHD stopped working without any error message.

To fix your sshd, simply login to your server via lxadmin or cpanel.

Go to the remote command section and enter the following command:

ls -al /dev/null

Output:

crw-rw-rw- 1 root root 1, 3 Apr 13 14:36 /dev/null

Your /dev/null should look like above, otherwise please follow the steps to repair your sshd.

rm /dev/null

mknod /dev/null c 1 3

chmod 666 /dev/null

/etc/init.d/ssh start

SSHD should be running now.

Have fun.

Popularity: 4%

Please Share and Bookmark :)
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Reddit
  • BlinkList
  • Facebook
  • Mixx
  • Twitter

Server Refused To Allocate Pty

Today when I logged into my VPS server using SSH, I get this werid error “Server refused to allocate pty” and Unable to open pty: No such file or directory

This problem was caused by “yum install“. Some mount point for /dev is killed by yum install.

To solve this problem in your Virtual Private Server, simply run these two commands using your web admin:

/sbin/MAKEDEV pty
/sbin/MAKEDEV tty

The MAKEDEV commands created a lot of additional devices under /dev. After running these commands I was allowed to login via SSH again.

For those having a similar problem can use the above solution.

Good luck:)

Popularity: 7%

Please Share and Bookmark :)
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Reddit
  • BlinkList
  • Facebook
  • Mixx
  • Twitter

Optimize Apache for Low Memory Server

This apache configuration works great on a 256MB CentOs 5.3 VPS Server.

Optimize Apache for Low memory Server

/etc/httpd/conf/httpd.conf

KeepAlive On
KeepAliveTimeout 3

StartServers 2
MinSpareServers 2
MaxSpareServers 5
ServerLimit 100
MaxClients 100
MaxRequestsPerChild 500
StartServers 2
MaxClients 150
MinSpareThreads 15
MaxSpareThreads 50
ThreadsPerChild 15
MaxRequestsPerChild 0

Optimize MySQL for Low Memory Server

/etc/my.cnf

[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K

Popularity: 2%

Please Share and Bookmark :)
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Reddit
  • BlinkList
  • Facebook
  • Mixx
  • Twitter

Installing Memcached PHP Module on CentOS 5

Memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. Facebook, is world’s largest user of memcached. They use memcached to alleviate database load. They use more than 800 servers supplying over 28 terabytes of memory to its users.

How to install Memcached on CentOS 5.x?

wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-*.rpm
rpm --install rpmforge-release-*.rpm

yum install --enablerepo=rpmforge memcached

Now memcached is installed using yum. You can start memcached by using this command line:

/usr/bin/memcached -d -m 1024 -l 127.0.0.1 -p 11211 -u nobody

Installing PHP-Memcached extension module on CentOS 5

wget http://pecl.php.net/get/memcache
tar -xvf memcache-2.2.5.tgz (filename might be different here)
cd memcache-2.2.5
phpize && ./configure --enable-memcache && make && make install

vi /etc/php.ini

add

extension=memcache.so

Restart your httpd

/etc/init.d/httpd restart

Installation completed. Now you have php-memcached installed and memcached running on server.

Popularity: 1%

Please Share and Bookmark :)
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Reddit
  • BlinkList
  • Facebook
  • Mixx
  • Twitter

Installing suPHP on CentOS 5.x VPS

This is a very straight forward guide to installing and configuring suPHP on CentOS 5.0, 5.2, 5.3, etc.

Follow the instruction below:

1) Update Yum Repositories to use RPMForge, follow the instruction here: http://wiki.centos.org/AdditionalResources/Repositories/RPMForge

2) yum install mod_suphp

3) edit /etc/suphp.conf

4) make sure these lines are there:

webserver_user=apache
x-httpd-php="php:/usr/bin/php-cgi"
x-suphp-cgi="execute:!self"

5) edit /etc/httpd/conf.d/suphp.conf (which is the global configuration for suPHP).

change it to suPHP_Engine off

6) Set suPHP to work with VirtualHost, add these few lines inside <virtualhost> </virtualhost> tag.

suPHP_Engine on
suPHP_UserGroup username groupname
AddHandler x-httpd-php .php .php3 .php4 .php5
suPHP_AddHandler x-httpd-php

Done.

Popularity: 1%

Please Share and Bookmark :)
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Reddit
  • BlinkList
  • Facebook
  • Mixx
  • Twitter

Apache Mod_Rewrite Loaded But Still Not Working

You may see this problem when setting up a new vps server. I have this problem in CentOS 5.2 and above. You may have already loaded the mod_rewrite module in httpd.conf, but your http rewrite is still not working. You can solve this problem by changing these value in httpd.conf or virtualhost.conf

Look for this line (usually below the file inside the <virtualhost> tag)
AllowOverride None

Change to
AllowOverride All

Now restart you apache server.

type /etc/init.d/httpd restart

Popularity: 1%

Please Share and Bookmark :)
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Reddit
  • BlinkList
  • Facebook
  • Mixx
  • Twitter

Learn How to Make Money