2010
05.29

VPN support for a VPS Hosting via the TUN/TAP device is available. To allow VE #700 to use the TUN/TAP device, the following steps are required:

* Make sure the tun module has been already loaded on the hardware node:

lsmod | grep tun

If it is not there, then issue the command ‘modprobe tun’ to load it and add it into /etc/modules.conf. This module should be loaded before Virtuozzo is started, so you should run ‘service vz restart’ to make it available at runtime.

* Allow the VPS Hosting to use the tun/tap device:

vzctl set 700 –devices c:10:200:rw –save

* Create the device in the VPS Hosting:

vzctl exec 700 mkdir -p /dev/net
vzctl exec 700 mknod /dev/net/tun c 10 200

* Set proper permissions for /dev/net/tun:

vzctl exec 700 chmod 600 /dev/net/tun

You are done.

2010
05.26

Fdisk command does not supports partitioning of disk that has greater than 2 TB size. The parted tool supports GPT disk labels which can be used on disks larger than 2TB.
The example below demonstrates how to create a 6TB partition:

1. Use the parted tool to access the partition table of the device:

# parted /dev/sdj
Using /dev/sdj
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted)

2.

Once at the parted prompt, create a GPT label on the disk:

(parted) mklabel
Warning: The existing disk label on /dev/sdj will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? Yes
New disk label type?  [gpt]? gpt
(parted)

Note: This will remove any existing partition table and partitions on the device.
3. Use the print command to show the size of the disk as reported by parted.  We need this later:

(parted) print

Model: Linux device-mapper (dm)
Disk /dev/sdj: 6000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

4. Create a primary partition on the device.  In this example, the partition will encompass the entire disk (using size from the step above):

(parted) mkpart primary 0 6000GB

5. Unlike fdisk, you do not have to write out the partition table changes with parted.  Display your new partition and quit.

(parted) print

Model: Linux device-mapper (dm)
Disk /dev/mapper/VolGroup00-gpttest: 6000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End          Size         File system  Name     Flags
1      17.4kB  6000GB  6000GB               primary

(parted) quit
Information: Don’t forget to update /etc/fstab, if necessary.

6.

You can now create a filesystem on the device /dev/sdj1

7. Use mkfs.ext3 to make ext3 partition.

mkfs.ext3 /dev/sdj1

8. Use print option to displays the partition table.

parted /dev/sdj print

2010
05.22

If images do not display in IE, but they do in firefox, and if the includes/configure.php files are correct, the images are in the /images directory, and the permissions on the /images directory and the images are correct, then, you should go to includes/application_top.php and where it says $request_type = (getenv(‘HTTPS’) == ‘on’) try changing the “on” to “off”.

If that fixes the problem, then in the HTML source of /index.php file:

<base href=”">
should be something like:
<base href=”http://www.yourdomain.com/”>

This should fix the issue.

2010
05.17

To Install VMware Tools in a Linux Guest, do the following steps,

Goto, Settings > VMware Tools Install and click Install.

This step connects the virtual machine’s CD-ROM drive to an ISO image file on the ESX Server machine.

In your Linux guest, become root, mount the VMware Tools virtual CD-ROM, copy the installer file from the virtual CD-ROM to installation directory, and unmount the CD-ROM.

mount -t iso9660 /dev/cdrom /mnt
cp /mnt/vmware-linux-tools.tar.gz /usr/src
umount /dev/cdrom

Untar the VMware Tools tar file in /tmp and install it.
cd /usr/src
tar zxf vmware-linux-tools.tar.gz
cd vmware-tools-distrib
./vmware-install.pl

Choose directories for the files. Enter a display size for the virtual machine and press Enter. Follow the instructions in the screen. Start X and your graphical environment and launch the VMware Tools background application.

vmware-toolbox &

Note: If you created this virtual machine using the vmxnet driver, run netconfig or another network configuration utility in the virtual machine to set up the virtual network adapter.

2010
05.16

Download the package from http://ftp.twaren.net/Unix/NonGNU/dmidecode/ and install dmidecode,

tar -zxvf dmidecode-x.x.tar.gz
cd dmidecode-x.x
make
make install

To get the memory details, use,

dmidecode -t 2,16,17

Display SMBIOS/DMI information,

dmidecode -q

2010
05.10
via the local Command Prompt

On your Server Core machine, at a command prompt, type the following:

netsh firewall set icmpsetting 8

This will allow you to ping the Server Core server from a remote machine, and receive a reply.

You can always run the following command in order to disable this option:

netsh firewall set icmpsetting 8 disable
2010
05.06

To view webmail accounts and password in plesk, use the following command from the shell.

# /usr/local/psa/admin/sbin/mail_auth_view

Hope you enjoy this.  :)

2010
05.02

This is a sample script to connect to mysql database using php.

<?php
mysql_connect(“localhost”, “username”, “password”) or die(mysql_error());
echo “Connected to MySQL<br />”;
mysql_select_db(“testdb”) or die(mysql_error());
echo “Connected to Database”;
?>

2010
04.28

Download libssh2 from http://www.libssh2.org/snapshots/lib…0091001.tar.gz

tar -zxvf libssh.x.x.tar.gz

./configure

make all install

Download the pecl-ssh2 installer from http://pecl.php.net/get/ssh2-0.10.tgz

tar -zxvf ssh2-0.11.0.tgz
cd ssh2-0.11.0
phpize

./configure –with-ssh2

make

Copy ssh2.so to your extension_dir specified in php.ini.

grep extension_dir /usr/local/Zend/etc/php.ini
cp modules/ssh2.so /path/to/extension/dir

Then add the extension to your php.ini:
extension=ssh2.so

Restart httpd, and you are all set!

2010
04.08

You may want to block countries in the firewall by using Country Codes in CSF configuration. You canuse the country code in the configuration variable CC_DENY of CSF. You can refer the following help link, http://www.configserver.com/cp/csfdemo/config.html.

You can get the Country Codes from the url, http://www.countryipblocks.net.