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