Recursively get files from FTP server

Filed Under (Linux) by WebScHoLaR on 09-10-2010

Tagged Under : ,

FTP in conjunction with wget can be used to recursively download files from the servers. Use the following command to fetch all files in the FTP account provided:

# wget -r -nH -c -l0 ftp://ftp_username:ftp_password@ftp_host.com
If needing to use a username with an ‘@’ in it, you can use %40 instead of the @ and it will go through just fine.
# wget -r -nH -c -l0 ftp://user%40domain.com:ftppass@ftp_host.com

tmp files to check download speed

Filed Under (Linux) by WebScHoLaR on 09-10-2010

Tagged Under : , , ,

Most of the time, download speed needs to be checked. A temporary file with garbage data can be created and made available for the users to download and test the download speed. This can be created as:

# dd if=/dev/zero bs=1024 count=20000 of=/home/user/www/20mb.file
# chown user.user
/home/user/www/20mb.file

Then the URL http://www.domain.com/20mb.file can be provided to users to check the download speed.

NOTE: Make sure that the domain.com points to the same path where the file was created.

Clear Windows Updates Cache

Filed Under (Windows) by WebScHoLaR on 09-10-2010

Tagged Under : , ,

Windows updates if enabled will download the updates at %windir%/SoftwareDistribution folder. In case, Windows updates cache needs to be reset so that the updates available will be downloaded again, run following commands in Windows command prompt:

net stop wuauserv
cd /d %windir%
rd /s SoftwareDistribution
net start wuauserv

myisamchk Error: Disk is full writing ‘/tmp/xxxxxx

Filed Under (Linux, MySQL) by WebScHoLaR on 09-10-2010

Tagged Under : , ,

myisamchk utility is used to repair MySQL MyISAM tables. If the table is too large and the server tmp drive doesn’t have much space, you may encounter Disk full error. In that case, create a temporary folder at any server partition that has enough disk space available and run myisamchk as:

# mkdir /home/mysqltmp
# chown mysql.mysql /home/mysqltmp
# myisamchk -rf –tmpdir=/home/mysqltmp /var/lib/mysql/user_dbname/*.MYI

Once repaired, remove the /home/mysqltmp.

Openssl upgrade for PCI Compliance

Filed Under (cPanel/WHM) by WebScHoLaR on 09-10-2010

Tagged Under : , , , , ,

PCI Compliance tests declare openssl as vulnerable usually. The tests usually just compare the openssl version and do no check that whether those have been patched for that vulnerability or not. One possible way is to consult PCI scan company and let them know that the openssl version installed is a patched version and the vulnerability is fixed. The other way is to manually compile openssl and recompile Apache/PHP with newer openssl libraries. The steps mentioned below are for cPanel 11.x +.

Check where the existing openssl that comes with the OS is installed.

[root@Server ~]# whereis openssl
openssl: /usr/bin/openssl /usr/lib/openssl /usr/include/openssl /usr/share/man/man1/openssl.1ssl.gz

The above result shows that openssl is installed at /usr/bin path. So we will not replace it with manual installed version but we will install it at a different path at /usr/local. Read the rest of this entry »

Recreate Service VE on Virtuozzo 4.x

Filed Under (Virtuozzo) by WebScHoLaR on 12-08-2010

Tagged Under : , , ,

Login to the Virtuozzo Node. You can backup the existing Service VE by clonning it as:

# vzctl stop 1

# vzmlocal 1:111

Service VE that has VEID of 1 will be renamed to 111 so now a new Service VE can be created as:

# wget http://download.parallels.com/virtuozzo/virtuozzo4.0/linux/iso/lin-i386.iso

# mkdir /vz/Rel400

# mount -t iso9660 -o loop lin-i386.iso /vz/Rel400

# vzsveinstall -D /vz/Rel400/ -s xx.xx.xx.xx (Specify the IP that the old Service VE has)

# for i in `find /vz/vzup2date/$(awk ‘{print $NF}’ </etc/virtuozzo-release)/ -type f -name virtuozzo-tools* |sed ‘s/\/virtuozzo-tools/ /’ |awk ‘{print $1}’ |sort -t- -k3 -n`; do vzsveupgrade -d $i; done

Verify that the vzagent-opcontrol package version on the node and inside Service VE is same:

# rpm -q vzagent-opcontrol

# vzctl exec 1 rpm -q vzagent-srvcontrol

Verify the Service VE status as:

# vzlist 1

Thats all.

vzquota error on Virtuozzo Linux VPS

Filed Under (Virtuozzo) by WebScHoLaR on 21-06-2009

Tagged Under : , ,

If you start a VPS and it gives the following error:

vzquota : (error) Quota on syscall for 100: Device or resource busy

Running vzquota on failed for VPS 100 [3]

Then it means that there are some open files from that VPS. Please make sure there are no open files inside VPS root and/or private area (and your current working directory is not inside VPS root/private area) by running the following command on the hardware node:

lsof 2> /dev/null | egrep ‘/vz/root/VPSID|/vz/private/VPSID’

If there are any processes which hold a directory inside VPS root/private area – kill them.

e.g:

[root@server ~]# vzctl start 100

Starting VPS …
vzquota : (error) Quota on syscall for 100: Device or resource busy
Running vzquota on failed for VPS 100 [3]

[root@server ~]# lsof 2> /dev/null | egrep ‘/vz/root/100|/vz/private/100′

tar 11101 root 9r REG 8,5 41995369 457695234 /vz/private/100/root/home/username/mail/inbox

[root@server ~]# kill -9 11101

[root@server ~]# vzctl start 100
Starting VPS …
VPS is mounted
Adding IP address(es): 192.168.1.1
Hostname for VPS set: vps.servername.com
File resolv.conf was modified
Setting devperms 60010 dev 0×22
VPS start in progress…

Reset admin password in Windows Plesk

Filed Under (Plesk) by WebScHoLaR on 21-06-2009

Tagged Under : , , , ,

The Plesk admin password can simply be reset by login to VPS using RDP with following command:

%plesk_bin%\plesksrvclient.exe

Just run the command and it will ask for new admin password. If it also shows the message that Access denied/can’t connect to MySQL then:

  1. Add parameter skip_grant_tables=1 into the [PleskSQLServer] section.
  2. Restart service Plesk SQL Server.

%plesk_bin%\plesksrvclient.exe -get command can be used to retrieve the Plesk admin password from the database to verify that the password has been successfully updated in Plesk system database. If Plesk admin password is not updated somehow then it can be updated manually. To do it, please, follow the steps:

  1. Edit MySQL configuration file my.ini located within %plesk_dir%\mysql\data\.
  2. Add parameter skip_grant_tables=1 into the [PleskSQLServer] section.
  3. Restart service Plesk SQL Server.
  4. Log into Plesk MySQL.

%plesk_dir%\mysql\bin\mysql.exe -P8306 mysql

  1. Execute the following query:

mysql> update mysql.user set password=password(‘NEWPASSWORD’) where user=’admin’;

  1. Remove skip_grant_tables=1 from within the [PleskSQLServer] section within %plesk_dir%\mysql\data\my.ini
  2. Restart service Plesk SQL Server.

Virtuozzo Power Panel SSL Certificate

Filed Under (Virtuozzo) by WebScHoLaR on 21-06-2009

Tagged Under : , , , ,

Cert installed in the service VE is the cert used by VZPP and VZCC and it is located at:

/etc/httpd/conf/ssl.crt/server.crt
/etc/httpd/conf/ssl.key/server.key

You need to enter to Service VE from the Hardware Node to update these certificate files as “

vzctl enter 1

After renewing the certificate, VZCP service needs to be restarted :

/etc/init.d/vzcp restart

Changing bandwidth for Virtuozzo VPS

Filed Under (Virtuozzo) by WebScHoLaR on 21-06-2009

Tagged Under : , , , ,

VPS can have either metered bandwidth at higher rate like 100Mbps port or unmetered at a lower rate like 2Mbps, 3 Mbps etc depending on the plan.

This can be done from vzmc :

Got to Properties of VPS > Traffic Shapping

For Unmetered :

Open the Class 1 named file and add respective value ,

e.g. 1024 for discovery plan > i.e. 1Mbps, and 2048 for freedom i.e. 2 Mbps and so on.

And Check the ‘Check Box’ below named ‘Rate Guarantee is also a bound’

For Metered :

Open the Class 1 named file and enter 102400 in it.

Uncheck the check box below named ‘Rate Guarantee is also a bound’

Proudly Hosted by eServicesProvider