Move cpanel mysql to other directory safely

This is also for my personal need in the future whenever i setup a cpanel server for my TWOPIZ HOSTING. There is a way to move mysql to other directory other than the one defined by cpanel. Firstly, you will need to backup everything on /var/lib/mysql folder. Once you have done that, you will have to follow the below instruction.


cd /var/lib
service chkservd stop
service mysql stop
mv mysql /home
ln -s /home/mysql mysql
service mysql start
service chkservd start

The backup apps will still work normally as the mysql folder still exist on /var/lib just that now it is pointing to the /home directory where the size is the largest.

Roundcube error :: SERVICE CURRENTLY NOT AVAILABLE! Error No. [500] on cpanel server

I was having problem with cPanel roundCube webmailer on one of my shared hosting server. This might save some people troublesome when you tried the following. After you have login in your server using SSH and enter the following.

[root@server~]# /usr/local/cpanel/bin/update-roundcube-sqlite --force

This error occurred when roundcube database not update properly you can use following steps to resolve this issue. If this doesn't work, it might means that the database might not even exist. You will have to create it first by doing this

[root@server~]# /usr/local/cpanel/bin/update-roundcube --force
[root@server~]# /usr/local/cpanel/bin/update-roundcube-sqlite --force

It should resolve your issue if its error 500.

buycpanel.com bad sales services

I am REALLY disappointed today. I contacted buycpanel.com to purchase 3 license to start my web hosting business but was faced with many difficulty from rejecting our company credit card to reject us entirely. I waited for their reply until 4AM when they were trying to process our transaction and finally i went to sleep. The next morning was a total disaster.

Their sales support was helpful at first but after problems occurred, they started to be rude to us see for yourself,

Dear Clay Lua,

Thank you for your e-mail. I am sorry, due to the risk of your order we can only accept a wire transfer for payment:

Send a bank wire transfer accepted both internationally and domestically in the United States:

Intermediary Bank: Wells Fargo Bank Intl Bank Location: San Francisco, CA USA SWIFT: WFBIUS6S Beneficiary Bank: First Internet Bank Beneficiary ABA: //FW074014187 Beneficiary Customer: Control Panel Solutions, Inc. Beneficiary Account Number: 300486017
---------------
Highest Regards,

Jeff B
Support Manager

Hi,

Its very frustrating on my side. Can i use my Mastercard instead or else i would have to travel very far just to purchase through wire transfer.

Thanks,
Clay

Dear Clay Lua,

Thank you for your e-mail.
 We cannot accept your order.  Sorry.  Good bye.

Thank You,

Ranae P
--
BuyCPanel Customer Service
E-Mail: [email protected]
Phone: 877-759-2783
Fax: 877-797-1802
http://www.buycpanel.com

Hi Ranae,

What do you mean by you don't accept our order? Please verify what is going on? Thanks.

Clay

hi Ranae ,

On the other hand, why is our credit card being mark as high risk? What is the risk here when we have the money but couldn't purchase? If you would like us to purchase through wire transfer we CAN do that but do you mean that we have to do that every single month? if this is the case, then yes we will move on and purchase from some other people. We have our own servers and contacts from our local datacenter. But i don't understand the problem here. Please advice. Do you need me to call you personally? Thanks.

Lastly, i felt offended and i will definitely file a complain regarding your attitude towards my enquiry on the below statement.

"Thank you for your e-mail.
 We cannot accept your order.  Sorry.  Good bye"

I demand an explanation not a look down statement.

Clay

Dear Clay Lua,

Thank you for your e-mail.
 you cannot call our business phone is turned off at night.

 Go ahead and purchase from some other people. The managers decision is final.

Thank You,

Ranae P
--
BuyCPanel Customer Service
E-Mail: [email protected]
Phone: 877-759-2783
Fax: 877-797-1802
http://www.buycpanel.com

i was shocked and depressed. That's all i can say. USD105 isn't a lot of money to a business and i believe we should at least get a more reasonable sales support since we are the customers and not being treated like this. We were thinking of going with their cpanel admin support as well but looking at their sales support, i guess not. Biggest cpanel reseller doesn't mean you can treat your customer this way. I believe we all have the right to enquiry for a service. If you are dissatisfy with your client enquiring your product, don't answer the support. buycpanel.com is the only exclusive partner of cpanel. Without anywhere to voice out, i decided to write here instead and hopefully people do see what they will be giving to your business. As for us, we move on to purchase directly from cpanel instead.

How to Setup GFS2 or GFS in Linux Centos

It has been a nightmare for me setting up GFS2 with my 3 shared hosting servers and 1 SAN Storage. I have been reading all over the internet and the solutions to this is either outdated or contains bug that cannot make my SAN storage SAN to work. Finally, i managed to setup my GFS2 on my Dell MD3200i with 10TB of disk space.

GFS2/GFS Test Environment

Here is the test environment equipment that i utilized for this setup.

  1. 3 Centos Web Server
  2. 1 MD3200i Dell SAN Storage
  3. 1 Switch to connect all these equipment together

Assumption

I will assume you would have setup all your 3 Centos servers to communicate with your SAN ISCSI storage. This means that all your 3 Centos servers will be able to view your newly created LUN using iscsiadmn. And you have switch off your iptabls and selinux. If your iscsi storage hasn't configure, you can do so at cyberciti.

Setup GFS2/GFS packages

On all of your 3 Centos servers, you must install the following packages:

  1. cman
  2. gfs-utils
  3. kmod-dlm
  4. modcluster
  5. ricci
  6. luci
  7. cluster-snmp
  8. iscsi-initiator-utils
  9. openais
  10. oddjobs
  11. rgmanager

Or you can simple type the following yum on all 3 Centos machine

yum install -y cman gfs-utils kmod-gfs kmod-dlm modcluster ricci luci cluster-snmp iscsi-initiator-utils openais oddjob rgmanager

Or even simplier, you can just add the cluster group via the following line

yum groupinstall -y Clustering
yum groupinstall -y "Storage Cluster"

Oh, remember to update your Centos before proceeding to do all of the above.

yum -y check-update
yum -y update

After you have done all of the above, you should have all the packages available to setup GFS2/GFS on all your 3 Centos machine.

Configuring GFS2/GFS Cluster on Centos

Once you have your required centos packages installed, you would need to setup your Centos machine. Firstly, you would need to setup all your hosts file with all 3 servers machine name. Hence, i appended all my 3 servers machine name across and in each machine i would have the following additional line in my /etc/hosts file.

111.111.111.1 gfs1.hungred.com
111.111.111.2 gfs2.hungred.com
111.111.111.3 gfs3.hungred.com

where *.hungred.com is each machine name and the ip beside it are the machine ip addresses which allows each of them to communicate with each other by using the ip stated there.

Next, we will need to setup the cluster configuration of the server. On each machine, you will need to execute the following instruction to create a proper cluster configuration on each Centos machine.

ccs_tool create HungredCluster
ccs_tool addfence -C node1_ipmi fence_ipmilan ipaddr=111.111.111.1 login=root passwd=machine_1_password
ccs_tool addfence -C node2_ipmi fence_ipmilan ipaddr=111.111.111.2 login=root passwd=machine_2_password
ccs_tool addfence -C node3_ipmi fence_ipmilan ipaddr=111.111.111.3 login=root passwd=machine_3_password

ccs_tool addnode -C gfs1.hungred.com -n 1 -v 1 -f node1_ipmi
ccs_tool addnode -C gfs2.hungred.com -n 2 -v 1 -f node2_ipmi
ccs_tool addnode -C gfs3.hungred.com -n 3 -v 1 -f node3_ipmi

Next, you will need to start cman.

service cman start
service rgmanager start

cman should starts without any error. If you have any error while starting cman, your GFS2/GFS will not work. If everything works fine, you should see the following when you type the command as shown below,

[root@localhost ]# cman_tool nodes
10.0.0.1
Node  Sts   Inc   Joined               Name
   1   M     16   2011-1-06 02:30:27  gfs1.hungred.com
   2   M     20   2011-1-06 02:30:02  gfs2.hungred.com
   3   M     24   2011-1-06 02:36:01  gfs3.hungred.com

If the above shows, this means that you have properly setup your GFS2 cluster. Next we will need to setup GFS2!

Setting up GFS2/GFS on Centos

You will need to start the following services.

  • service gfs start
  • service gfs2 start

Once, this two has been started. All you need to do is to partition your SAN storage LUN. If you want to use GFS2, partition it with gfs2

/sbin/mkfs.gfs2 -j 10 -p lock_dlm -t HungredCluster:GFS /dev/sdb

Likewise, if you like to use gfs, just change it to gfs instead of gfs2

/sbin/mkfs.gfs -j 10 -p lock_dlm -t HungredCluster:GFS /dev/sdb

A little explanation here. HungredCluster is the one we created while we were setup out GFS2 Cluster. /dev/sdb is the SAN storage lun space which was discovered using iscsiadm. -j 10 is the number of journals. each machine within the cluster will require 1 cluster. Therefore, it is good to determine the number of machine you will place into this cluster. -p lock_dlm is the lock type we will be using. There are other 2 more types beside lock_dlm which you can search online.

P.S: All of the servers that will belong to the GFS cluster will need to be located in the same VLAN. Contact support if you need assistance regarding this.
If you are only configuring two servers in the cluster, you will need to manually edit the file /etc/cluster/cluster.conf file on each server. After the tag, add the following text:

If you do not make this change, the servers will not be able to establish a quorum and will refuse to cluster by design.

Setup GFS2/GFS run on startup

Key the following to ensure that GFS2/GFS starts everytime the system reboot.

chkconfig gfs on
chkconfig gfs2 on
chkconfig clvmd on //if you are using lvm
chkconfig cman on
chkconfig iscsi on
chkconfig acpid off
chkconfig rgmanager on
echo "/dev/sdb /home gfs2 defaults,noatime,nodiratime 0 0" >>/etc/fstab
mount /dev/sdb

Once this is done, your GFS2/GFS will have mount on your system to /home. You can check whether it works using the following command.

[root@localhost ~]# df -h

You should now be able to create files on one of the nodes in the cluster, and have the files appear right away on all the other nodes in the cluster.

Optimize clvmd

We can try to optimize lvmd to control the type of locking lvmd is using.

vi /etc/clvmd/clvmd.conf
find the below variables and change it to the variable as shown below
locking_type = 3
fallback_to_local_locking = 0
service clvmd restart

credit goes to http://pbraun.nethence.com/doc/filesystems/gfs2.html

Optimize GFS2/GFS

There are a few ways to optimize your gfs file system. Here are some of them.
Set your plock rate to unlimited and ownership to 1 in /etc/cluster/cluster.conf


Set noatime and nodiratime in your fstab.

echo "/dev/sdb /home gfs2 defaults,noatime,nodiratime 0 0" >>/etc/fstab

lastly, we can tune gfs directy by decreasing how often GFS2 demotes its locks via this method.

echo "
gfs2_tool settune /GFS glock_purge 50
gfs2_tool settune /GFS scand_secs 5
gfs2_tool settune /GFS demote_secs 20
gfs2_tool settune /GFS quota_account 0
gfs2_tool settune /GFS statfs_fast 1
gfs2_tool settune /GFS statfs_slots 128
" >> /etc/rc.local

credit goes to linuxdynasty.

iptables and gfs2/gfs port

If you wish to have iptables remain active, you will need to open up the following ports.

-A INPUT -i 10.10.10.200 -m state --state NEW -p udp -s 10.10.10.0/24 -d 10.10.10.0/24 --dport 5404, 5405 -j ACCEPT
-A INPUT -i 10.10.10.200 -m state --state NEW -m multiport -p tcp -s 10.10.10.0/24 -d 10.10.10.0/24 --dports 8084 -j ACCEPT
-A INPUT -i 10.10.10.200 -m state --state NEW -m multiport -p tcp -s 10.10.10.0/24 -d 10.10.10.0/24 --dports 11111 -j ACCEPT
-A INPUT -i 10.10.10.200 -m state --state NEW -m multiport -p tcp -s 10.10.10.0/24 -d 10.10.10.0/24 --dports 14567 -j ACCEPT
-A INPUT -i 10.10.10.200 -m state --state NEW -m multiport -p tcp -s 10.10.10.0/24 -d 10.10.10.0/24 --dports 16851 -j ACCEPT
-A INPUT -i 10.10.10.200 -m state --state NEW -m multiport -p tcp -s 10.10.10.0/24 -d 10.10.10.0/24 --dports 21064 -j ACCEPT
-A INPUT -i 10.10.10.200 -m state --state NEW -m multiport -p tcp -s 10.10.10.0/24 -d 10.10.10.0/24 --dports 41966,41967,41968,41969 -j ACCEPT
-A INPUT -i 10.10.10.200 -m state --state NEW -m multiport -p tcp -s 10.10.10.0/24 -d 10.10.10.0/24 --dports 50006,50008,50009 -j ACCEPT
-A INPUT -i 10.10.10.200 -m state --state NEW -m multiport -p udp -s 10.10.10.0/24 -d 10.10.10.0/24 --dports 50007 -j ACCEPT

Once these ports are open on your iptables, your cman should be able to restart properly without getting start either on fencing or cman starting point. Good Luck!

Troubleshooting

You might face some problem setting up GFS2 or GFS. Here are some of them which might be of some help

CMAN fencing failed

You get something like the following when you start your cman

Starting cluster:
Loading modules... done
Mounting configfs... done
Starting ccsd... done
Starting cman... done
Starting daemons... done
Starting fencing... failed

One of the possibility that is causing this is that your gfs2 has already been mounted to a drive. Hence, fencing failed. Try to unmount it and start it again.

mount.gfs2 error

if you are getting the following error

mount.gfs2: can't connect to gfs_controld: Connection refused

you need to try to start the cman service

Reference

How to Integrate Extjs Tree Panel Drag And Drop Into Extjs HtmlEditor

This is a problem that i face during an integration with Extjs Tree Panel drag and drop functionality into extjs htmleditor. The research process doesn't take very long because the only clue online was extjs forum with the title "Drag and drop into child iframe document". Many said it was impossible. But there were actually people who had done this previously and successfully drag and drop tree panel items into extjs htmleditor. However, many will be clueless without a proper demo or actual code to see the effect of such implementation.  The forum page do exist code that could be of help in your implementation but you would really need to guess and try to see whether it works. In my case, i manage to get it work.

Htmleditor Problem

The problem was fairly straight forward. The drag and drop functionality in extjs cannot drag into iframe. Our Extjs htmleditor is using iframe for their editor implementation. Therefore, if you try to drag your items into the iframe, it will basically stuck somewhere outside of the htmleditor/iframe. Drop is also an issue since the drop behavior is being stopped by the implementation done by the htmleditor. Now, our objective here in this article is to make it so that the drag and drop will work within the iframe.

Drag and drop into htmleditor Solution

The solutions here is to overwrite the behavior of the htmleditor so that it accept the drag items into the iframe. This can be done using Extjs Event manager as shown below,

pushValue: function(){
	var ddm = Ext.dd.DragDropMgr;
	Ext.EventManager.on(this.iframe.contentDocument, "mousemove", ddm.handleMouseMove, ddm, true);
	Ext.EventManager.on(this.iframe.contentDocument, "mouseup", ddm.handleMouseUp, ddm, true);
},

The above code utilized htmleditor pushValue functionality to overwrite two behavior on extjs htmleditor. mousemove and mouseup is overwritten with the default behavior of Ext.dd.DragDropMgr. This will allow the behavior to properly mouseover the htmleditor content and also drop it accordingly. Once you have done that, your treepanel items should have no problem dragging around the htmleditor. However, drop will still be an issue since we haven't attached the appropriate drop zone into the htmleditor.

DropZone on Htmleditor

In order to drag the items on the treepanel into the extjs htmleditor, we will definitely needs to define a dragzone which is similiar to the dragzone on the treepanel. However to create a dragzone, the component must be initialized before any attachment can be done. Hence, we will create a listeners on htmleditor to see when it is render so that we can attach a dragzone into it.

listeners: {
	'render': function(){
		var DCZone = new Ext.dd.DropZone(Ext.get('ext-gen10'), {
			ddGroup: 'DCZone',
			/* If the mouse is over a target node, return that node. This is
			provided as the "target" parameter in all "onNodeXXXX" node event handling functions */
			getTargetFromEvent: function(e) {
				//console.log('getTargetFromEvent'+new Date().getTime());
				return e.getTarget();
			},

			/* On node drop, we can interrogate the target node to find the underlying
			application object that is the real target of the dragged data.
			We can use the data set up by the DragZone's getDragData method to read
			any data we decided to attach. */
			onNodeDrop : function(target, dd, e, data){
				console.log('onNodeDrop');
				// do your work here

				Ext.fly(this.getEl()).frame("00AE00");
				return true;
			}
		});

	}
}

Now, the important part here for our htmleditor iframe to work so that the drop items will land on it is the overwrite function of getTargetFromEvent. If this function doesn't exist, the whole thing must not work. Therefore, the method is important to have. Ext.get('ext-gen10') is the parent element of the iframe. Once this are all done properly, you should be able to get an iframe that is draggable and droppable into it.

 

Solution Demo

Like i have mention, a demo will be much more appropriate. Hence, here's an attachment of what i have been saying.