Friday, December 24, 2010

TUN TAP DEVICE/ OPENVPN

Enabling TUN DEVICE/ OPENVPN on your server (on Virtual Private Server).

For enabling TUN Device or Open VPN you need to access your hardware node. If you have the Hardware access please do the following steps.

[root@ajeesh ~]# modprobe tun
[root@ajeesh ~]# veid=99999[enter your VEID no]
[root@ajeesh ~]# /usr/sbin/vzctl set $veid --devices c:10:200:rw --save
Setting devices
Saved parameters for VE 99999
[root@ajeesh ~]# /usr/sbin/vzctl exec $veid mkdir -p /dev/net
[root@ajeesh ~]# /usr/sbin/vzctl exec $veid mknod /dev/net/tun c 10 200
mknod: `/dev/net/tun': File exists
[root@ajeesh ~]# /usr/sbin/vzctl exec $veid chmod 600 /dev/net/tun

Thanks you comments are valuable to me ....

Wednesday, December 22, 2010

Joomla error

Warning: Parameter 2 to frontpage() expected to be a reference, value given in /home/username/public_html/includes/Cache/Lite/Function.php on line 100

Warning: Parameter 2 to "some functions"

This error is an incompatibility between Joomla and PHP version. You may be using php version 5.3 or higher than this. As far as i know PHP 5.3 version is having some bugs

I have resolved this issue by downgrading php version to 5.2.14

Thanks,

Tuesday, December 21, 2010

how to point another server

How to point www or MX record to another server

If you would like to load your web site from another server you can easily do it by editing the DNS record. Please check the follow the following

1. Set A record for your domain to another server IP

yourdomain.com IN A another server IP

2. After that set www A record also to another server IP

www IN A another server IP

3. All other services A record should be point to current Server IP that is ,
cpanel IN A current Server IP
whm IN A current Server IP
webmail IN A current Server IP


How to point MX record to another server ( If you want use another server as your mail server)

1. Login into your WHM
2. click on Edit DNS
3. Select the domain you want to change the server
4. change the MX record pointing web site from yourdomain.com to mail.yourdomain.com
5. After that we need to add a A record for mail.yourdomain.com
ie, mail.yourdomain.com IN A another server IP

Monday, December 20, 2010

Mail Notifier in Gmail

Image representing Gmail as depicted in CrunchBaseImage via CrunchBase




Gmail mail notifier settings is a very good feature. Using this you can avoid all your email client software. However which makes your system more fast.

Using the mail notifier you will get a sound notification from your Gmail account. Sound can be in any formate. But in the case of Mozilla Firefox sound should be in .wav formate.

To set the mail notifier on your Browser please do the following steps.

1. Click on " Customize and control Google Chrome "
2. Go to Tools -> Extensions -> Get more extensions
3. Search for Gmail Notifier on top right side
4. Click on that " INSTALL"
5. Restart your Google Chrome ( Simply You can close all Google Chrome and take Again from Application -> Internet -> Google chrome)

Settings

1. Tools -> Extensions -> Gmail Notifier -> Option
2. Custom Domain (If your Domain is Set Google Apps) Add your domain https://mail.google.com/a/yourdomain.com
3. Moreover you can set notification time and sound

Setting a custom sound for your Gmail Notifier

1. Go to
[ajeesh@tech23 ~]$ cd .config/google-chrome/Default/Extensions/kkmbodalobogbnejmcdghkfimhodifol/1.1.0_0/

2. There you can see "notify.mp3"

3. Rename your customer sound file (say mysound.mp3 copied to that location) to "notify.mp3"

Please try and feel the difference !!!! It is very nice for you. This will reduce your respomse time and enjoy your work !!! :)

Issues:-
If the sound is not enabled please do the following steps

1. Tools -> Extensions -> Gmail Notifier
2. Click "Disable" and Enable it again once more


Enhanced by Zemanta

Sunday, December 19, 2010

MaxClients exceeds ServerLimit

Logo for the Apache HTTPD Server Project .Image via Wikipedia








# /scripts/restartsrv_httpd
WARNING: MaxClients of 900 exceeds ServerLimit value of 256 servers,
lowering MaxClients to 256. To increase, please see the ServerLimit
directive.
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

Moreover site is also loading very slowly we can say it is not loading also.

Please retry your /etc/http/conf/httpd.conf



StartServers 25
MinSpareServers 10
MaxSpareServers 20
MaxClients 900
MaxRequestsPerChild 250



To


StartServers 25
MinSpareServers 10
MaxSpareServers 20
ServerLimit 900
MaxClients 900
MaxRequestsPerChild 250


Please note that ServerLimit should come above MaxClients
Enhanced by Zemanta

Wednesday, December 15, 2010

Error from park wrapper: yourdomain is already configured

Error from park wrapper: yourdomain is already configured while you are adding addon domain through cpanel.

Once you are getting this error, we have to manually remove the particular domain from the following location and retry again from your cpanel to add that domain as addon domain

1. /etc/httpd/conf/httpd.conf
2. /etc/userdomains
3. /etc/named.conf
4. cd /var/named/ domain.com.db file delete
5. /etc/localdomains
6. /etc/valiases/
7. /etc/vdomainaliases/
8. /etc/trueuserdomains
9. /etc/trueuserowners
10 /etc/vmail/
11 cd /var/cpanel/bandwidth/

Still your cpanel is showing this error we have to add our domain.com manually into these files. While adding you have to take back of all those important files.
[httpd.conf , named.conf , userdomains etc ]

Or some times you may get the error like
Error from park wrapper: domain.com is owned by another user

Try the above fix , this is not fixed Go to WHM -> Server Configuration -> Tweak Settings
enable "Allow Creation of Parked/Addon Domains that are not registered"
After that go to "/var/cpanel/cpanel.config" add "autocreateaentries=0" and save your file

All your comments are valuable to me ...

Wednesday, December 8, 2010

mtr tool

mtr is a good tool to check the packet lose for a domain. Its give us the companied effect of PING and traceroute. It is a network monitoring tool. mtr toll is ued when we are facing some buffering issue. Using this tool we can check packet lose for a particular domain.On the screen we can see how much packet lose with respect to the packet sent.
Loss% Snt Last Avg Best Wrst StDev are the parameters

[ajeesh@tech23 ~]$ mtr ajeeshbkannan.blogspot.com



try this on your linux machine ctl+q to quit from the screen

Tuesday, December 7, 2010

kill all user process

You can kill all process under a particular user on your WHM/cpanel

System Health -> Process Manager -> Kill all processes by users select the particular user and kill it.

For some cases pkill -u will make any changes on your server. So this WHM feature will help you a lot.

Monday, December 6, 2010

cpanel login logs

All cpanel/WHm login logs you can check on all cpanel servers


]# grep -f /usr/local/cpanel/logs/login_log

From here you can check the whm root/reseller/cpanel user login failures

Wednesday, November 17, 2010

View stats without login into capnel

Without login into cpanel how we can check the webalizer stats

Some of the designers they don't want to provide the cpanel login details to their customers because they will mess up your domain settings :-D. Here is a simple method how to allow the non tech customers to view their web site stats without login into their cpanel

1. cd /home/ajeesh/public_html/

next please verify your stats location, most of the cases it will be on your /home/username/tmp/

2. ln -s home/ajeesh/tmp/webalizer/ stats (here i have created a soft link to his home directory)

3. chown -R ajeesh.ajeesh stats/

that is all now they can see that stats on www.domainname.com/stats

Friday, November 12, 2010

welcome message for SSH

You can set your own Welcome message for your server for that you need to edit your /etc/motd file

[root@tech24 ajeesh]# vi /etc/motd

Wednesday, November 10, 2010

Cpanel quota issues

On VPS based system
/proc/vz/vzaquota/00000073/aquota.group and /proc/vz/vzaquota/00000073/aquota.user are the files which managing the VPS quota

For some cases customer can not create users because of the quota issue. This may likely because of the damage of their quota file.

Solution
On you VE please run the following commands.

rm -rf /aquota.user 2>/dev/null
rm -rf /aquota.group 2>/dev/null
unlink /aquota.user 2>/dev/null
unlink /aquota.group 2>/dev/null
for x in `find /proc/vz/vzaquota/ | tail -2 `; do ln -s $x / ; done

=============================
2. WHM and server showing different quota size
# /scripts/initquotas
# /scripts/fixquotas
# /scripts/resetquotas
screen -S ea quotacheck
sh-3.00# quotacheck -avfumg

now compare whm and server to verify your disk quota is similar

If it is not perfect we need to take vm offline for 10 minutes to recalculate the disk space usage

On your HN(Harware Node)
# screen -S quotarebuild
# vzctl stop
# vzquota drop
# vzctl start

Saturday, October 30, 2010

Nginx installation

Nginx installation and configuration on Centos5

1.Installing Nginx and required modules

first we can install the most important packages for nginx

for my case i have downloaded the pcre,zlib,openssl packages to /opt/nginx-0.7.67 (Where nginx-0.7.67 is from untared nginx)
cd /opt/nginx-0.7.67
#wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.10.tar.gz
(pcre for regular expressions)
#tar -xvf pcre-8.10.tar.gz
#./configure
#make
#make install

#wget http://zlib.net/zlib-1.2.5.tar.gz
#tar -xvf zlib-1.2.5.tar.gz
#./configure
#make
#make install

#wget ftp://ftp.openssl.org/source/openssl-0.9.8o.tar.gz
#tar -xvf openssl-0.9.8o.tar.gz
#./config
#make
#make install

#cd /opt
#wget http://nginx.org/download/nginx-0.7.67.tar.gz
#tar -xvf nginx-0.7.67.tar.gz
#cd nginx-0.7.67

# ./configure --prefix=/etc/nginx --user=nginx --group=nginx --with-http_ssl_module --without-http_rewrite_module --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --with-pcre --with-pcre=/opt/nginx-0.7.67/pcre-8.10/ --with-openssl=/opt/nginx-0.7.67/openssl-0.9.8o/ --with-zlib=/opt/nginx-0.7.67/zlib-1.2.5/
# make
# make install

useradd -M -r --shell /sbin/nologin --home-dir /etc/nginx nginx

# /etc/rc.d/init.d/nginx restart
/etc/rc.d/init.d/nginx: line 67: /opt/nginx/sbin/nginx: No such file or directory

#vi /etc/rc.d/init.d/nginx

nginx="/etc/nginx/sbin/nginx"
prog=$(basename $nginx)

NGINX_CONF_FILE="/etc/nginx/conf/nginx.conf"

Next we have to install spawn-fcgi for loading php pages for your web site.
#cd /opt/nginx-0.7.67
#wget http://www.lighttpd.net/download/lighttpd-1.4.18.tar.bz2
#tar -xvjf lighttpd-1.4.18.tar.bz2
#cd lighttpd-1.4.18/
#./configure
#make
#sudo cp src/spawn-fcgi /usr/bin/spawn-fcgi
#cd ..
#rm -rf lighttpd-1.4.18/
#rm lighttpd-1.4.18.tar.bz2
#/usr/bin/spawn-fcgi -f /usr/bin/php-cgi -a 127.0.0.1 -p 9000 -P /var/run/ajeesh.pid

2. configuring site

mkdir -p /home/ajeesh/public_html/
mkdir /home/ajeesh/public_html/logs
chown -R nginx:nginx /home/ajeesh/public_html

mkdir /etc/nginx/conf/sites-available
mkdir /etc/nginx/conf/sites-enabled

open your nginx conf file and inserver include
include /etc/nginx/conf/sites-enabled/*; --> under your another virtual host using mix of IP-, name-, and port-based configuration on /etc/nginx/conf/nginx.conf

open vi /etc/nginx/conf/sites-available/ajeesh.com

server {
listen 81;
server_name www.ajeesh.com ajeesh.com;
access_log /home/ajeesh/public_html/logs/access.log;
error_log /home/ajeesh/public_html/logs/error.log;

location / {
root /home/ajeesh/public_html;
index index.html index.htm;
}

location ~ \.php$ {
include /etc/nginx/conf/fastcgi_params;
fastcgi_pass localhost:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/ajeesh/public_html/www.ajeesh.com/public_html$fastcgi_script_name;
}
}

# cd /etc/nginx/conf/sites-enabled
# ln -s /etc/nginx/conf/sites-available/ajeesh.com
# service nginx start

Friday, October 29, 2010

webmail blank page

Issue:-
While accessing web mail through cpanel , you will get a blank page for the webmail. There won't see any squirrel mail,Horde, option for you to choose

Fix:- Try to change the Theme or update the same theme once again will fix the issue.

Wednesday, October 27, 2010

Apache module

How to check loaded apache modules

[/]# httpd -t -D DUMP_MODULES

For example if you want to enable mod_deflate Module you can recompile your apache using easyapache(for cpanel servers) and click deflate option and recompile it

Tuesday, October 26, 2010

Exim Error

exim-465 failed @ Mon Oct xx xx:xx:xx 20xx. A restart was attempted automagically.
Service Check Method: [tcp connect]

Failure Reason: Timeout while trying to get data from service
******


Solution:

First please try
WHM > Service Configuration > Exim Configuration Editor > click the "Reset all Configs to Defaults" button

if not please try this.

# wget -O /scripts/buildeximconf \http://httpupdate.cpanel.net/autofixer/buildeximconf
# chmod 700 /scripts/buildeximconf
/scripts/buildeximconf
/scripts/restartsrv_exim

Saturday, October 23, 2010

allow ssh via authorized keys

First we have to check the following settings

on your server /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

PermitRootLogin yes
PasswordAuthentication yes

After that on your client computer you need to generate ssh public key using dsa or rsa

#ssh-keygen -t rsa

this key will automatically generate and store on your /home/user/.ssh/id_rsa.pub
copy the content and paste on your server /root/.ssh/authorized_keys

please note that your root permission should be correct

you can check your log file on location /var/log/auth.log

Friday, October 15, 2010

Ezeelogin

1. Ezeelogin Log Files

All webpanel errors for ezeelogin would be in the dir assuming the default installation.(Ezeelogin installed in /usr/local/apache/htdocs/)

EzeeloginWebpanel files
-------------------------------------
/usr/local/apache/htdocs/ezeelogin/


Ezeelogin Web panel system file and Error logs path
-----------------------------------------------
/usr/local/apache/ezeelogin/logs/


Ezeelogin shell error logs for any user would be
-----------------
/home//ezeelogin.log

eg:/home/ezadmin/ezeelogin.log

2. User delete failed

Error:-Trying to delete a user and get the following error:
User delete failed
Cannot delete user on this node: REMOTE HOST IDENTIFICATION HAS CHANGED! (Reset fingerprint to authorize the change)

* this customer migrate the installation to a new server

Solution:- Need to reset the fingerprint of your current node. For that click on the 'Reset this node fingerprint' button under Settings->Cluster-> 





And for a particular server side issue you can fix this .
Servers > list servers > edit > advance option > Reset finger print.

3.User add failed

User add failed
sh: /usr/local/ezeelogin/ezlcltool: Permission denied

This may due to customer has been enabled selinux. They can verify this by using the command
root@jjjjjjjjj~]# ls -lZ /usr/local/ezeelogin/ezlcltool

-rwxr-xr-x root root root:object_r:usr_t /usr/local/ezeelogin/ezlcltool

So Disabling selinux will fix the issue

4.Error waiting for connection Error waiting for connection Error waiting for connection SSH log file (/var/log/ezeelogin/input/ezadmin/root~server.xxxx.com~Tue_Apr_6_18:16:12_2010) creation failed: Permission denied SSH log file (/var/log/ezeelogin/input/ezadmin/root~domain.com~Tue_Apr_6_18:17:58_2010) creation failed: Permission denied SSH log file (/var/log/ezeelogin/input/ezadmin/root~anotherdomain.net~Tue_Apr_6_18:18:05_2010) creation failed: Permission denied

Solution:-
chown -R ezadmin:ezuser /var/log/ezeelogin/

5. Connected successfully Authentication methods: publickey,keyboard-interactive Authentication by ssh key failed! Authentication by ssh key failed (pub: /usr/local/etc/ezeelogin/id_key.pub, priv: /usr/local/etc/ezeelogin/id_key, pass: OqDRjj3yVpyez3m): Username/PublicKey combination invalid Authentication by password not supported! User: root Action: C Server_id: 0 New password cipher: UZEi9CFPg4OIY89TKsobBnrQeh0Zf2injCoDe6j/+COqM8WHjMxuZu4in4u/kt2Z+fw3mPNzr1OUYY6UwgctJJlYWJ3oZroAoFjR3r4TrFX7mQHu0ZLYyvmrksTCny95u0toVb+9y2kVS67UdadFLzanbLfanU2n3UOt6TQnuKtJLQhRLqGB+8WHp+YZFfgMEJi6EYM9QljH4F4QreXkeMAq0GzlswDOLDOtPAJIlMJf8KrYCoWJZt+ypmJW0Jw+gAQ4PFyeO1k6TA/CZavM9pfJ0L3oIRXFRxuA1pqXJ/S7HadFm/QB3bn+6I9oQinEp/9YOieNtHGcxRlp2j0Ceg== New password: redhat Current password: Connecting to [10.10.11.1:22], timeout: 30

error geting while adding server to ezeelogin

solution:
By adding ' PasswordAuthentication yes ' on ssh config file(/etc/ssh/sshd_conf).


6 
issue: Installing Ezeelogin... Fetching binaries package... Could not fetch binary package. Please contact support@ezeelogin.com

 This may be an issue with the unavailability of ezeelogin repository with the particular Operating System.

ezeelogin package is not available in the ezeelogin repository for your installation. So this time it is good to open a support ticket with ezeelogin and they will add the installation package with in 24hours time.
 
Meanwhile, you could try the installation with the latest available download from your client area and once they updated the package you may upgrade to the latest version( using the command sh ezeelogin_version.bin -- -update)

7.  Blank page
If Selinux is enabled,  ioncube loader will not be available for your ezeelogin installed location. You will get blank page. So you have to disable Selinux on your ezeelogin installed server.

8. 04-09-2013
GeoIP issue: Invalid database type GeoIP Country Edition,
Fix:
1. wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
2. gunzip GeoLiteCity.dat.gz
3. mkdir -p /usr/local/share/GeoIP/
4. mv GeoLiteCity.dat /usr/local/share/GeoIP/

Thursday, October 14, 2010

freeBSD

User add / delete in FreeBSD:-
Adding User

[root@fbsd ~]# adduser
Username: ajeesh
Full name: Ajeesh B Kannan
Uid (Leave empty for default):
Login group [ajeesh]:
Login group is ajeesh. Invite ajeesh into other groups? []: wheel
Login class [default]:
Shell (sh csh tcsh bash rbash nologin) [sh]: bash
Home directory [/home/ajeesh]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password:
Enter password again:
Lock out the account after creation? [no]:
Username : ajeesh
Password : *****
Full Name : Ajeesh B Kannan
Uid : 1005
Class :
Groups : ajeesh wheel
Home : /home/ajeesh
Home Mode :
Shell : /usr/local/bin/bash
Locked : no
OK? (yes/no): yes
adduser: INFO: Successfully added (ajeesh) to the user database.
Add another user? (yes/no): no
Goodbye!

Delete user:-
[root@fbsd ~]# rmuser
Please enter one or more usernames: jack
Matching password entry:

jack:*:1006:1006::0:0:jack T:/home/jack:/bin/sh

Is this the entry you wish to remove? y
Remove user's home directory (/home/jack)? y
Removing user (jack): processes(2) mailspool home passwd.

1. Screen Install

[root@fbsd ~]# cd /usr/ports/sysutils/screen
[root@fbsd ~]# make install clean

2. Bash Shell
#cd /usr/ports/shells/bash
#make install clean
To make bash as default shell
# chsh -s /usr/local/bin/bash root(or your required username)
To check whether bash is installed
#finger root(or your required username)

2. Installing and configuring PURE-FTP on Free BSD
cd /usr/ports
1. make search name=pure-ftp :- find out the port
2. # make config
3. # make install clean
4. # cd /usr/local/etc
5. # cp pure-ftpd.conf.sample pure-ftpd.conf
6. # chmod 644 pure-ftpd.conf
7. # ee pure-ftpd.conf

VerboseLog yes
PureDB /usr/local/etc/pureftpd.pdb
CreateHomeDir yes
8. # pure-pwconvert >> /usr/local/etc/pureftpd.passwd
9. # chmod 600 /usr/local/etc/pureftpd.passwd
10.# pure-pw mkdb
11.# pw useradd vftp -s /sbin/nologin -w no -d /usr/home/vftp? -c "Virtual FTP user" -m
12.# pure-pw useradd ajeesh -u vftp -g vftp -d /usr/home/vftp/ajeesh
13.# pure-pw mkdb
14.# /usr/local/etc/rc.d/pure-ftpd onestart

once you add pureftpd_enable="YES" on /etc/rc.conf you can restart pure-ftp
# /usr/local/etc/rc.d/pure-ftpd restart
# /usr/local/etc/rc.d/pure-ftpd status

Saturday, October 9, 2010

Clamd:unable to connect UNIX socket

Clamd: unable to connect to UNIX socket error
Exim error log:
2009-03-07 11:20:46 1LfzGv-00033h-9T malware acl condition: clamd: unable to connect to UNIX socket /var/clamd (No such file or directory)
2009-03-07 11:20:46 1LfzGv-00033h-9T H=(n55.bullet.mail.sp1.yahoo.com) [98.136.44.188] F= temporarily rejected after DATA

Solution:
1. Uninstall clamd from WHM
WHM-->Cpanel->>Plugins/Modules

2. Remove files
/etc/clamd.conf
/etc/freshclam.conf

3. Reinstall clamd

PHP Warning

Error:-
[22-Sep-2010 00:53:58] PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so' -
/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so: undefined
symbol: sqlite3_libversion in Unknown on line 0

Or some your error log file for your domain size will increase with the above error more that 1GB

Solution :- comment out pdo_sqlite in php.ini (;) or

Recompile your Apache to 5.2.13 or 14 stable version

Greylisting

Error:-

2010-10-09 08:07:20 1P4SaL-0000NW-L1 == emailID R=dk_lookuphost T=dk_remote_smtp defer (-44): SMTP error from remote mail server after RCPT TO:: host Theirmailser [196.28.76.20]: 451 Temporary Policy Rejection - Please try later
2010-10-09 08:07:32 cwd=/var/spool/exim/msglog 3 args: exim -Mvl 1P4SaL-0000NW-L1
2010-10-09 08:08:36 cwd=/var/spool/exim/msglog 3 args: exim -Mvb 1P4SaL-0000NW-L1

Once we enabled Greylisting on our exim mail server it will not accept our first email and send the bounce message with "temporary failure report" with "==" symbol.
Why we are enabling greylisting on mail server: To avoid virus's and spam bots emails to servers. Virus and spam bots often don't bother to try again, if they fail to deliver a message on the first attempt.
All our exim default settings (/etc/exim.conf) retries every 15 minutes for 2 hours. Means once the mail delivery failed after 15minutes it will retry to send email again. On that time all greylisting servers will allow and delivered to particular consignee.
If you want to reset retry to every 5minutes for 2 hours we need to edit exim.conf(RETRY CONFIGURATION) section as
* * F,2h,5m; G,16h,1h,1.5; F,4d,8h
and restart exim

Friday, October 8, 2010

INNODB to MYISAM

If you need to transfer your database which is INNODB formate to another server which engine is MYISAM
suppose test.sql is your database
You can check whic Engine it is used by using the command
# head -100 test.sql --> there you can see innodb or MYISAM

Our requirement is to restore the database to MYISAM however our server is supporting MYISAM. So we need to edit /etc/my.cnf line #skip-innodb to skip-innodb

Then execute the following perl script to change all Innodb terms in test.sql to MyISAM
perl -p -i -e "s/Innodb/MyISAM/" test.sql

Then restore the database
In some cases, database may be created by executing the commands in the dump file (for example if .sql file contains create database databasename)
So inorder to restore the dump just execute
mysql < test.sql

Wednesday, October 6, 2010

Web Mail Errors

1. Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /usr/local/cpanel/base/3rdparty/squirrelmail/plugins/login_auth/functions.php on line 129

Solution :
Upgrade your capanel --> /scripts/upcp --force
Will fix the issue

Friday, October 1, 2010

park domain

While Creating a redirection for your park domain it is showing an ERROR as

Apache detected an error in the Rewrite config. ErrorDocument takes two arguments, Change responses for HTTP errors

Which is due to your .htaccess rewrite rule mistake. Once you correct that it will work ok for you.

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

Thursday, September 23, 2010

Removing malicious Code

Removing malicious Code from your pages:-

Once your server compromised or hacked, most case they have insert some malicious Codes/ scripts on all your web pages. So these following commands will help you to remove completely from your server.

First we need to identify which files are infected with malicious Code/malicious Scripts, for that we can use the following command
1. grep -Ri SEARCH WORD DIRECTORYNAME
OR
2. grep -Ri --files-with-matches 'searchword' directorname(or). for current directory

Script for searching a word in a file and delete that line

#!/bin/bash
grep -rl --include=*.{php,js,html} 123 $1 | xargs sed -i".bckp" '/123/d'
rm -f $1/*.bckp

Sunday, September 19, 2010

Friday, September 17, 2010

WORDPRESS

1. Fatal error:Call to undefined function wp() in /home/user/public html/wp-blog-header.php on line14

Solution:-
This issue is due to your wordpress wp-config.php content. For my case wp-config.php content was null. So i have copied the wp-config.php from backup and solve this issue.

or if you dont have one, there is one example:wp-config-sample.php change the name of that file to wp-config.php and change the database connection configures

2.Wordpress site very slow
This might be because of the plugins that you have installed on your wordpress site. Try disabling the last installed plugin or disable them all. To disable, you can follow the following steps
Cpanel --> PhpMyadmin --> Select Database -->> wp-options -->>select active_plugins(will be on page 2) -->>Edit
Copy down the plugins to somewhere else
Remove the plugins from there
Click GO
Then we can re enable it one by one form wordpress admin dashboard, so that we can find the plugin which caused the problem.
NB: If this solution is not successful, you can check these options: Upgrade to the Latest Version, Check With The Host, Optimize the Database, Verify That it Isn’t A Connectivity Issue,

3.Blank Pages in home page or admin page

This is due to recently added plugin , so we can avoid this by disable the last activated plugin by using your PHPMYADMIN[ select the particular database from wp_options > active_plugins]

or this may due to the wrong theme selection , all your wordpress themes are located on /wp-content/themes directory. So we can select the correct theme to "template" and "stylesheet" fields on your Phpmyadmin >> wp-options

*Idea from Dan Thompson

4. Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/user/public_html/wp-content/plugins/web-traffic-genius-pro/curl_functions.php on line 80 or 37 etc

In this situation we need to check php.ini whether safe_mode set to OFF and open_basedir is comment out. In my case open_basedir was not comment out. So i have copied a php.ini file to wp-admin directory and change the line as ;open_basedir = "/home:/tmp:/usr"

5 Problems when trying to open a post from categories list.
or RSS Feed time out

Solution:- Try disabling all your plugins, then see if you can access the feed and the categories. If you can, you then need to re-activate the plugins 1 by 1 until you find which one is causing the site to stop loading correctly.

6 increase the upload size
Solution: copy a php.ini file on your home directory and paste the line
upload_max_filesize = 32M(your required size)

Friday, September 10, 2010

Advanced DNS Zone Editor

For enabling Advanced DNS Zone Editor on your cpanel Please do the following

Main >> Packages >> Feature Manager
Edit a Feature List (Click "Edit") There you can put tick mark on your required fields.

Wednesday, September 8, 2010

DDOS ATTACK

Symptoms
*Unusual slow network performance
*Unavailability of a particular web site
*Inability to access any web site
*increase the number of spam emails

There are some paid services are there for doing this DDOS attack for the compting companies server to put down. What they are doing , accessing the website from different geo-location/IPs . That is the no of connections made by them should be greater your web server able to handle.

Following command will give you a sorted list of IP addresses that are being connected to the server at port 80:-
netstat -n | awk '{ print $5 }' | cut -d ":" -f 1 | grep "[1-9]" | sort | uniq -c | sort -n
netstat -plan |grep :80 | awk '{print $5}' |cut -d: -f1 |sort |uniq -c |sort -n

You can use the following command to block the IP address:-
iptables -A INPUT -s IP --dport 80 -p tcp -j DROP


There are some scripts will automatically help you against DoS attacks on your server

1. DDoS Deflate

They are using the command " netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n " on their script.

Configuration file is located on /usr/local/ddos/ddos.conf

IP addresses are automatically unblocked after a preconfigured time limit (default: 600 seconds)

To install, simply follow these directions:-

cd /usr/local/src/
wget http://www.inetbase.com/scripts/ddos/install.sh
chmod 0700 install.sh
./install.sh


Installing DOS-Deflate 0.6

Downloading source files.........done
Creating cron to run script every minute.....(Default setting).....done
Installation has completed.
Config file is at /usr/local/ddos/ddos.conf
Please send in your comments and/or suggestions to zaf@vsnl.com
quit from the page

After installing we can do the configuration on /usr/local/ddos/ddos.conf with your favourite editor

NO_OF_CONNECTIONS=150 (it is the default value)
BAN_PERIOD=600(it is the default value) it means Number of seconds the banned ip should remain in blacklist.

==================
Hardening sysctl.conf

/etc/sysctl.conf using your favorite text editor and add the following

# Enable IP spoofing protection, turn on Source Address Verification
net.ipv4.conf.all.rp_filter = 1
# Enable TCP SYN Cookie Protection
net.ipv4.tcp_syncookies = 1

After that Add the below code in /etc/rc.local and restart network

for f in /proc/sys/net/ipv4/conf/*/rp_filter;
do echo 1 > done
echo 1 > /proc/sys/net/ipv4/tcp_syncookies

===================

Monday, September 6, 2010

IP TABLE MODULE LOAD ISSUE ON OPENVZ

ftp connection to the server failed and it will throw an error like

[ajeesh@tech24 ~]$ ftp ftp.yourdomain.com
Connected to ftp.yourdomai.com (IP).
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.

Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode ()
ftp: connect: Connection timed out

Solution:-

pure-ftpd you could add the port range 30000:35000 to TCP_IN and add the following line to /etc/pure-ftpd.conf and then restart pure-ftpd:

PassivePortRange 30000 35000

after that we need to enter the port range 30000:35000 on /etc/csf/csf.conf on the line ' TCP_IN = ' [Allow incoming TCP ports]

This will fix my issue

Related issue also fixed
*WARNING* Since the Virtuozzo VPS iptables ip_conntrack_ftp kernel module is currently broken you have to open a PASV port hole in iptables for incoming FTP connections to work correctly. See the csf readme.txt under 'A note about FTP Connection Issues' on how to do this if you have not already done so.

csftest.pl
Testing ipt_recent...FAILED [Error: iptables: Unknown error 18446744073709551615] - Required for PORTFLOOD feature


=====================
To activate passive mode in Firewall Pf and FTP server PureFtp.
1. First we need to check the conf of pureftp PassivePortRange
Suppose it is 30001 32000
2. open your pf configuration file /etc/pf.conf and enter the following rule
pass in on $ext_if proto tcp from any to any port 30000 >< 32001 keep state
3. ipf -Fa -f /etc/ipf.rules;sleep 40;ipf -Fa :- for testing the firewall for 40 sec
4. if step 3 is ok then reload your pf firewall : ipf -Fa -f /etc/ipf.rules
=======================

FFmpeg FFmpeg-PHP Mplayer Mencoder flv2tool LAME MP3 Encoder INSTALLATION

Here We can discus how to install FFMPEG and it associated friends ( Supporting Software) on Linux Servers.
FFmpeg
FFmpeg-PHP
Mplayer Mencoder
flv2tool
LAME
MP3 Encoder

****************

For Installing FFMPEG and its friends we need to make sure the following packages already installed on your server
gcc,gmake,make, libcpplibgcc, libstdc++, gcc4, gcc4-c++, gcc4-gfortran, subversion, ruby ncurses-devel -y

If not please install these packages using yum
yum install gcc gmake make libcpp libgcc libstdc++ gcc4 gcc4-c++ gcc4-gfortran subversion ncurses-devel -y
Install Ruby, Ruby Gem, Fastthread, Mongrel and Rails on cpanel servers by using the command
/scripts/installruby
Please do the following Steps

cd /usr/local/src/

Next We need to Download the required MODULES .
wget www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2
wget rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz
wget easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz

wget superb-west.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.1.tbz2
Or
wget http://space.dl.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2

wget downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
wget downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz

and wget http://www.tortall.net/projects/yasm/releases/yasm-0.7.0.tar.gz

After that extract these downloaded MODULES using ' tar zxf filename '

mkdir /usr/local/lib/codecs/

By using Subversion we can down load packages for FFMPEG and Mplayer
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd /usr/local/src/mplayer

svn update

PS: Please note that now the SNV version has been not updated for a long time so it is good to use git installation instead of SNV: 19-08-2011(Firday)
cd /usr/local/src/
mv /usr/local/src/essential-20061022/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/

After that We can install one by one packages

LAME:-
cd /usr/local/src/lame-3.97
./configure
make && make install

LIBOGG:-
cd /usr/local/src/libogg-1.1.3
./configure --enable-shared && make && make install

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH

LIBVORBIS:-
cd /usr/local/src/libvorbis-1.1.2
./configure && make && make install

FLVTOOL2:-
cd /usr/local/src/flvtool2_1.0.5_rc6/
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

MPLAYER:-
cd /usr/local/src/mplayer
./configure && make && make install

FFMPEG:-
cd /usr/local/src/ffmpeg/
./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared
make
make install

export LD_LIBRARY_PATH=/usr/local/lib/

ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51
ln -s /usr/local/lib/libavdevice.so.52 /usr/lib/libavdevice.so.52
ln -s /usr/local/lib/libavformat.so.52 /usr/lib/libavformat.so.52

FFMPEG-PHP Extension:-
cd /usr/local/src/
wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download

[0.50 version throws me error once i have used this version fixed my error]

tar -xjf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0/
phpize
./configure
make
make install

make install will shows you the extension file directory for ffmpeg.so. This Exension should be include in your php.ini file

extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/ffmpeg.so

Finally Restart Appache
service httpd restart

Veryfy: Create a info.php file (ie,) and verify this module is loaded or not.

*************************************
While compiling ffmpeg-php Error:ffmpeg_frame.c:421: error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function)

/usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function ‘zif_ffmpeg_frame_toGDImage’: /usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: ‘PIX_FMT_RGBA32′ undeclared (first use in this function) /usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: (Each undeclared identifier is reported only once /usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: for each function it appears in.) /usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function ‘zif_ffmpeg_frame_ffmpeg_frame’: /usr/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:421: error: ‘PIX_FMT_RGBA32′ undeclared (first use in this function)


***********************
update ffmpeg_frame.c and replace every instance of PIX_FMT_RGBA32 with PIX_FMT_RGB32

vi ffmpeg_frame.c

:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32

:w :q!

Solve my issue

**********************
# ffmpeg -v
ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory

Fix:
location of these libraries is /usr/local/lib/ such as /usr/local/lib/libavdevice.so.52 .

ln -s /usr/local/lib/libavdevice.so.52 /usr/lib/libavdevice.so.52
ln -s /usr/local/lib/libavformat.so.52 /usr/lib/libavformat.so.52
etc ... like we done for ibavformat.so.50

Or we can fix by

/etc/ld.so.conf.d/libc.conf open with your favourite editor and include this line /usr/local/lib

if /etc/ld.so.conf.d/libc.conf not there create one called /etc/ld.so.conf.d/ffmpeg.conf (or even libc.conf) and add the line /usr/local/lib in it, then run sudo ldconfig -v.


Iam Expecting some valuable suggestions on this posting
 *******

Error :   [STDERR] PHP Warning: Module 'ffmpeg' already loaded in Unknown on line 0

This seems you have multiple entries for ffmpeg.so extension on your php.ini file. So you need to check this file and remove the unwanted extension for ffmpeg.


*** THANK YOU ****

If you want to install ffmpeg and its components on your server please contact me on +91956799499 and i will help on this. Free of cost :)

Enhanced by Zemanta

Saturday, September 4, 2010

YUM ERROR

YUM INSTALLATION ERROR
ERROR:-Loaded plugins: presto, refresh-packagekit
Existing lock /var/run/yum.pid: another copy is running as pid 2448.
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory : 51 M RSS ( 79 MB VSZ)
Started: Sat Sep 4 20:17:17 2010 - 10:34 ago
State : Traced/Stopped, pid: 2448
==========================================================
To solve this issue . Please do the following
From this message you can easily find out what process ID is for yum. It is 2448 or you can find out the yum process ID by using the following command

[root@localhost ajeesh]# ps aux | grep yum
root 2448 0.5 2.5 80520 52392 pts/1 T 20:17 0:04 /usr/bin/python /usr/bin/yum install lynx*

nest step please kill that process and re-execute your yum install again

This solve my yum install issue

Thursday, August 5, 2010

RvSiteBuilder

Fatal error:
The encoded file /var/cpanel/rvglobalsoft/rvsitebuilder/www/ionctestlicense.php requires a license file.
The license file /var/cpanel/rvglobalsoft/rvsitebuilder/rvsitebuilder.lic has expired. in Unknown on line 0


For fixing the issue do run the following commands
root@server1 [~]# rm -f /var/cpanel/rvglobalsoft/rvsitebuilder/var/INSTALL_COMPLETE.php
root@server1 [~]# rm -f /var/cpanel/rvglobalsoft/rvsitebuilder/rvsitebuilderversion.txt
root@server1 [~]# perl /usr/local/cpanel/whostmgr/docroot/cgi/rvsitebuilderinstaller/autoinstaller.cgi


# /scripts/makecpphp [It just rebuilds the copy of PHP that cPanel and WHM use (not your public version of PHP) and then makes sure that cPanel and WHM are set to use that version.]

Last
#Go to root WHM/RVSiteBuilder, it will automatically rebuild the database for you.

Wednesday, July 14, 2010

PHPMYADMIN

1. PHPMYADMIN is not showing the database which are creating

But while checking the databases through WHM/MYSQL you can see these data bases are available for that particular user.
Ans:- Please check the user privileges and grant the privilege for that user
Check the database username and cpanel user name are same or not. Most probably it is due to this issue (may be user cpanel user name is a invalid one like "."symbol something) so we need to change username in WHM.

Sunday, July 11, 2010

COMMON TOOLS

1. Pidgin

in default linux (fedora) pidgin is there.
#yum install pidgin*
#yum update pidgin*

pidgin-guifications-2.16-4.fc12.i686 --> It is a Pidgin plugin that displays popups display if user writing a message , user log out/login etc ..

#yum install pidgin-guifications-2.16-4.fc12.i686

Saturday, July 10, 2010

VIDEO PLAYERS - vlc

VIDEO PLAYERS
1. VLC

Installing vlc player on your linux fedora10/11/ recently i have tested on my fedora16

Please do the following steps to get the vlc player in your linux machines.

[root@tech24 ajeesh]# wget http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm Retrieving http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm warning: /var/tmp/rpm-tmp.Z6FQqR

ajeesh]# rpm -ivh rpmfusion-free-release-stable.noarch.rpm

Total download size: 22 M
Installed size: 58 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
updates/prestodelta | 11 kB 00:00
Processing delta metadata
Package(s) data still to download: 22 M
(1/34): a52dec-0.7.4-15.fc11.i586.rpm

ERRORs
------
VLC does not support the audio or video format "XVID". Unfortunately
there is no way for you to fix this.
--------
]# yum install vlc*
Loaded plugins: presto, refresh-packagekit
Setting up Install Process
Package vlc-devel-1.0.6-1.fc13.i686 already installed and latest version
Package vlc-1.0.6-1.fc13.i686 already installed and latest version
Package vlc-nox-1.0.6-1.fc13.i686 already installed and latest version
Package vlc-plugin-jack-1.0.6-1.fc13.i686 already installed and latest version
Package vlc-core-1.0.6-1.fc13.i686 already installed and latest version
--------------------
to check the commands
$ rpm -qa 'vlc*' 'libxine*' 'libffmpeg*' 'libav[^a]*' '*gstreamer*' | sort

SSL INSTALLATION

Category:WikiProject Cryptography participantsImage via Wikipedia


Requirements:-
We need a dedicated IP for the particular domain

How to make the dedicated IP for a domain
goto whm
Main-> IP Functns -> change sites ip address Use the Free IP
How to find out the Free Ip Main >> IP Functions >> Show IP Address Usage
-----------------
First we need to create a CSR (certificate signing request) and give that to the cert provider (Geotrust, Verisign, etc.) CSR you can create from your WHM [Main >> SSL/TLS >> Generate a SSL Certificate and Signing Request]. We will get the ourdomainname.crt from Signing Authority.
In command line:-
* do not provide any password for authentication , if we provide password while generating a csr, every time the web server is restarted, you'd have to provide a password.This is a bad choice.
cd /home/tuxunited/cert
1. Generating a key
#openssl genrsa -out www.tuxunited.com.key 2048

Generating RSA private key, 2048 bit long modulus ....................................................................................+++ ....................................................+++ e is 65537 (0x10001)

2. Generating csr

# openssl req -new -key www.tuxunited.com.key -out www.tuxunited.com.csr

You are about to be asked to enter information that will be incorporated

into your certificate request.

What you are about to enter is what is called a Distinguished Name or a DN.

There are quite a few fields but you can leave some blank

For some fields there will be a default value,

If you enter '.', the field will be left blank.

Country Name (2 letter code) [AU]:IN

State or Province Name (full name) [Some-State]:Kerala

Locality Name (eg, city) []:El TVPM

Organization Name (eg, company) [Internet Widgits Pty Ltd]:TUXUNITED PVT LTD:

Organizational Unit Name (eg, section) []:

Common Name (eg, YOUR name) []:www.tuxunited.com

Email Address []:

Please enter the following 'extra' attributes

to be sent with your certificate request

A challenge password []:

An optional company name []:

This .csr file send to the certificate signing authority for getting .crt and .ca-budle

CA Bundle and .key will automatically generate in our sever once we make the CSR.
Once we received this we can install ssl for our domain [Main >> SSL/TLS >> Install a SSL Certificate and Setup the Domain] paste the .csr and CA certificates (.key will automatically come once you paste the .crt) FINALLY CLICK SUBMIT

For Command Prompt
ourdomainname.crt file to /usr/share/ssl/certs/ OR /etc/ssl/certs/ directory
public key = ourdomainname.crt
private key = .key[/usr/share/ssl/private/ or /etc/ssl/private/]

private key file permission should be readable by root. [ie , drwx------ 2 root root 4096 Jul 9 23:36 private/]

Next We need to install the Inter mediate Certificate[ It is optional]
You need to install the Intermediate CA certificates for browsers to trust your certificate. The Intermediate CA certificates are in the form of SERVERNAME.ca-bundle.
In Virtual Host section for your configuration file, you need to do the following.

Copy the SERVERNAME.ca-bundle file to
files[/usr/share/ssl/certs OR /etc/ssl/certs/ ]

Add the following line to the SSL section of the httpd.conf
SSLCACertificateFile /etc/httpd/conf/SERVERNAME.ca-bundle --> if all are in the same locatin

If in different location
*SSLCertificateFile /usr/share/ssl/certs/urdomainname.com.crt
*SSLCertificateKeyFile /usr/share/ssl/private/ourdomainname.com.key
*SSLCACertificateFile /usr/share/ssl/certs/ourdomainname.com.cabundle

FINALLY RESTART APACHE

To check the SSL Certificate
http://www.digicert.com/help/
commands
openssl s_client -connect domainname:443

ERRORS
1. You'll also get an error if you try to access an URL securlely that doesn't match the hostname.
If for example you generate a cert fo https://yourdomain.com
It'll throw up an error if you go to: https://www.yourdomain.com
Because the 2nd domain has a www. in it, but the cert was generated for the hostname without the www.

2.browser showed "This Connection is Untrusted"
any idea ??? please (use the correct .crt and host name)
Ans:- Try to uninstall and reinstalled your ssl once again may this fix for you !!

12-07-2010
3. Dont have blue / green tab on url bar.
ANs:- You need to make sure all your links on the page use https:// and not http://
without this you will not get a fully secured connection
Enhanced by Zemanta

Friday, July 9, 2010

Commands-Reference

1. Create a domain name via command
/scripts/wwwacct

2. Grep / Find Command

** tail -100 /usr/local/cpanel/logs/error_log | grep -A 10 quota
The result will be the last 10 lines after 'quota'.

** # grep -R searchword * --> search for a particular word
** # find /usr/home -iname ".svn" -exec ls -lad '{}' \;
** # find /home/user/public_html/ -type f -exec sed -i 's/searchword/requiredword/g' {} \; --> This will search and replace all 'searchword' with 'requiredword' on all files for a particular directory.
** # find / -size +500M -exec ls -lh {} ';' | awk '{ print $9 ": " $5 }' --> for listing 500MB size files under / directory

3. Rsync command
for syncing source to destination for two remote server
rsync -av -e ssh /home/villages/ root@:/home/villages/

4. Tar / untar / Extraction

$ tar zxf filename.tar.gz
$ tar zxf filename.tgz
$ tar jxf filename.tar.bz2
$ tar jxf filename.tbz2

5. PASSWORD change for all users on a server
for x in `cat /etc/passwd | grep bash | cut -d":" -f1`; do echo 0182y098ya890sdy9asd | passwd --stdin $x ; done

6. How can you check your os is 32bit or 62 bit
[ajeesh@tech25 ~]$ arch
i686
[ajeesh@tech25 ~]$ which passwd
/usr/bin/passwd
[ajeesh@tech25 ~]$ file /usr/bin/passwd
/usr/bin/passwd: setuid ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

the easiest way to find out is issuing bellow the command on your Linux as well as FreeBSD
[ajeesh@tech26 ~]$ getconf LONG_BIT
32


7. dmidecode
using this command we can check full details for processor , MOB, HDD and other more hardware

[root@tech24 ajeesh]# dmidecode
# yum install dmidecode --> for install dmidecode

8. Centos verion
[root@server1 /]# cat /etc/redhat-release
CentOS release 5.2 (Final)

EMAIL ISSUES

A. To set no. of emails for particular domains in hour
cd /var/cpanel/maxemailsperdomain/
create the particular domain
then enter the number of mails as per your needs

B. Error:
temporarily rejected RCPT xxx@domain1.com lowest numbered MX record points to local host (while verifying xxx@domain1.com from yyy@domain2.com)


Solution:

Add the domain name domain1.com to /etc/localdomains and restart exim that should fix the issue. The file /etc/localdomains are the list of the domains that
Exim is meant to handle mails for.

Wednesday, July 7, 2010

HOSTING ISSUE

1. subdomain character issue:-

While creating a subdomain which is having more that 25 letters. Then you will terminated subdomain creation. This one you can avoid by giving less than 25 character length for the document root for that your new subdomain.

PHP.INI

We can create separate php.ini configuration for each domains. For this we have to put a php.ini file to /home/user/public_html/

Idea from Dan Thompson

25-06-2011(Saturday)

" suPHP_ConfigPath /home/username/public_html " set this line in your .htacess file will make all the addon domains and sub folders values make effect the values you have described in /home/username/public_html/php.ini file

Suppose if you want to increase the upload file size to 64MB please do the following steps

Edit your php.ini file with the following details
First : upload_max_filesize = 64M -> default it will be 8MB
Second: post_max_size = 64M
Third : max_execution_time = 300 -> default value will be 30

Saturday, July 3, 2010

INSTALLATIONS

Description unavailableImage by Sabino . via Flickr
Write text here...
INSTALLATIONS

cPanel ‘phpextensionmgr’ script allows you to install various extensions. To list the available PHP extensions run the following command.

root@LHS [~]# /scripts/phpextensionmgr list
Available Extensions:
EAccelerator
IonCubeLoader
Zendopt
SourceGuardian
PHPSuHosin

# /scripts/phpextensionmgr –help
Usage:
phpextensionmgr [options] [action] [extension]

Options:
–help Help message
–prefix Installation prefix (normally /usr/local or /usr/local/php4)
Actions:
install Install or update the extension
uninstall Uninstall the extension
status Display the installation status of the extension
list Show available extensions

To install Zend Optimizer, execute the command

root@LHS [~]# /scripts/phpextensionmgr install Zendopt


A. IORNCUBE LOADER

Installing ioncube loader on Linux as well as freeBSD

Iorn Cube loader is mainly using for source code protection for softwares and wep pages.

Before going to installed this make sure selinux had been disabled in your server.
Get the latest version of the ionCube Loader from http://downloads.ioncube.com/loader_downloads.
1. wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
2. tar -xvfz ioncube_loaders_lin_x86.tar.gz
3. cd ioncube/
4. mkdir /usr/local/lib/ioncube
5. Next we have to check the PHP version from that we have to discover which shared Object has
to select for the iorncube loader[ For example PHP -V PHP Version 5.3.2 loader should be ioncube_loader_lin_5.3.so
6. Now edit the Php.ini file as given bellow
zend_extension=/usr/local/lib/ioncube/ioncube_loader_lin_5.3.so
7. Copy the ioncube loader wizard "loader-wizard.php" from ioncube directory to Document root.
8. restart apache server.
9. run ioncube loader in your browser [www.yourdomain.com/loader-wizard.php]

For installing in FreeBSD we need to download http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_fre_8_x86.tar.gz (after verifying uname -a)

path on php.ini should be
zend_extension=/usr/local/lib/ioncube/ioncube_loader_fre_5.2.so [ in the case of freebsd with php version 5.2.13 ]

F I N I S H

B. SOURCEGUARDIAN

1. wget http://www.sourceguardian.com/ixeds/ixed4.lin.x86-32.tar.gz
2. untar tar -zxf ixed4.lin.x86-32.tar.gz
3. find out the extemsion directory using the cmd php -i | less (search for the term extension)
[eg: extension_dir => /usr/local/lib/php/extensions/no-debug-non-zts-20060613 => /usr/local/lib/php/extensions/no-debug-non-zts-20060613 ] so we will know that /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ this is the directory we have to copy the loader ixed.
4. Next as per the php version we can decide which loader should be required
cp ixed.5.2.lin /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
5. Then we need to edit the php.ini file

php.ini file most probably is in your /etc/php.ini or /usr/local/lib/php.ini

6. vi /usr/local/lib/php.ini (search for the line extensions)

add this line: extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.2.so"


7. restart your apache server.

C. json

1.  yum install gcc make
2.  yum install php-pear
3.  pecl install json
4. add extension=json.so  on your php.ini and restart apache

[root@server modules]# php -m | grep json
json

Friday, July 2, 2010

QMAIL

QMAIL - 1
Error :- " This is the qmail-send program at server1.domainame.com.com.(different name as your hostname) I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out."

That is Hostname is wrongly set for the qmail
]# hostname
server1.urdomain.com -> that is fine

]# cd /var/qmail/control
control]# ls
defaultdomain locals me plusdomain rcpthosts
]# cat * --> check all the file whether we have configured the right hostname if not change the correct one.
Finally restart your qmail and webserver.

Wednesday, June 30, 2010

WEB SITE FOR REFERENCE

WEB SITEs

Proxy websites:-
http://www.hidemyass.com
kproxy.com

Web site speed test:-
http://tools.pingdom.com
http://www.iwebtool.com/speed_test

RPM Download:-
http://rpm.pbone.net/

DNS Related:-
intodns.com
http://www.dnsstuff.com --> whois lookup

RBL(spam blocking):-
http://www.mxtoolbox.com

Web Site Loading in different geolocation:-
http://www.siteuptime.com
http://www.hyperspin.com

Spam email tracking:-
http://www.pchell.com/support/spywaretools.shtml
http://www.3dmail.com

MYSQL - REPLICATION Master-Slave

MySQL's logo. Converted from EPS with Scribus ...Image via Wikipedia
MYSQL - Replication Master-Slave

*Using this we can replicate our mysql database server to one or more slave
* This is asynchronous , slave server need not be be connected permenantly to the master server.
* all the writes and updates occured on master server. Reads can takes place in slave box

Mysql-Master server:-
* must enable server unique ID and master bin log, Binary login is sending the master data to slave. so this is the main important thing.
* For configuring Master first we need to shutdown mysql-server and the edit my.cnf file. Details are included under [mysqld] section.
* To enable binary log using log-bin represented the name as "mysql-bin" or db-bin and serve id can mention as server-id=1(positive integer),default value is 0.
after that server needs to be reboot.

Mysql-Slave Server
* first need to specify the server ID

Replication user creation:[On Master Box]
*For replication slave need to connect to master box using a user name and password. So we need to create a user and password on Master box and grand privilege for the slave box on master box.

Setting the Master configuration on Slave
To make our slave box communicate with master box we need to setup some connection information using ' CHANGE MASTER TO"




Here I am going to describe how to database replication using Mysql.
Mysql replication is a asynchronous data transfer(ie, database on the master server are not immediately replicated to the database on the slave server).
This Replication Type is Master-Slave
A. MASTER SET UP

1. Edit /etc/my.cnf and enter the following details under mysqld
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
server-id = 1
log-bin=db-bin
relay-log=db-relay-bin

2.enter into the mysql database

mysql> GRANT REPLICATION SLAVE ON *.* TO 'replication'@'10.10.2.24' IDENTIFIED BY 'password';

Suppose that your slave server is '10.10.2.24' and that you want to create an account with a user name of 'replication' such that slave servers can use the account to access the master server using a password of 'password'.

3.mysql> FLUSH TABLES WITH READ LOCK;
Flush all the tables and block write statements

4.mysql> SHOW MASTER STATUS;
+---------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+---------------+----------+--------------+------------------+
| db-bin.000005 | 792 | | |
+---------------+----------+--------------+------------------+

OR
mysql> SHOW MASTER STATUS \G;
*************************** 1. row ***************************
File: db-bin.000005
Position: 792
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.00 sec)


So MASTER Side configuration has over ..

B SLAVE SERVER CONFIGURATION

1. Edit the file /etc/my.cnf and enter the details as follows
[mysqld]
server-id=2
master-host = 10.10.3.21
master-user = replication
master-password = password
master-port = 3306

10.10.3.21 is the MASTER server IP.

These information will be stored to /var/lib/mysql/master.info

Enter into the Mysql server
2. mysql> stop slave;
3. mysql> reset slave;
4. mysql> CHANGE MASTER TO MASTER_HOST='10.10.3.21', MASTER_USER='replication', MASTER_PASSWORD='password', MASTER_LOG_FILE='db-bin.000005';

Here 10.10.3.21 is your MASTER Server IP 'replication' is the master user 'password' is the password for your master server and 'db-bin.000005' is the Master log file this one you wll get while running the command mysql> SHOW SLAVE STATUS \G; in Master server

5. mysql> START SLAVE;

6. mysql> show slave status \G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.10.3.21
Master_User: replication
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: db-bin.000005
Read_Master_Log_Pos: 792
Relay_Log_File: mysqld-relay-bin.000002
Relay_Log_Pos: 934
Relay_Master_Log_File: db-bin.000005
Slave_IO_Running: Yes
Slave_SQL_Running: Yes

Last_Errno: 0

Exec_Master_Log_Pos: 792
Relay_Log_Space: 1090
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No

Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:

The process:- In Master Server(Alter,Delete) all details execute and 'I/O Thread' save to a log file called Binary Log(ie,db-bin.000005) And in slave(only Read) read the changes from Binary log to relay log and update to slave SQL Thread.

You can verify by checking the Seconds_Behind_Master details and Slave_IO_Running and Slave_SQL_Running

REPLICATION ERRORS and FIX

1. 'Last_IO_Error' => 'Got a packet bigger than > \'max_allowed_packet\' bytes'

This is due to 'max_allowed_packet' size. Increasing max_allowed_packet will fix the issue

Comments are welcomed

2. > show slave status \G
Slave_IO_State:
Master_Host: 10.10.210.198
Master_User: slave
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000916
Read_Master_Log_Pos: 863345946
Relay_Log_File: relay-bin.000012
Relay_Log_Pos: 374486719
Relay_Master_Log_File: mysql-bin.000916
......
;;;;;;;
;;;;;;;;

Last_Errno: 1064
Last_Error: Error 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near FrT;@28|$9|main_init$1|1$11|cookies_tmp%0|$10|mobipocket$1|0$7|cookies%0|$11|la' at line 3' on query. Default database: 'ebooks'. Query: 'REPLACE INTO session
(module, id, contents, timestamp) VALUES
('main', 'ee1db08d8f93bc69bbe0a1dd9a9cc301', 'FrT;@28|$9|main_init$1|1$11|cookies_tmp%0|$10|mobipocket$1|0$7|cookies%0|$11|last_viewed@5|%6|$5|brand$5|model$3|sku$26|Bankes, Tim, Hatter, David$82|Lotus Notes and Domino R6 Application Development Exam Cram 2 (Exam 620, 621, 622)$10|0768661498%6|$5|brand$5|model$3|sku$0|$28|CULTURE OF HUMAN TUMOR CELLS$10|0471270628%6|$5|brand$5|model$3|sku$11|Hwang, Andy$74|Ready-to-Eat Foods: Microbial Concerns and Control Measures (Adobe Reader)$13|9781420068634%6|$5|brand$5|model$3|sku$0|$45|TRANSATLANTIC VOYAGES & SOCIOL (Adobe Reader)$13|9781409405009%6|$5|brand$5|model$3|sku$0|$51|Practical Manual of Thyroid and Parathyroid Disea
Skip_Counter: 0
Exec_Master_Log_Pos: 374486582
Relay_Log_Space: 863347015
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL

FIX:
(none)> STOP SLAVE;
(none)> CHANGE MASTER TO master_log_file='mysql-bin.000916', master_log_pos=863345946;

[Here master_log_file and master_log_pos will get from your slave status .]

(none)> slave start;

3. Replication rebuild [ Rebuild from Scratch ]
Once we can not fix the replication error in any of our known ways we can do the last fix as Rebuild replication from Scratch

Please note down the following steps

on Master Server

1. flush tables with read lock; --> no write operation on databases only read operation will be available
2. reset master; ---> master will reset
3. show master status; ---> check for the out put

+------------------+-----------+
| File | Position |
+------------------+-----------+
| mysql-bin.000001 | 98 |
+------------------+-----------+

4. quit from mysql

5. stop mysql server service

6. make a copy of all files from /var/db/mysql to a local disk at first. If you copy over network it will take more time to complete

7. start mysql-server

On the slave box

1. Stop mysql-server service
2. move binary files /var/db/mysql/ from the master to /var/db/mysql/

3. chown -R mysql /var/db/mysql/

4. Start mysql-server service

enter into Mysql
5. STOP SLAVE;
6. CHANGE MASTER TO master_log_file='mysql-bin.000001', master_log_pos=98;
7. slave start;

Finish thats all please confirm whether your slave is running fine







Enhanced by Zemanta

Tuesday, June 29, 2010

CPANEL

Image representing cPanel Inc as depicted in C...



Cpanel notes:-

To check the current cpanel version please run the following command
# /usr/local/cpanel/cpanel -V

Directory -->/usr/local/cpanel/

3rdparty/ tool like fantastico, mailman are located here.

addons/ --> phpBB forums are here
base/ --> phpmyadmin, squirrelmail, skins, webmail etc located here
cgi-sys/ --> cgi files like cgiemail, formmail.cgi and formmail.pl etc
logs/ --> cpanel access log and error log
whostmgr/ ---> whm related files

WHM
Directory -> var/cpanel/
bandwidth/ – rrd files of domains
users/ or resellers --> reseller account details

10-07-2010
HOW TO CHANGE THE CPANEL THEME FOR ALL ACCOUNT TOGETHER WITH SAME THEME

The cPanel theme for an account is in the directory /var/cpanel/users/username file in the format CPMOD=x3... where x3 is the theme name. In WHM we can change the theme for accounts one at a time. But here we need to change all the account theme to X3 or etc theme for that please do the following steps
1. Execute the command
for i in `ls -la /var/cpanel/users/ | awk ‘{print $9}’ | sed ‘1,3 d’`; do sed -i “/CPMOD/d” $i; echo “CPMOD=x3″ >> $i; done;

2. As the files are updated manually, we need to execute /scripts/updateuserdomains to rebuild the cache.

12-07-2010:-
TO COPY CPANEL /backup folder to your local computer
The best command to use this SFTP as root login details
[ajeesh@tech24 ~]$ sftp root@

Then > cd /
> get backup

3. WHM/Cpanel Email

A. MAX EMAIL SEND PER HOUR
Server Configuration >> Tweak Settings we can see Mail section-> The maximum each domain can send out per hour (0 is unlimited)
B. If you like to give some extra no of mail sending permission to selected domains
1. [~]# vi /var/cpanel/maxemails
yourdomainname=100
2. After that you need to run the following command
/scripts/build_maxemails_config

APACHE

Notes:-
configuration --> /etc/httpd/conf/httpd.conf

/usr/local/apache/domlogs/sutename -> domain log files are stored here
libexec --> shared object(.so) files are stored eg libphp4.so,mod_rewrite.so

Restart commands
/etc/rc.d/init.d/httpd restart
/scripts/restartsrv_httpd -> cpanel script restart option

APACHE CONNECTIONs
To check the number of connections to port 80:
netstat -alntp | grep :80 | wc -l

To List the remote IPs connecting to your server on port 80:
netstat -alntp | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort

To List the uniq remote IPs and the number of connections from particular IP:
netstat -alntp | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

To find out apache down time

To find the location for httpd.pid
# ll -d /usr/local/apache/logs/httpd.pid

How to find out when apache last restarted
# ll /usr/local/apache/logs/httpd.pid

Apache config test, for test whether your apache settings are correct before restarting
#apachectl configtest

Thursday, June 24, 2010

Kmail Recovery

Kmail Recovery

Once we took the back of the /home/username directory , using the following commands you can recover your kmail without configuring the kmail settings.

These are should be done after closing the kmail application in your system.

1. scp -r [source server/pc]/home/ajeesh/.kde/share/apps/ [destination]ajeesh@10.10.2.24:/home/ajeesh/.kde/share/apps/kmail2
if you use root permission again we need to change the permission by using
chown -R ajeesh. .kde/share/apps/kmail2/

in destination server/PC
2. apps]$ mv kmail bak_kmail
3. apps]$ mv kmail2 kmail

After that
in Source server
4. scp -r [source server]/.kde/share/config/kmail* [destination server]kde/share/config/

we have to copy mail.eventsrc, kmail.notifyrc , kmailrc, kmailsnippetrc files

Now you have done the Kmail recovery without configuring your mail settings again.

cPanel Great Success Appearing on new account creation.

While accessing your website , It will show the Cpanel page instead of your correct web page

"cPanel Great Success Appearing on new account creation."

While restarting the httpd we will get the error as

]# service httpd restart
httpd: Syntax error on line no of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/mod_dav_svn.so into server: /usr/local/apache/modules/mod_dav_svn.so: undefined symbol: dav_xml_get_cdata

Solution
1. We have to take a back of httpd config file
#] cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bkp

Then

# /scripts/rebuildhttpdconf
Built /usr/local/apache/conf/httpd.conf OK
# service httpd restart

Wednesday, June 23, 2010

FFMPEG Installation

FFMPEG Installation

http://ajeeshbkannan.blogspot.com/search?q=ffmpeg

There is an easy script , we can install all the packages coming with this video streaming software

http://www.ffmpeginstaller.com/download/

This will cover all the packages such as ->ffmpeg * Mplayer * A52decoder
* Amrnb and Amrwb * All codecs * facc and faad2 * Ruby * flvtool2 * ffmpeg-php * Mplayer and Mencoder * Lame * Libogg * Libvorbis * Libtheora * Libwmf * opencoreamr * vorbistools * X264 * MP4Box * Xvidcore

I have tried this script and my fedora machine needed a re installation. Do this scripts at your own risks.

=====================
http://sourceforge.net/projects/ffmpeginstall/
#cd /usr/local/src
#wget http://sourceforge.net/projects/ffmpeginstall/files/ffmpeginstall.3.x/ffmpeginstall.3.2.1/ffmpeginstall.3.2.1.tar.gz/download
Servertechs#tar -xvzf ffmpeginstall.3.2.1.tar.gz

#cd ffmpeginstall.3.2.1

#./install.sh

Tuesday, June 22, 2010

Domain Transfer From Remote Server

In the Source server using cpanel user name and password first we have to create a backup for particular domain in -> Cpanel -> Backup
(This will be in the form of cpanelbackup.username.tar.gz)
2nd
From our server the destination server, make the ftp connection to the source server

ftp>get cpanelbackup.username.tar.gz

after downloading this file to our server

#mv cpanelbackup.username.tar.gz /home
#script/restorepkg

Last we have to change the ownership to the file and folder (ie, chown username.username -R *)

Next Idea is from Mr.Dan Thopson
After correcting the file permission even if particular is owned by root. So in WHM area the domain we just transferred wont be visible. So to fix that:
1. Log into WHM
2. Click on Reseller Center
3. Under "Reseller Modifications", select reseller account from the drop down list
4. Click on Change ownership of multiple accounts
5. Scroll down to find the account we just moved over, and check the box next to it, Then click the "Change owner of selected accounts" at the bottom of the page
He is saying " As far as I know this is the quickest way to do it, there's no simple way to do it via SSH ".

Unable to remove files within ./cache/. Please check directory

Whenever you are trying to change something on the forum /board/ like a members settings or the boards settings ou will encounter the error such as " Unable to remove files within ./../cache/. Please check directory permissions."
Like this situation we can do the following steps to avoid these errors.
1. Set folder permission for the cache to 755 (777 on some servers)
2. set all file inside the cache to 644 (666 on some servers).

Sunday, June 20, 2010

vzquota : (warning) Incorrect quota shutdown for id , recalculating disk usage

In VPS VEID is not restarting and VEID is DOWN / Locked
Error:-
[root@server ~]# vzctl start VEID
Starting VE ...
vzquota : (warning) Incorrect quota shutdown for id VEID, recalculating disk usage
vzquota : (error) quota check : lstat `sess_f3d432f92a5366e68dd74bce1aa437b7': No such file or directory
vzquota on failed [1]
[1]+ Killed vzctl start VEID


In Open VZ server particular VEID is down and we can not manually start that VEID.
[root@server~]# vzctl start 9894802
Starting VE ...
vzquota : (warning) Incorrect quota shutdown for id VEID, recalculating disk usage

[1]+ Stopped vzctl start VEID

[root@server~]# vzctl start VEID
VE already locked

This situation first we have to check the process ID for the locked VEID and kill that process.
[root@server ~]# vi /vz/lock/VEID.lck
we will get the process ID and
[root@server ~]# kill -9 PID

[root@server ~]# vzquota off VEID
[root@server ~]# vzquota on VEID
[root@server ~]# vzctl start VEID


2. [root@server]# vzctl enter 9896XX
enter into CT 989XXX failed
Unable to open pty: No such file or directory


Solution
# vzctl exec 9896556 /sbin/MAKEDEV pty
# vzctl exec 9896556 /sbin/MAKEDEV tty

After that restart your VE

Or try
# vzctl exec 9896xx update-rc.d -f udev remove

Saturday, June 19, 2010

TO SET TIME AND DATE IN LINUX

TO SET TIME AND DATE In LINUX
You must login as root
[root@tech24 ajeesh]# date -s "19 Jun 2010 01:09:00"
Sat Jun 19 01:09:00 IST 2010
[root@tech24 ajeesh]# date
Sat Jun 19 01:11:07 IST 2010

Friday, June 18, 2010

Downgrade MySQL from MySQL 5

Here we are discussing how to downgrade mysql version 5 to version 4.1
First we can take a full back of our existing MySQL database

1. ]$ mysqldump --compatible=mysql40 --all-databases > databases.sql

]$ rpm -qa | grep -i mysql-
2. Then remove /var/lib/mysql:]$ rm -Rfv /var/lib/mysql
3. Then edit /var/cpanel/cpanel.config and set as -> mysql-version=4.1
4. Make sure that the skip file isn't there:
rm -fv /etc/mysqlupdisable
5. Then install MySQL ----> /scripts/mysqlup --force
6. Then update the perl module --> /scripts/perlinstaller --force Bundle::DBD::mysql
7. Then recompile apache/php --> /scripts/easyapche
8. /scripts/upcp --force

Last restore the old MySQL database
]# mysql database < databases.sql

Thursday, June 17, 2010

FANTASTICO De Luxe

FANTASTICO Cannot install here, there's already a script installed in the root

If you remove wordpress or Joomla file manually in your server and latter if you install these surly you will encountered a error. This section i will show you how you can avoid this.

1. Delete the files fantversion.php and fantastico_filelist.txt in the public_html directory
2. Edit the file /home/user name/.fantasticodata/installed_in_root.php and remove the text
$installed_in_root["yourdomain.com"] = 1;
3. Remove the file:
/home/username/.fantasticodata/WordPress/yourdomain.com|

**Idea got from Dan Thompson

2. Fantastico is not installed at the default location /usr/local/cpanel/3rdparty/fantastico. Either move the Fantastico directory from it's current location to /usr/local/cpanel/3rdparty/fantastico OR enable ioncube loaders in WHM -> Tweak settings.

first need to check ioncube enabled in WHM->Tweak Settings
a.root@hyrule [~]# /scripts/phpextensionmgr install IonCubeLoader
And restart cpanel and retry, again the same issue persist
b. /scripts/makecpphp
And restart cpanel and retry, again the same issue persist
c. cpanel update with /scripts/upcp --force
==============
Fantastico Installation

Fantastico De Luxe is a free scripts installer with a variety of over 40 PHP-based web applications.
In Fantastico there is a list of the most popular and widely used Third party open source software. With just a few clicks of the mouse any of the applications can be installed and set up on a web site.

Please do the following steps for installing Fantastico on your cpanel server
cd /usr/local/cpanel/whostmgr/docroot/cgi
wget -N http://files.betaservant.com/files/free/fantastico_whm_admin.tgz
another alternate location, wget -N http://netenberg.com/files/free/fantastico_whm_admin.tgz
tar -xzpf fantastico_whm_admin.tgz
rm -rf fantastico_whm_admin.tgz

Now go here:
WHM -> Plugins-> Fantastico De Luxe WHM Admin install using the default setting

After the installation complete go to setting

After installation go to" Settings " do the settings, * are essential for a proper functioning of Fantastico installations.
PHPsuexec (*) = check whether you have enabled suphp on your server or not

/usr/local/cpanel/bin/rebuild_phpconf --current
Available handlers: suphp dso cgi none
DEFAULT PHP: 5
PHP4 SAPI: suphp
PHP5 SAPI: suphp
SUEXEC: enabled
This output shows that Suphp is enableb on your server

After dowing this Fantastico is not enabled on your Cpanel you need to check whether tick mark is there on Main >> Packages >> Feature Manager

Wednesday, June 16, 2010

GOOGLE APPS SETTINGS for Mail

Hi this section i would like to introduce how to setup Mail Application

After setup a primary master account with google[http://www.google.com/apps/intl/en/business/index.html]. After that setup mail application for your domain.

Next we have to edit the DNS zone file for the MX record
We have to delete the existing MX record before entering the new MX record. And enter the following MX server address.

ASPMX.L.GOOGLE.COM.
ALT2.ASPMX.L.GOOGLE.COM.
ASPMX3.GOOGLEMAIL.COM.
ASPMX5.GOOGLEMAIL.COM.

You may not need to enter the priority values.(default it will take 1,5,10,10]

MYSQL

MYSQL

Main Configuration file is in /etc/my.cnf

Password stored in /root/.my.cnf

Service Start and stop
/etc/rc.d/init.d/mysqld start/stop/restart

How to Reset Root Password
ISSUE:- [root@tech23 ~]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

1. service mysql stop
2. enter mysql command prompt using mysqld_safe --skip-grant-tables $
3. mysql>UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
4. Quit from Mysql and run the command " service mysql restart "

[root@tech23 ~]# service mysqld stop
[root@tech23 ~]# service mysqld status
mysqld is stopped
[root@tech23 ~]# mysqld_safe --skip-grant-tables &
[2] 18962
[root@tech23 ~]# 110222 17:19:53 mysqld_safe Logging to '/var/log/mysqld.log'.
110222 17:19:53 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

[root@tech23 ~]# mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("ajeesh-your new password") where User='root';
Query OK, 1 row affected (0.02 sec)
Rows matched: 4 Changed: 1 Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.06 sec)

Thats all your


GRANT PRIVILEGES

mysql> GRANT ALL PRIVILEGES ON DBname.* TO user@ IDENTIFIED BY 'password';


mysql> flush privileges;
What all privileges that user has got?
mysql> show grants for user@localhost;

How to Find Out MYSQL Users
1. Enter into the Mysql database
2. Mysql> use mysql;
3. mysql> select distinct user from user;

If Any Table In the Databases are Corrupted
1. cd /var/lib/mysql/
2. From there run the command myisamchk -r *.MYI

Max_connection
mysql> show variables like "%max_connection%";
OR
in linux command prompt
#mysqladmin -p'password' ex|grep Threads_connected


DO SECTION

MYSQL Database Bachup
1. $ mysqldump -h host -u user -p database > backup.sql --> to create the backup
2. mysql -h host -u user -p -D database < backup.sql --> to restore the database from backup

Increase the No Of Mysql Connection
mysql> show processlist;
#vi /etc/my.cnf
max_connections= increase the no
# service mysql restart






ERROR SECTION

A Mysql Is Not Getting Started
1. vi /etc/my.cnf add line ' innodb_force_recovery = 4 '
2. comment out skip-innodb like #skip-innodb
3. Restart

ADDING REMOTE MYSQL CONNECTIONS
1. Go to WHM Main >> SQL Services >> Additional MySQL Access Hosts, Here we have add the IP address which we needs to access the database
2. Go to Cpanel under 'mysql' section, click on 'remote mysql' and Type that Remote Host IP

MYSQL DROP , DELETE , TRUNCATE TABLEs (01-12-2010)
Differences
DROP -> Delete the table from your database
Syntax : drop table friends(table name);

TRUNCATE -> Delete the contents from the table and if you have any auto increment it will reset to 0(from start again). It is very safe command for deleting contents from a table.
Syntax :
mysql> truncate table friends;
Query OK, 0 rows affected (0.00 sec)

DELETE -> Delete all the contents from table and will not reset your auto increment to 0 it will start again from the next value
Syntax : delete from friends(table name);