Thursday, September 30, 2010

Mysql-Proxy

Mysql-proxy installation and configuring on FreeBSD server

Mysql proxy is a intermediate between mysql client and mysql server.


# cd /usr/ports/
#make search name=mysql-proxy --> from there you will get the port path
# cd /usr/ports/databases/mysql-proxy
# make
# make install

on /etc/rc.conf we need to add the following settings

mysql_proxy_enable="YES"
mysql_proxy_address=":3307" --> port no
mysql_proxy_backend_addresses="proxing server IP:3306"
mysql_proxy_args="--user=mysql"

next /usr/local/etc/rc.d/mysql-proxy restart

finally confirm mysql-proxy is running and listening on the correct port
# ps aux |grep sql

Any mysql connection to this server would be redirected to sql server on your proxing server IP(DB server ip):3306

Monday, September 27, 2010

VPS RAM

Setting RAM for a VPS(openVZ)

1. 512MB GUARANTEED RAM and 1024MB Burst RAM
vzctl set VEID --vmguarpages 512M --save
vzctl set VEID --oomguarpages 512M --save
vzctl set VEID --privvmpages 512M:1024M --save

easyapache run issue.

sh-3.2# /scripts/easyapache
cPanel Update (upcp) is currently running. Please wait for upcp to complete, or kill off all upcp processes and try again.
sh-3.2# ps aux | grep upcp
root 11611 0.0 0.0 3080 728 pts/1 S+ 05:12 0:00 grep upcp
root 24126 0.0 0.0 2488 980 ? Ss 04:31 0:00 /bin/sh -c sleep $((RANDOM % 7100)); /bin/nice -n +19 /scripts/upcp --force
sh-3.2# kill -9 24126

then you run your easyapche script it will work. this upcp is cpanel cron that is executing as per your your cron setting.

sh-3.2# /scripts/upcp --force
Running Futex Check/Fix......Done
cPanel Update (upcp) is already running. Please wait for the previous upcp to complete, or kill off all upcp processes and try again. You may wish to use '--force'
sh-3.2# ps aux | grep upcp
root 13417 0.0 0.4 6900 5240 ? S 01:24 0:00 cPanel Update (upcp) - Master
root 13576 0.0 0.4 6900 4476 ? Ss 01:24 0:00 cPanel Update (upcp) - Slave
root 19519 0.0 0.0 1916 548 pts/2 S+ 01:26 0:00 grep upcp
sh-3.2# kill -9 13417
sh-3.2# kill -9 13576

Changing Port No

1. Changing FTP port number
# ps aux | grep ftp --> to check which ftp server
if it is pure-ftpd
# vi /etc/pure-ftpd.conf
under IP address/port to listen to add a new line as Bind *,2121
# service pure-ftpd restart
Replace the same port on your csf configuration file /etc/csf.conf and restart csf

2. Changing ssh port
# vi /etc/ssh/sshd_config
#Port 22 default line to Port 9555(as you required, not 0-1024)
# service sshd restart
Replace the same port on your csf configuration file /etc/csf.conf and restart csf

Sunday, September 26, 2010

Unable to delete a email account

Using your Cpanel you can not delete a particular email account [cpanel >> mail >> Email Accounts]
Error:-
The e-mail address user@yourdomain.com deleted successfully.Sorry, you do not have access to the domain yourdomain.com

Delete the entries from
1. vi /home/ajeeshc/etc/ajeesh.com/passwd
ajeesh:x:506:503::/home/ajeeshc/mail/ajeesh.com/ajeesh:/bin/bash --> for ajeesh@ajeesh.com
2. vi /home/ajeeshc/etc/ajeesh.com/shadow
3. vi /home/ajeeshc/.cpanel/email_accounts.yaml

ajeesh:
diskquota: 262144000
diskused: 0
mtime: '1285469016' -->
4. rm -rf /home/ajeeshc/mail/ajeesh.com/ajeesh/

0.00MB Mysql DB size

On your Cpanel > MySQL Databases > Current Databases size shows as 0.00 MB

To correct this please do the following process
1. vi /var/cpanel/cpanel.config
disk_usage_include_sqldbs value should be "0" change to "1" and wq from your vi editor
ie, it should be as disk_usage_include_sqldbs=1

2. # /scripts/update_db_cache

3. Login to WHM >> Main >> Server Configuration >> Tweak Settings
put "tick" mark for "Calculate the disk usage of account MySQL and PostgreSQL databases" under SQL section
By default it is tick marked in WHM

This will fix your issues. :)

PPP [Pear to Pear] module installation on OpenVz VPS

For enable PPP you need Hardware Node access.
To insert module to your existing Kernel.Please do the following steps
1. # modprobe ppp_async
2. # modprobe ppp_deflate

To check the module installed or not
3. # lsmod | grep ppp


4. # vzctl set VEID –devices c:108:0:rw –save
5. # vzctl exec VEID mknod /dev/ppp c 108 0
6. # vzctl exec VEID chmod 600 /dev/ppp

7. # vzctl restart VEID

8. # vzctl enter VEID

9. # /usr/sbin/pppd --> for confirming