Monday 30 March 2015

/script/upcp stuck on `/usr/local/cpanel/scripts/rpmup`

/script/upcp >> stuck on `/usr/local/cpanel/scripts/rpmup`
======================================

It seems the rpm on the server is not responding
=======
>>  ps aux|grep rpm

 --
 Use the "kill" command to terminate any processes that you are not actively running. Then, rebuild the RPM database via:

 --

>>mkdir /root/old_rpm_dbs/
>>mv /var/lib/rpm/__db* /root/old_rpm_dbs/
>>rpm --rebuilddb

Proceed to attempt another cPanel update if this completes successfully:

/scripts/upcp

/scripts/upcp --force

*** have a party day ***

Saturday 28 March 2015

Restore KVM and OPenvz

Restore an OpenVZ machine to VM 101

vzrestore /mnt/backup/vzdump-openvz-500.tar 101

Restore an Qemu/KVM machine to VM 107

qmrestore /mnt/backup/vzdump-qemu-600.tar 107

Enable root login alert . Send mail alert when anyone login server

1. Login to your server
2. cd /root
3. pico .bashrc
4. Scroll to the end of the file then add the following:

echo 'ALERT - Root Shell Access (YourserverName) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" test123@gmail.com

Fatal error*: Allowed memory size of 41943040 bytes exhausted

If you see the above error in wordpress and the issue persists even after setting memory limit in wp-settings.php and php.ini..

  try the steps below

copy server php.ini to public_html and change the ownership

create a .htaccess in home dir of user

root@server [/home/username]# vi .htaccess
SuPHP_ConfigPath /home/username/public_html/php.ini

replace username with the correct username.

This is how to set php.ini recursively for all directories. This will only work with suphp handler

Restrict FTP access for users

 FTP protection, we can suggest him for FTP restrictions.

There is a file called .ftpaccess, this file may contain a set of rules that will allow or deny the connection via FTP depending on different aspects or the situation
et’s say you want to deny connections via FTP to your account from all IP’s except yours. In this case, .ftpaccess is what you need.
 Here is what you will need to insert into your .ftpaccess:
Code: [Select]

    <Limit ALL>
    DenyAll
    Allow 127.0.0.1
    Allow w.x.y.z
    </Limit>

 
Replace w.x.y.z with clients IP address. Ask the client to check his IP in: http://www.whatismyip.com/

Note: You need to put this file with configuration under the folder you are planning to restrict access.

Recover XEN Guest Root Password

Logon Host machine run following command to boot guest OS in single usermode and simply recover root user password as normally we do.

#xm create -c /etc/xen/guest_vm_name extra=1


***  Enjoy the party ***

Dedicated Server Reload using IPMI

To reload server using ipmi,

First of all, you need to download the corresponding ISO to our local PC or in techvps,

Then load the IPMI >> Remote control >> console redirection >> Launch
=============
After that mount the ISO >> On the left top of ipmi you can see Virtual media

Virtual media >> Virtual storage >> Cd rom/ISO >> Open the iso >> Plug in >> Ok

Then reboot the server >> Macro >> Macro >> clt+alt+del


Then you need to boot into  the Bios, When server is starting after the reboot>> You need to press Del,

Then Boot >> Change the boot order to IPMI virtual disk

After that exit, That will reboot the system and you will get an installation prompt.

Then proceed with normal installation. After that assign ip address for the server. Then the network is up. You can login into the server  using either putty or terminal.

10 Free Server & Network Monitoring Tools [Ref]

http://sixrevisions.com/tools/10-free-server-network-monitoring-tools-that-kick-ass/

Https:// loading to a different website


This is quite normal issue, when a website is not having a SSL Certificate installed, then by accessing https:// Apache/Litespeed is showing the first domain from it's list that's having a SSL Certificate installed on the IP that the users domain is also, is not a error, glitch or a problem.

A way around this is to tell the client to install a SSL Certificate on the domain, can even make a self-signed one, then you will access your website via https:// it will show proper content (however with self-signed certificates they will get a untrusted certificated warning on most browsers).